From eea7bd2fe6d75c1653dc27ec8ce80ece47dbb426 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 24 Mar 2020 10:48:44 -0700 Subject: [PATCH] feat: adds the v1 API surface (#134) --- packages/google-cloud-webrisk/.jsdoc.js | 2 +- .../google/cloud/webrisk/v1/webrisk.proto | 352 + .../google-cloud-webrisk/protos/protos.d.ts | 2043 +++++ .../google-cloud-webrisk/protos/protos.js | 7347 ++++++++++++++--- .../google-cloud-webrisk/protos/protos.json | 409 +- .../samples/quickstart.js | 4 +- packages/google-cloud-webrisk/src/index.ts | 6 +- packages/google-cloud-webrisk/src/v1/index.ts | 19 + .../src/v1/web_risk_service_client.ts | 616 ++ .../v1/web_risk_service_client_config.json | 45 + .../src/v1/web_risk_service_proto_list.json | 3 + .../google-cloud-webrisk/src/v1beta1/index.ts | 2 +- .../web_risk_service_v1_beta1_client.ts | 12 +- packages/google-cloud-webrisk/synth.metadata | 24 +- packages/google-cloud-webrisk/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic-web_risk_service-v1.ts | 304 + ...gapic-web_risk_service_v1_beta1-v1beta1.ts | 2 +- .../google-cloud-webrisk/webpack.config.js | 2 +- 21 files changed, 10026 insertions(+), 1174 deletions(-) create mode 100644 packages/google-cloud-webrisk/protos/google/cloud/webrisk/v1/webrisk.proto create mode 100644 packages/google-cloud-webrisk/src/v1/index.ts create mode 100644 packages/google-cloud-webrisk/src/v1/web_risk_service_client.ts create mode 100644 packages/google-cloud-webrisk/src/v1/web_risk_service_client_config.json create mode 100644 packages/google-cloud-webrisk/src/v1/web_risk_service_proto_list.json create mode 100644 packages/google-cloud-webrisk/test/gapic-web_risk_service-v1.ts diff --git a/packages/google-cloud-webrisk/.jsdoc.js b/packages/google-cloud-webrisk/.jsdoc.js index 3419c972a09..9315c8cf0f2 100644 --- a/packages/google-cloud-webrisk/.jsdoc.js +++ b/packages/google-cloud-webrisk/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-webrisk/protos/google/cloud/webrisk/v1/webrisk.proto b/packages/google-cloud-webrisk/protos/google/cloud/webrisk/v1/webrisk.proto new file mode 100644 index 00000000000..b85598ab3a9 --- /dev/null +++ b/packages/google-cloud-webrisk/protos/google/cloud/webrisk/v1/webrisk.proto @@ -0,0 +1,352 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.webrisk.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.WebRisk.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/webrisk/v1;webrisk"; +option java_multiple_files = true; +option java_outer_classname = "WebRiskProto"; +option java_package = "com.google.webrisk.v1"; +option objc_class_prefix = "GCWR"; +option php_namespace = "Google\\Cloud\\WebRisk\\V1"; + +// Web Risk API defines an interface to detect malicious URLs on your +// website and in client applications. +service WebRiskService { + option (google.api.default_host) = "webrisk.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Gets the most recent threat list diffs. These diffs should be applied to + // a local database of hashes to keep it up-to-date. If the local database is + // empty or excessively out-of-date, a complete snapshot of the database will + // be returned. This Method only updates a single ThreatList at a time. To + // update multiple ThreatList databases, this method needs to be called once + // for each list. + rpc ComputeThreatListDiff(ComputeThreatListDiffRequest) returns (ComputeThreatListDiffResponse) { + option (google.api.http) = { + get: "/v1/threatLists:computeDiff" + }; + option (google.api.method_signature) = "threat_type,version_token,constraints"; + } + + // This method is used to check whether a URI is on a given threatList. + // Multiple threatLists may be searched in a single query. + // The response will list all requested threatLists the URI was found to + // match. If the URI is not found on any of the requested ThreatList an + // empty response will be returned. + rpc SearchUris(SearchUrisRequest) returns (SearchUrisResponse) { + option (google.api.http) = { + get: "/v1/uris:search" + }; + option (google.api.method_signature) = "uri,threat_types"; + } + + // Gets the full hashes that match the requested hash prefix. + // This is used after a hash prefix is looked up in a threatList + // and there is a match. The client side threatList only holds partial hashes + // so the client must query this method to determine if there is a full + // hash match of a threat. + rpc SearchHashes(SearchHashesRequest) returns (SearchHashesResponse) { + option (google.api.http) = { + get: "/v1/hashes:search" + }; + option (google.api.method_signature) = "hash_prefix,threat_types"; + } + + // Creates a Submission of a URI suspected of containing phishing content to + // be reviewed. If the result verifies the existence of malicious phishing + // content, the site will be added to the [Google's Social Engineering + // lists](https://support.google.com/webmasters/answer/6350487/) in order to + // protect users that could get exposed to this threat in the future. Only + // projects with CREATE_SUBMISSION_USERS visibility can use this method. + rpc CreateSubmission(CreateSubmissionRequest) returns (Submission) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/submissions" + body: "submission" + }; + option (google.api.method_signature) = "parent,submission"; + } +} + +// Describes an API diff request. +message ComputeThreatListDiffRequest { + // The constraints for this diff. + message Constraints { + // The maximum size in number of entries. The diff will not contain more + // entries than this value. This should be a power of 2 between 2**10 and + // 2**20. If zero, no diff size limit is set. + int32 max_diff_entries = 1; + + // Sets the maximum number of entries that the client is willing to have + // in the local database. This should be a power of 2 between 2**10 and + // 2**20. If zero, no database size limit is set. + int32 max_database_entries = 2; + + // The compression types supported by the client. + repeated CompressionType supported_compressions = 3; + } + + // Required. The threat list to update. Only a single ThreatType should be specified. + ThreatType threat_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The current version token of the client for the requested list (the + // client version that was received from the last successful diff). + // If the client does not have a version token (this is the first time calling + // ComputeThreatListDiff), this may be left empty and a full database + // snapshot will be returned. + bytes version_token = 2; + + // Required. The constraints associated with this request. + Constraints constraints = 3 [(google.api.field_behavior) = REQUIRED]; +} + +message ComputeThreatListDiffResponse { + // The expected state of a client's local database. + message Checksum { + // The SHA256 hash of the client state; that is, of the sorted list of all + // hashes present in the database. + bytes sha256 = 1; + } + + // The type of response sent to the client. + enum ResponseType { + // Unknown. + RESPONSE_TYPE_UNSPECIFIED = 0; + + // Partial updates are applied to the client's existing local database. + DIFF = 1; + + // Full updates resets the client's entire local database. This means + // that either the client had no state, was seriously out-of-date, + // or the client is believed to be corrupt. + RESET = 2; + } + + // The type of response. This may indicate that an action must be taken by the + // client when the response is received. + ResponseType response_type = 4; + + // A set of entries to add to a local threat type's list. + ThreatEntryAdditions additions = 5; + + // A set of entries to remove from a local threat type's list. + // This field may be empty. + ThreatEntryRemovals removals = 6; + + // The new opaque client version token. This should be retained by the client + // and passed into the next call of ComputeThreatListDiff as 'version_token'. + // A separate version token should be stored and used for each threatList. + bytes new_version_token = 7; + + // The expected SHA256 hash of the client state; that is, of the sorted list + // of all hashes present in the database after applying the provided diff. + // If the client state doesn't match the expected state, the client must + // discard this diff and retry later. + Checksum checksum = 8; + + // The soonest the client should wait before issuing any diff + // request. Querying sooner is unlikely to produce a meaningful diff. + // Waiting longer is acceptable considering the use case. + // If this field is not set clients may update as soon as they want. + google.protobuf.Timestamp recommended_next_diff = 2; +} + +// Request to check URI entries against threatLists. +message SearchUrisRequest { + // Required. The URI to be checked for matches. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ThreatLists to search in. Multiple ThreatLists may be specified. + repeated ThreatType threat_types = 2 [(google.api.field_behavior) = REQUIRED]; +} + +message SearchUrisResponse { + // Contains threat information on a matching uri. + message ThreatUri { + // The ThreatList this threat belongs to. + repeated ThreatType threat_types = 1; + + // The cache lifetime for the returned match. Clients must not cache this + // response past this timestamp to avoid false positives. + google.protobuf.Timestamp expire_time = 2; + } + + // The threat list matches. This may be empty if the URI is on no list. + ThreatUri threat = 1; +} + +// Request to return full hashes matched by the provided hash prefixes. +message SearchHashesRequest { + // A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + // hash. For JSON requests, this field is base64-encoded. + bytes hash_prefix = 1; + + // Required. The ThreatLists to search in. Multiple ThreatLists may be specified. + repeated ThreatType threat_types = 2 [(google.api.field_behavior) = REQUIRED]; +} + +message SearchHashesResponse { + // Contains threat information on a matching hash. + message ThreatHash { + // The ThreatList this threat belongs to. + // This must contain at least one entry. + repeated ThreatType threat_types = 1; + + // A 32 byte SHA256 hash. This field is in binary format. For JSON + // requests, hashes are base64-encoded. + bytes hash = 2; + + // The cache lifetime for the returned match. Clients must not cache this + // response past this timestamp to avoid false positives. + google.protobuf.Timestamp expire_time = 3; + } + + // The full hashes that matched the requested prefixes. + // The hash will be populated in the key. + repeated ThreatHash threats = 1; + + // For requested entities that did not match the threat list, how long to + // cache the response until. + google.protobuf.Timestamp negative_expire_time = 2; +} + +// Contains the set of entries to add to a local database. +// May contain a combination of compressed and raw data in a single response. +message ThreatEntryAdditions { + // The raw SHA256-formatted entries. + // Repeated to allow returning sets of hashes with different prefix sizes. + repeated RawHashes raw_hashes = 1; + + // The encoded 4-byte prefixes of SHA256-formatted entries, using a + // Golomb-Rice encoding. The hashes are converted to uint32, sorted in + // ascending order, then delta encoded and stored as encoded_data. + RiceDeltaEncoding rice_hashes = 2; +} + +// Contains the set of entries to remove from a local database. +message ThreatEntryRemovals { + // The raw removal indices for a local list. + RawIndices raw_indices = 1; + + // The encoded local, lexicographically-sorted list indices, using a + // Golomb-Rice encoding. Used for sending compressed removal indices. The + // removal indices (uint32) are sorted in ascending order, then delta encoded + // and stored as encoded_data. + RiceDeltaEncoding rice_indices = 2; +} + +// The type of threat. This maps dirrectly to the threat list a threat may +// belong to. +enum ThreatType { + // Unknown. + THREAT_TYPE_UNSPECIFIED = 0; + + // Malware targeting any platform. + MALWARE = 1; + + // Social engineering targeting any platform. + SOCIAL_ENGINEERING = 2; + + // Unwanted software targeting any platform. + UNWANTED_SOFTWARE = 3; +} + +// The ways in which threat entry sets can be compressed. +enum CompressionType { + // Unknown. + COMPRESSION_TYPE_UNSPECIFIED = 0; + + // Raw, uncompressed data. + RAW = 1; + + // Rice-Golomb encoded data. + RICE = 2; +} + +// A set of raw indices to remove from a local list. +message RawIndices { + // The indices to remove from a lexicographically-sorted local list. + repeated int32 indices = 1; +} + +// The uncompressed threat entries in hash format. +// Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 +// bytes, but some hashes are lengthened if they collide with the hash of a +// popular URI. +// +// Used for sending ThreatEntryAdditons to clients that do not support +// compression, or when sending non-4-byte hashes to clients that do support +// compression. +message RawHashes { + // The number of bytes for each prefix encoded below. This field can be + // anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). + // In practice this is almost always 4, except in exceptional circumstances. + int32 prefix_size = 1; + + // The hashes, in binary format, concatenated into one long string. Hashes are + // sorted in lexicographic order. For JSON API users, hashes are + // base64-encoded. + bytes raw_hashes = 2; +} + +// The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or +// compressed removal indices. +message RiceDeltaEncoding { + // The offset of the first entry in the encoded data, or, if only a single + // integer was encoded, that single integer's value. If the field is empty or + // missing, assume zero. + int64 first_value = 1; + + // The Golomb-Rice parameter, which is a number between 2 and 28. This field + // is missing (that is, zero) if `num_entries` is zero. + int32 rice_parameter = 2; + + // The number of entries that are delta encoded in the encoded data. If only a + // single integer was encoded, this will be zero and the single value will be + // stored in `first_value`. + int32 entry_count = 3; + + // The encoded deltas that are encoded using the Golomb-Rice coder. + bytes encoded_data = 4; +} + +// Wraps a URI that might be displaying phishing content. +message Submission { + // Required. The URI that is being reported for phishing content to be analyzed. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to send a potentially phishy URI to WebRisk. +message CreateSubmissionRequest { + // Required. The name of the project that is making the submission. This string is in + // the format "projects/{project_number}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The submission that contains the content of the phishing report. + Submission submission = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-webrisk/protos/protos.d.ts b/packages/google-cloud-webrisk/protos/protos.d.ts index de9634298a9..30bfdbd3c95 100644 --- a/packages/google-cloud-webrisk/protos/protos.d.ts +++ b/packages/google-cloud-webrisk/protos/protos.d.ts @@ -23,6 +23,1814 @@ export namespace google { /** Namespace webrisk. */ namespace webrisk { + /** Namespace v1. */ + namespace v1 { + + /** Represents a WebRiskService */ + class WebRiskService extends $protobuf.rpc.Service { + + /** + * Constructs a new WebRiskService 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 WebRiskService 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): WebRiskService; + + /** + * Calls ComputeThreatListDiff. + * @param request ComputeThreatListDiffRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ComputeThreatListDiffResponse + */ + public computeThreatListDiff(request: google.cloud.webrisk.v1.IComputeThreatListDiffRequest, callback: google.cloud.webrisk.v1.WebRiskService.ComputeThreatListDiffCallback): void; + + /** + * Calls ComputeThreatListDiff. + * @param request ComputeThreatListDiffRequest message or plain object + * @returns Promise + */ + public computeThreatListDiff(request: google.cloud.webrisk.v1.IComputeThreatListDiffRequest): Promise; + + /** + * Calls SearchUris. + * @param request SearchUrisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchUrisResponse + */ + public searchUris(request: google.cloud.webrisk.v1.ISearchUrisRequest, callback: google.cloud.webrisk.v1.WebRiskService.SearchUrisCallback): void; + + /** + * Calls SearchUris. + * @param request SearchUrisRequest message or plain object + * @returns Promise + */ + public searchUris(request: google.cloud.webrisk.v1.ISearchUrisRequest): Promise; + + /** + * Calls SearchHashes. + * @param request SearchHashesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchHashesResponse + */ + public searchHashes(request: google.cloud.webrisk.v1.ISearchHashesRequest, callback: google.cloud.webrisk.v1.WebRiskService.SearchHashesCallback): void; + + /** + * Calls SearchHashes. + * @param request SearchHashesRequest message or plain object + * @returns Promise + */ + public searchHashes(request: google.cloud.webrisk.v1.ISearchHashesRequest): Promise; + + /** + * Calls CreateSubmission. + * @param request CreateSubmissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Submission + */ + public createSubmission(request: google.cloud.webrisk.v1.ICreateSubmissionRequest, callback: google.cloud.webrisk.v1.WebRiskService.CreateSubmissionCallback): void; + + /** + * Calls CreateSubmission. + * @param request CreateSubmissionRequest message or plain object + * @returns Promise + */ + public createSubmission(request: google.cloud.webrisk.v1.ICreateSubmissionRequest): Promise; + } + + namespace WebRiskService { + + /** + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#computeThreatListDiff}. + * @param error Error, if any + * @param [response] ComputeThreatListDiffResponse + */ + type ComputeThreatListDiffCallback = (error: (Error|null), response?: google.cloud.webrisk.v1.ComputeThreatListDiffResponse) => void; + + /** + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#searchUris}. + * @param error Error, if any + * @param [response] SearchUrisResponse + */ + type SearchUrisCallback = (error: (Error|null), response?: google.cloud.webrisk.v1.SearchUrisResponse) => void; + + /** + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#searchHashes}. + * @param error Error, if any + * @param [response] SearchHashesResponse + */ + type SearchHashesCallback = (error: (Error|null), response?: google.cloud.webrisk.v1.SearchHashesResponse) => void; + + /** + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#createSubmission}. + * @param error Error, if any + * @param [response] Submission + */ + type CreateSubmissionCallback = (error: (Error|null), response?: google.cloud.webrisk.v1.Submission) => void; + } + + /** Properties of a ComputeThreatListDiffRequest. */ + interface IComputeThreatListDiffRequest { + + /** ComputeThreatListDiffRequest threatType */ + threatType?: (google.cloud.webrisk.v1.ThreatType|keyof typeof google.cloud.webrisk.v1.ThreatType|null); + + /** ComputeThreatListDiffRequest versionToken */ + versionToken?: (Uint8Array|string|null); + + /** ComputeThreatListDiffRequest constraints */ + constraints?: (google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints|null); + } + + /** Represents a ComputeThreatListDiffRequest. */ + class ComputeThreatListDiffRequest implements IComputeThreatListDiffRequest { + + /** + * Constructs a new ComputeThreatListDiffRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IComputeThreatListDiffRequest); + + /** ComputeThreatListDiffRequest threatType. */ + public threatType: (google.cloud.webrisk.v1.ThreatType|keyof typeof google.cloud.webrisk.v1.ThreatType); + + /** ComputeThreatListDiffRequest versionToken. */ + public versionToken: (Uint8Array|string); + + /** ComputeThreatListDiffRequest constraints. */ + public constraints?: (google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints|null); + + /** + * Creates a new ComputeThreatListDiffRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeThreatListDiffRequest instance + */ + public static create(properties?: google.cloud.webrisk.v1.IComputeThreatListDiffRequest): google.cloud.webrisk.v1.ComputeThreatListDiffRequest; + + /** + * Encodes the specified ComputeThreatListDiffRequest message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.verify|verify} messages. + * @param message ComputeThreatListDiffRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IComputeThreatListDiffRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeThreatListDiffRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.verify|verify} messages. + * @param message ComputeThreatListDiffRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IComputeThreatListDiffRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeThreatListDiffRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeThreatListDiffRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.ComputeThreatListDiffRequest; + + /** + * Decodes a ComputeThreatListDiffRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeThreatListDiffRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.ComputeThreatListDiffRequest; + + /** + * Verifies a ComputeThreatListDiffRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeThreatListDiffRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeThreatListDiffRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.ComputeThreatListDiffRequest; + + /** + * Creates a plain object from a ComputeThreatListDiffRequest message. Also converts values to other types if specified. + * @param message ComputeThreatListDiffRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.ComputeThreatListDiffRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeThreatListDiffRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ComputeThreatListDiffRequest { + + /** Properties of a Constraints. */ + interface IConstraints { + + /** Constraints maxDiffEntries */ + maxDiffEntries?: (number|null); + + /** Constraints maxDatabaseEntries */ + maxDatabaseEntries?: (number|null); + + /** Constraints supportedCompressions */ + supportedCompressions?: (google.cloud.webrisk.v1.CompressionType[]|null); + } + + /** Represents a Constraints. */ + class Constraints implements IConstraints { + + /** + * Constructs a new Constraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints); + + /** Constraints maxDiffEntries. */ + public maxDiffEntries: number; + + /** Constraints maxDatabaseEntries. */ + public maxDatabaseEntries: number; + + /** Constraints supportedCompressions. */ + public supportedCompressions: google.cloud.webrisk.v1.CompressionType[]; + + /** + * Creates a new Constraints instance using the specified properties. + * @param [properties] Properties to set + * @returns Constraints instance + */ + public static create(properties?: google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints): google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints; + + /** + * Encodes the specified Constraints message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. + * @param message Constraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Constraints message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. + * @param message Constraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Constraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints; + + /** + * Decodes a Constraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints; + + /** + * Verifies a Constraints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Constraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Constraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints; + + /** + * Creates a plain object from a Constraints message. Also converts values to other types if specified. + * @param message Constraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Constraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ComputeThreatListDiffResponse. */ + interface IComputeThreatListDiffResponse { + + /** ComputeThreatListDiffResponse responseType */ + responseType?: (google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType|keyof typeof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType|null); + + /** ComputeThreatListDiffResponse additions */ + additions?: (google.cloud.webrisk.v1.IThreatEntryAdditions|null); + + /** ComputeThreatListDiffResponse removals */ + removals?: (google.cloud.webrisk.v1.IThreatEntryRemovals|null); + + /** ComputeThreatListDiffResponse newVersionToken */ + newVersionToken?: (Uint8Array|string|null); + + /** ComputeThreatListDiffResponse checksum */ + checksum?: (google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum|null); + + /** ComputeThreatListDiffResponse recommendedNextDiff */ + recommendedNextDiff?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ComputeThreatListDiffResponse. */ + class ComputeThreatListDiffResponse implements IComputeThreatListDiffResponse { + + /** + * Constructs a new ComputeThreatListDiffResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IComputeThreatListDiffResponse); + + /** ComputeThreatListDiffResponse responseType. */ + public responseType: (google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType|keyof typeof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType); + + /** ComputeThreatListDiffResponse additions. */ + public additions?: (google.cloud.webrisk.v1.IThreatEntryAdditions|null); + + /** ComputeThreatListDiffResponse removals. */ + public removals?: (google.cloud.webrisk.v1.IThreatEntryRemovals|null); + + /** ComputeThreatListDiffResponse newVersionToken. */ + public newVersionToken: (Uint8Array|string); + + /** ComputeThreatListDiffResponse checksum. */ + public checksum?: (google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum|null); + + /** ComputeThreatListDiffResponse recommendedNextDiff. */ + public recommendedNextDiff?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ComputeThreatListDiffResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeThreatListDiffResponse instance + */ + public static create(properties?: google.cloud.webrisk.v1.IComputeThreatListDiffResponse): google.cloud.webrisk.v1.ComputeThreatListDiffResponse; + + /** + * Encodes the specified ComputeThreatListDiffResponse message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.verify|verify} messages. + * @param message ComputeThreatListDiffResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IComputeThreatListDiffResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeThreatListDiffResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.verify|verify} messages. + * @param message ComputeThreatListDiffResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IComputeThreatListDiffResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeThreatListDiffResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeThreatListDiffResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.ComputeThreatListDiffResponse; + + /** + * Decodes a ComputeThreatListDiffResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeThreatListDiffResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.ComputeThreatListDiffResponse; + + /** + * Verifies a ComputeThreatListDiffResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeThreatListDiffResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeThreatListDiffResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.ComputeThreatListDiffResponse; + + /** + * Creates a plain object from a ComputeThreatListDiffResponse message. Also converts values to other types if specified. + * @param message ComputeThreatListDiffResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.ComputeThreatListDiffResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeThreatListDiffResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ComputeThreatListDiffResponse { + + /** Properties of a Checksum. */ + interface IChecksum { + + /** Checksum sha256 */ + sha256?: (Uint8Array|string|null); + } + + /** Represents a Checksum. */ + class Checksum implements IChecksum { + + /** + * Constructs a new Checksum. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum); + + /** Checksum sha256. */ + public sha256: (Uint8Array|string); + + /** + * Creates a new Checksum instance using the specified properties. + * @param [properties] Properties to set + * @returns Checksum instance + */ + public static create(properties?: google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum): google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum; + + /** + * Encodes the specified Checksum message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. + * @param message Checksum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Checksum message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. + * @param message Checksum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Checksum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Checksum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum; + + /** + * Decodes a Checksum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Checksum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum; + + /** + * Verifies a Checksum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Checksum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Checksum + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum; + + /** + * Creates a plain object from a Checksum message. Also converts values to other types if specified. + * @param message Checksum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Checksum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ResponseType enum. */ + enum ResponseType { + RESPONSE_TYPE_UNSPECIFIED = 0, + DIFF = 1, + RESET = 2 + } + } + + /** Properties of a SearchUrisRequest. */ + interface ISearchUrisRequest { + + /** SearchUrisRequest uri */ + uri?: (string|null); + + /** SearchUrisRequest threatTypes */ + threatTypes?: (google.cloud.webrisk.v1.ThreatType[]|null); + } + + /** Represents a SearchUrisRequest. */ + class SearchUrisRequest implements ISearchUrisRequest { + + /** + * Constructs a new SearchUrisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ISearchUrisRequest); + + /** SearchUrisRequest uri. */ + public uri: string; + + /** SearchUrisRequest threatTypes. */ + public threatTypes: google.cloud.webrisk.v1.ThreatType[]; + + /** + * Creates a new SearchUrisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchUrisRequest instance + */ + public static create(properties?: google.cloud.webrisk.v1.ISearchUrisRequest): google.cloud.webrisk.v1.SearchUrisRequest; + + /** + * Encodes the specified SearchUrisRequest message. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisRequest.verify|verify} messages. + * @param message SearchUrisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ISearchUrisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchUrisRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisRequest.verify|verify} messages. + * @param message SearchUrisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ISearchUrisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchUrisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchUrisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.SearchUrisRequest; + + /** + * Decodes a SearchUrisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchUrisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.SearchUrisRequest; + + /** + * Verifies a SearchUrisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchUrisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchUrisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.SearchUrisRequest; + + /** + * Creates a plain object from a SearchUrisRequest message. Also converts values to other types if specified. + * @param message SearchUrisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.SearchUrisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchUrisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchUrisResponse. */ + interface ISearchUrisResponse { + + /** SearchUrisResponse threat */ + threat?: (google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri|null); + } + + /** Represents a SearchUrisResponse. */ + class SearchUrisResponse implements ISearchUrisResponse { + + /** + * Constructs a new SearchUrisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ISearchUrisResponse); + + /** SearchUrisResponse threat. */ + public threat?: (google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri|null); + + /** + * Creates a new SearchUrisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchUrisResponse instance + */ + public static create(properties?: google.cloud.webrisk.v1.ISearchUrisResponse): google.cloud.webrisk.v1.SearchUrisResponse; + + /** + * Encodes the specified SearchUrisResponse message. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.verify|verify} messages. + * @param message SearchUrisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ISearchUrisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchUrisResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.verify|verify} messages. + * @param message SearchUrisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ISearchUrisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchUrisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchUrisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.SearchUrisResponse; + + /** + * Decodes a SearchUrisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchUrisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.SearchUrisResponse; + + /** + * Verifies a SearchUrisResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchUrisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchUrisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.SearchUrisResponse; + + /** + * Creates a plain object from a SearchUrisResponse message. Also converts values to other types if specified. + * @param message SearchUrisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.SearchUrisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchUrisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SearchUrisResponse { + + /** Properties of a ThreatUri. */ + interface IThreatUri { + + /** ThreatUri threatTypes */ + threatTypes?: (google.cloud.webrisk.v1.ThreatType[]|null); + + /** ThreatUri expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ThreatUri. */ + class ThreatUri implements IThreatUri { + + /** + * Constructs a new ThreatUri. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri); + + /** ThreatUri threatTypes. */ + public threatTypes: google.cloud.webrisk.v1.ThreatType[]; + + /** ThreatUri expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ThreatUri instance using the specified properties. + * @param [properties] Properties to set + * @returns ThreatUri instance + */ + public static create(properties?: google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri): google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri; + + /** + * Encodes the specified ThreatUri message. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.verify|verify} messages. + * @param message ThreatUri message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThreatUri message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.verify|verify} messages. + * @param message ThreatUri message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThreatUri message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThreatUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri; + + /** + * Decodes a ThreatUri message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThreatUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri; + + /** + * Verifies a ThreatUri message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThreatUri message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThreatUri + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri; + + /** + * Creates a plain object from a ThreatUri message. Also converts values to other types if specified. + * @param message ThreatUri + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThreatUri to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SearchHashesRequest. */ + interface ISearchHashesRequest { + + /** SearchHashesRequest hashPrefix */ + hashPrefix?: (Uint8Array|string|null); + + /** SearchHashesRequest threatTypes */ + threatTypes?: (google.cloud.webrisk.v1.ThreatType[]|null); + } + + /** Represents a SearchHashesRequest. */ + class SearchHashesRequest implements ISearchHashesRequest { + + /** + * Constructs a new SearchHashesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ISearchHashesRequest); + + /** SearchHashesRequest hashPrefix. */ + public hashPrefix: (Uint8Array|string); + + /** SearchHashesRequest threatTypes. */ + public threatTypes: google.cloud.webrisk.v1.ThreatType[]; + + /** + * Creates a new SearchHashesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchHashesRequest instance + */ + public static create(properties?: google.cloud.webrisk.v1.ISearchHashesRequest): google.cloud.webrisk.v1.SearchHashesRequest; + + /** + * Encodes the specified SearchHashesRequest message. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesRequest.verify|verify} messages. + * @param message SearchHashesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ISearchHashesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchHashesRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesRequest.verify|verify} messages. + * @param message SearchHashesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ISearchHashesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchHashesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.SearchHashesRequest; + + /** + * Decodes a SearchHashesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.SearchHashesRequest; + + /** + * Verifies a SearchHashesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchHashesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchHashesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.SearchHashesRequest; + + /** + * Creates a plain object from a SearchHashesRequest message. Also converts values to other types if specified. + * @param message SearchHashesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.SearchHashesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchHashesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchHashesResponse. */ + interface ISearchHashesResponse { + + /** SearchHashesResponse threats */ + threats?: (google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash[]|null); + + /** SearchHashesResponse negativeExpireTime */ + negativeExpireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SearchHashesResponse. */ + class SearchHashesResponse implements ISearchHashesResponse { + + /** + * Constructs a new SearchHashesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ISearchHashesResponse); + + /** SearchHashesResponse threats. */ + public threats: google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash[]; + + /** SearchHashesResponse negativeExpireTime. */ + public negativeExpireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SearchHashesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchHashesResponse instance + */ + public static create(properties?: google.cloud.webrisk.v1.ISearchHashesResponse): google.cloud.webrisk.v1.SearchHashesResponse; + + /** + * Encodes the specified SearchHashesResponse message. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.verify|verify} messages. + * @param message SearchHashesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ISearchHashesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchHashesResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.verify|verify} messages. + * @param message SearchHashesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ISearchHashesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchHashesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.SearchHashesResponse; + + /** + * Decodes a SearchHashesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.SearchHashesResponse; + + /** + * Verifies a SearchHashesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchHashesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchHashesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.SearchHashesResponse; + + /** + * Creates a plain object from a SearchHashesResponse message. Also converts values to other types if specified. + * @param message SearchHashesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.SearchHashesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchHashesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SearchHashesResponse { + + /** Properties of a ThreatHash. */ + interface IThreatHash { + + /** ThreatHash threatTypes */ + threatTypes?: (google.cloud.webrisk.v1.ThreatType[]|null); + + /** ThreatHash hash */ + hash?: (Uint8Array|string|null); + + /** ThreatHash expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ThreatHash. */ + class ThreatHash implements IThreatHash { + + /** + * Constructs a new ThreatHash. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash); + + /** ThreatHash threatTypes. */ + public threatTypes: google.cloud.webrisk.v1.ThreatType[]; + + /** ThreatHash hash. */ + public hash: (Uint8Array|string); + + /** ThreatHash expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ThreatHash instance using the specified properties. + * @param [properties] Properties to set + * @returns ThreatHash instance + */ + public static create(properties?: google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash): google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash; + + /** + * Encodes the specified ThreatHash message. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.verify|verify} messages. + * @param message ThreatHash message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThreatHash message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.verify|verify} messages. + * @param message ThreatHash message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThreatHash message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThreatHash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash; + + /** + * Decodes a ThreatHash message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThreatHash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash; + + /** + * Verifies a ThreatHash message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThreatHash message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThreatHash + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash; + + /** + * Creates a plain object from a ThreatHash message. Also converts values to other types if specified. + * @param message ThreatHash + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThreatHash to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ThreatEntryAdditions. */ + interface IThreatEntryAdditions { + + /** ThreatEntryAdditions rawHashes */ + rawHashes?: (google.cloud.webrisk.v1.IRawHashes[]|null); + + /** ThreatEntryAdditions riceHashes */ + riceHashes?: (google.cloud.webrisk.v1.IRiceDeltaEncoding|null); + } + + /** Represents a ThreatEntryAdditions. */ + class ThreatEntryAdditions implements IThreatEntryAdditions { + + /** + * Constructs a new ThreatEntryAdditions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IThreatEntryAdditions); + + /** ThreatEntryAdditions rawHashes. */ + public rawHashes: google.cloud.webrisk.v1.IRawHashes[]; + + /** ThreatEntryAdditions riceHashes. */ + public riceHashes?: (google.cloud.webrisk.v1.IRiceDeltaEncoding|null); + + /** + * Creates a new ThreatEntryAdditions instance using the specified properties. + * @param [properties] Properties to set + * @returns ThreatEntryAdditions instance + */ + public static create(properties?: google.cloud.webrisk.v1.IThreatEntryAdditions): google.cloud.webrisk.v1.ThreatEntryAdditions; + + /** + * Encodes the specified ThreatEntryAdditions message. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryAdditions.verify|verify} messages. + * @param message ThreatEntryAdditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IThreatEntryAdditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThreatEntryAdditions message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryAdditions.verify|verify} messages. + * @param message ThreatEntryAdditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IThreatEntryAdditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThreatEntryAdditions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThreatEntryAdditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.ThreatEntryAdditions; + + /** + * Decodes a ThreatEntryAdditions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThreatEntryAdditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.ThreatEntryAdditions; + + /** + * Verifies a ThreatEntryAdditions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThreatEntryAdditions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThreatEntryAdditions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.ThreatEntryAdditions; + + /** + * Creates a plain object from a ThreatEntryAdditions message. Also converts values to other types if specified. + * @param message ThreatEntryAdditions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.ThreatEntryAdditions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThreatEntryAdditions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ThreatEntryRemovals. */ + interface IThreatEntryRemovals { + + /** ThreatEntryRemovals rawIndices */ + rawIndices?: (google.cloud.webrisk.v1.IRawIndices|null); + + /** ThreatEntryRemovals riceIndices */ + riceIndices?: (google.cloud.webrisk.v1.IRiceDeltaEncoding|null); + } + + /** Represents a ThreatEntryRemovals. */ + class ThreatEntryRemovals implements IThreatEntryRemovals { + + /** + * Constructs a new ThreatEntryRemovals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IThreatEntryRemovals); + + /** ThreatEntryRemovals rawIndices. */ + public rawIndices?: (google.cloud.webrisk.v1.IRawIndices|null); + + /** ThreatEntryRemovals riceIndices. */ + public riceIndices?: (google.cloud.webrisk.v1.IRiceDeltaEncoding|null); + + /** + * Creates a new ThreatEntryRemovals instance using the specified properties. + * @param [properties] Properties to set + * @returns ThreatEntryRemovals instance + */ + public static create(properties?: google.cloud.webrisk.v1.IThreatEntryRemovals): google.cloud.webrisk.v1.ThreatEntryRemovals; + + /** + * Encodes the specified ThreatEntryRemovals message. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryRemovals.verify|verify} messages. + * @param message ThreatEntryRemovals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IThreatEntryRemovals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThreatEntryRemovals message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryRemovals.verify|verify} messages. + * @param message ThreatEntryRemovals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IThreatEntryRemovals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThreatEntryRemovals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThreatEntryRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.ThreatEntryRemovals; + + /** + * Decodes a ThreatEntryRemovals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThreatEntryRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.ThreatEntryRemovals; + + /** + * Verifies a ThreatEntryRemovals message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThreatEntryRemovals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThreatEntryRemovals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.ThreatEntryRemovals; + + /** + * Creates a plain object from a ThreatEntryRemovals message. Also converts values to other types if specified. + * @param message ThreatEntryRemovals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.ThreatEntryRemovals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThreatEntryRemovals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ThreatType enum. */ + enum ThreatType { + THREAT_TYPE_UNSPECIFIED = 0, + MALWARE = 1, + SOCIAL_ENGINEERING = 2, + UNWANTED_SOFTWARE = 3 + } + + /** CompressionType enum. */ + enum CompressionType { + COMPRESSION_TYPE_UNSPECIFIED = 0, + RAW = 1, + RICE = 2 + } + + /** Properties of a RawIndices. */ + interface IRawIndices { + + /** RawIndices indices */ + indices?: (number[]|null); + } + + /** Represents a RawIndices. */ + class RawIndices implements IRawIndices { + + /** + * Constructs a new RawIndices. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IRawIndices); + + /** RawIndices indices. */ + public indices: number[]; + + /** + * Creates a new RawIndices instance using the specified properties. + * @param [properties] Properties to set + * @returns RawIndices instance + */ + public static create(properties?: google.cloud.webrisk.v1.IRawIndices): google.cloud.webrisk.v1.RawIndices; + + /** + * Encodes the specified RawIndices message. Does not implicitly {@link google.cloud.webrisk.v1.RawIndices.verify|verify} messages. + * @param message RawIndices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IRawIndices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawIndices message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.RawIndices.verify|verify} messages. + * @param message RawIndices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IRawIndices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawIndices message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawIndices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.RawIndices; + + /** + * Decodes a RawIndices message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawIndices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.RawIndices; + + /** + * Verifies a RawIndices message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawIndices message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawIndices + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.RawIndices; + + /** + * Creates a plain object from a RawIndices message. Also converts values to other types if specified. + * @param message RawIndices + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.RawIndices, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawIndices to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RawHashes. */ + interface IRawHashes { + + /** RawHashes prefixSize */ + prefixSize?: (number|null); + + /** RawHashes rawHashes */ + rawHashes?: (Uint8Array|string|null); + } + + /** Represents a RawHashes. */ + class RawHashes implements IRawHashes { + + /** + * Constructs a new RawHashes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IRawHashes); + + /** RawHashes prefixSize. */ + public prefixSize: number; + + /** RawHashes rawHashes. */ + public rawHashes: (Uint8Array|string); + + /** + * Creates a new RawHashes instance using the specified properties. + * @param [properties] Properties to set + * @returns RawHashes instance + */ + public static create(properties?: google.cloud.webrisk.v1.IRawHashes): google.cloud.webrisk.v1.RawHashes; + + /** + * Encodes the specified RawHashes message. Does not implicitly {@link google.cloud.webrisk.v1.RawHashes.verify|verify} messages. + * @param message RawHashes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IRawHashes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawHashes message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.RawHashes.verify|verify} messages. + * @param message RawHashes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IRawHashes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawHashes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.RawHashes; + + /** + * Decodes a RawHashes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.RawHashes; + + /** + * Verifies a RawHashes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawHashes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawHashes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.RawHashes; + + /** + * Creates a plain object from a RawHashes message. Also converts values to other types if specified. + * @param message RawHashes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.RawHashes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawHashes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RiceDeltaEncoding. */ + interface IRiceDeltaEncoding { + + /** RiceDeltaEncoding firstValue */ + firstValue?: (number|Long|string|null); + + /** RiceDeltaEncoding riceParameter */ + riceParameter?: (number|null); + + /** RiceDeltaEncoding entryCount */ + entryCount?: (number|null); + + /** RiceDeltaEncoding encodedData */ + encodedData?: (Uint8Array|string|null); + } + + /** Represents a RiceDeltaEncoding. */ + class RiceDeltaEncoding implements IRiceDeltaEncoding { + + /** + * Constructs a new RiceDeltaEncoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.IRiceDeltaEncoding); + + /** RiceDeltaEncoding firstValue. */ + public firstValue: (number|Long|string); + + /** RiceDeltaEncoding riceParameter. */ + public riceParameter: number; + + /** RiceDeltaEncoding entryCount. */ + public entryCount: number; + + /** RiceDeltaEncoding encodedData. */ + public encodedData: (Uint8Array|string); + + /** + * Creates a new RiceDeltaEncoding instance using the specified properties. + * @param [properties] Properties to set + * @returns RiceDeltaEncoding instance + */ + public static create(properties?: google.cloud.webrisk.v1.IRiceDeltaEncoding): google.cloud.webrisk.v1.RiceDeltaEncoding; + + /** + * Encodes the specified RiceDeltaEncoding message. Does not implicitly {@link google.cloud.webrisk.v1.RiceDeltaEncoding.verify|verify} messages. + * @param message RiceDeltaEncoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.IRiceDeltaEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RiceDeltaEncoding message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.RiceDeltaEncoding.verify|verify} messages. + * @param message RiceDeltaEncoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.IRiceDeltaEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RiceDeltaEncoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RiceDeltaEncoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.RiceDeltaEncoding; + + /** + * Decodes a RiceDeltaEncoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RiceDeltaEncoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.RiceDeltaEncoding; + + /** + * Verifies a RiceDeltaEncoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RiceDeltaEncoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RiceDeltaEncoding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.RiceDeltaEncoding; + + /** + * Creates a plain object from a RiceDeltaEncoding message. Also converts values to other types if specified. + * @param message RiceDeltaEncoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.RiceDeltaEncoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RiceDeltaEncoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Submission. */ + interface ISubmission { + + /** Submission uri */ + uri?: (string|null); + } + + /** Represents a Submission. */ + class Submission implements ISubmission { + + /** + * Constructs a new Submission. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ISubmission); + + /** Submission uri. */ + public uri: string; + + /** + * Creates a new Submission instance using the specified properties. + * @param [properties] Properties to set + * @returns Submission instance + */ + public static create(properties?: google.cloud.webrisk.v1.ISubmission): google.cloud.webrisk.v1.Submission; + + /** + * Encodes the specified Submission message. Does not implicitly {@link google.cloud.webrisk.v1.Submission.verify|verify} messages. + * @param message Submission message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ISubmission, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Submission message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.Submission.verify|verify} messages. + * @param message Submission message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ISubmission, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Submission message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Submission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.Submission; + + /** + * Decodes a Submission message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Submission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.Submission; + + /** + * Verifies a Submission message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Submission message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Submission + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.Submission; + + /** + * Creates a plain object from a Submission message. Also converts values to other types if specified. + * @param message Submission + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.Submission, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Submission to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSubmissionRequest. */ + interface ICreateSubmissionRequest { + + /** CreateSubmissionRequest parent */ + parent?: (string|null); + + /** CreateSubmissionRequest submission */ + submission?: (google.cloud.webrisk.v1.ISubmission|null); + } + + /** Represents a CreateSubmissionRequest. */ + class CreateSubmissionRequest implements ICreateSubmissionRequest { + + /** + * Constructs a new CreateSubmissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.webrisk.v1.ICreateSubmissionRequest); + + /** CreateSubmissionRequest parent. */ + public parent: string; + + /** CreateSubmissionRequest submission. */ + public submission?: (google.cloud.webrisk.v1.ISubmission|null); + + /** + * Creates a new CreateSubmissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSubmissionRequest instance + */ + public static create(properties?: google.cloud.webrisk.v1.ICreateSubmissionRequest): google.cloud.webrisk.v1.CreateSubmissionRequest; + + /** + * Encodes the specified CreateSubmissionRequest message. Does not implicitly {@link google.cloud.webrisk.v1.CreateSubmissionRequest.verify|verify} messages. + * @param message CreateSubmissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.webrisk.v1.ICreateSubmissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSubmissionRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.CreateSubmissionRequest.verify|verify} messages. + * @param message CreateSubmissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.webrisk.v1.ICreateSubmissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSubmissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSubmissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.webrisk.v1.CreateSubmissionRequest; + + /** + * Decodes a CreateSubmissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSubmissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.webrisk.v1.CreateSubmissionRequest; + + /** + * Verifies a CreateSubmissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSubmissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSubmissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.webrisk.v1.CreateSubmissionRequest; + + /** + * Creates a plain object from a CreateSubmissionRequest message. Also converts values to other types if specified. + * @param message CreateSubmissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.webrisk.v1.CreateSubmissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSubmissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Namespace v1beta1. */ namespace v1beta1 { @@ -1977,6 +3785,232 @@ export namespace google { 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|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|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|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * 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. */ @@ -3537,6 +5571,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ @@ -3709,6 +5746,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -3832,6 +5872,9 @@ export namespace google { /** 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. */ diff --git a/packages/google-cloud-webrisk/protos/protos.js b/packages/google-cloud-webrisk/protos/protos.js index 4a18badb0b3..127a5f67c41 100644 --- a/packages/google-cloud-webrisk/protos/protos.js +++ b/packages/google-cloud-webrisk/protos/protos.js @@ -57,167 +57,200 @@ */ var webrisk = {}; - webrisk.v1beta1 = (function() { + webrisk.v1 = (function() { /** - * Namespace v1beta1. + * Namespace v1. * @memberof google.cloud.webrisk * @namespace */ - var v1beta1 = {}; + var v1 = {}; - v1beta1.WebRiskServiceV1Beta1 = (function() { + v1.WebRiskService = (function() { /** - * Constructs a new WebRiskServiceV1Beta1 service. - * @memberof google.cloud.webrisk.v1beta1 - * @classdesc Represents a WebRiskServiceV1Beta1 + * Constructs a new WebRiskService service. + * @memberof google.cloud.webrisk.v1 + * @classdesc Represents a WebRiskService * @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 WebRiskServiceV1Beta1(rpcImpl, requestDelimited, responseDelimited) { + function WebRiskService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (WebRiskServiceV1Beta1.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WebRiskServiceV1Beta1; + (WebRiskService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WebRiskService; /** - * Creates new WebRiskServiceV1Beta1 service using the specified rpc implementation. + * Creates new WebRiskService service using the specified rpc implementation. * @function create - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @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 {WebRiskServiceV1Beta1} RPC service. Useful where requests and/or responses are streamed. + * @returns {WebRiskService} RPC service. Useful where requests and/or responses are streamed. */ - WebRiskServiceV1Beta1.create = function create(rpcImpl, requestDelimited, responseDelimited) { + WebRiskService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1#computeThreatListDiff}. - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#computeThreatListDiff}. + * @memberof google.cloud.webrisk.v1.WebRiskService * @typedef ComputeThreatListDiffCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} [response] ComputeThreatListDiffResponse + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse} [response] ComputeThreatListDiffResponse */ /** * Calls ComputeThreatListDiff. * @function computeThreatListDiff - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @instance - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} request ComputeThreatListDiffRequest message or plain object - * @param {google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.ComputeThreatListDiffCallback} callback Node-style callback called with the error, if any, and ComputeThreatListDiffResponse + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffRequest} request ComputeThreatListDiffRequest message or plain object + * @param {google.cloud.webrisk.v1.WebRiskService.ComputeThreatListDiffCallback} callback Node-style callback called with the error, if any, and ComputeThreatListDiffResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(WebRiskServiceV1Beta1.prototype.computeThreatListDiff = function computeThreatListDiff(request, callback) { - return this.rpcCall(computeThreatListDiff, $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest, $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse, request, callback); + Object.defineProperty(WebRiskService.prototype.computeThreatListDiff = function computeThreatListDiff(request, callback) { + return this.rpcCall(computeThreatListDiff, $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest, $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse, request, callback); }, "name", { value: "ComputeThreatListDiff" }); /** * Calls ComputeThreatListDiff. * @function computeThreatListDiff - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @instance - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} request ComputeThreatListDiffRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffRequest} request ComputeThreatListDiffRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1#searchUris}. - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#searchUris}. + * @memberof google.cloud.webrisk.v1.WebRiskService * @typedef SearchUrisCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse} [response] SearchUrisResponse + * @param {google.cloud.webrisk.v1.SearchUrisResponse} [response] SearchUrisResponse */ /** * Calls SearchUris. * @function searchUris - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @instance - * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} request SearchUrisRequest message or plain object - * @param {google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchUrisCallback} callback Node-style callback called with the error, if any, and SearchUrisResponse + * @param {google.cloud.webrisk.v1.ISearchUrisRequest} request SearchUrisRequest message or plain object + * @param {google.cloud.webrisk.v1.WebRiskService.SearchUrisCallback} callback Node-style callback called with the error, if any, and SearchUrisResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(WebRiskServiceV1Beta1.prototype.searchUris = function searchUris(request, callback) { - return this.rpcCall(searchUris, $root.google.cloud.webrisk.v1beta1.SearchUrisRequest, $root.google.cloud.webrisk.v1beta1.SearchUrisResponse, request, callback); + Object.defineProperty(WebRiskService.prototype.searchUris = function searchUris(request, callback) { + return this.rpcCall(searchUris, $root.google.cloud.webrisk.v1.SearchUrisRequest, $root.google.cloud.webrisk.v1.SearchUrisResponse, request, callback); }, "name", { value: "SearchUris" }); /** * Calls SearchUris. * @function searchUris - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @instance - * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} request SearchUrisRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.webrisk.v1.ISearchUrisRequest} request SearchUrisRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1#searchHashes}. - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#searchHashes}. + * @memberof google.cloud.webrisk.v1.WebRiskService * @typedef SearchHashesCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse} [response] SearchHashesResponse + * @param {google.cloud.webrisk.v1.SearchHashesResponse} [response] SearchHashesResponse */ /** * Calls SearchHashes. * @function searchHashes - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @instance - * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} request SearchHashesRequest message or plain object - * @param {google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchHashesCallback} callback Node-style callback called with the error, if any, and SearchHashesResponse + * @param {google.cloud.webrisk.v1.ISearchHashesRequest} request SearchHashesRequest message or plain object + * @param {google.cloud.webrisk.v1.WebRiskService.SearchHashesCallback} callback Node-style callback called with the error, if any, and SearchHashesResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(WebRiskServiceV1Beta1.prototype.searchHashes = function searchHashes(request, callback) { - return this.rpcCall(searchHashes, $root.google.cloud.webrisk.v1beta1.SearchHashesRequest, $root.google.cloud.webrisk.v1beta1.SearchHashesResponse, request, callback); + Object.defineProperty(WebRiskService.prototype.searchHashes = function searchHashes(request, callback) { + return this.rpcCall(searchHashes, $root.google.cloud.webrisk.v1.SearchHashesRequest, $root.google.cloud.webrisk.v1.SearchHashesResponse, request, callback); }, "name", { value: "SearchHashes" }); /** * Calls SearchHashes. * @function searchHashes - * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @memberof google.cloud.webrisk.v1.WebRiskService * @instance - * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} request SearchHashesRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.webrisk.v1.ISearchHashesRequest} request SearchHashesRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return WebRiskServiceV1Beta1; + /** + * Callback as used by {@link google.cloud.webrisk.v1.WebRiskService#createSubmission}. + * @memberof google.cloud.webrisk.v1.WebRiskService + * @typedef CreateSubmissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.webrisk.v1.Submission} [response] Submission + */ + + /** + * Calls CreateSubmission. + * @function createSubmission + * @memberof google.cloud.webrisk.v1.WebRiskService + * @instance + * @param {google.cloud.webrisk.v1.ICreateSubmissionRequest} request CreateSubmissionRequest message or plain object + * @param {google.cloud.webrisk.v1.WebRiskService.CreateSubmissionCallback} callback Node-style callback called with the error, if any, and Submission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebRiskService.prototype.createSubmission = function createSubmission(request, callback) { + return this.rpcCall(createSubmission, $root.google.cloud.webrisk.v1.CreateSubmissionRequest, $root.google.cloud.webrisk.v1.Submission, request, callback); + }, "name", { value: "CreateSubmission" }); + + /** + * Calls CreateSubmission. + * @function createSubmission + * @memberof google.cloud.webrisk.v1.WebRiskService + * @instance + * @param {google.cloud.webrisk.v1.ICreateSubmissionRequest} request CreateSubmissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WebRiskService; })(); - v1beta1.ComputeThreatListDiffRequest = (function() { + v1.ComputeThreatListDiffRequest = (function() { /** * Properties of a ComputeThreatListDiffRequest. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IComputeThreatListDiffRequest - * @property {google.cloud.webrisk.v1beta1.ThreatType|null} [threatType] ComputeThreatListDiffRequest threatType + * @property {google.cloud.webrisk.v1.ThreatType|null} [threatType] ComputeThreatListDiffRequest threatType * @property {Uint8Array|null} [versionToken] ComputeThreatListDiffRequest versionToken - * @property {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints|null} [constraints] ComputeThreatListDiffRequest constraints + * @property {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints|null} [constraints] ComputeThreatListDiffRequest constraints */ /** * Constructs a new ComputeThreatListDiffRequest. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a ComputeThreatListDiffRequest. * @implements IComputeThreatListDiffRequest * @constructor - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffRequest=} [properties] Properties to set */ function ComputeThreatListDiffRequest(properties) { if (properties) @@ -228,8 +261,8 @@ /** * ComputeThreatListDiffRequest threatType. - * @member {google.cloud.webrisk.v1beta1.ThreatType} threatType - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @member {google.cloud.webrisk.v1.ThreatType} threatType + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @instance */ ComputeThreatListDiffRequest.prototype.threatType = 0; @@ -237,15 +270,15 @@ /** * ComputeThreatListDiffRequest versionToken. * @member {Uint8Array} versionToken - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @instance */ ComputeThreatListDiffRequest.prototype.versionToken = $util.newBuffer([]); /** * ComputeThreatListDiffRequest constraints. - * @member {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints|null|undefined} constraints - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @member {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints|null|undefined} constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @instance */ ComputeThreatListDiffRequest.prototype.constraints = null; @@ -253,21 +286,21 @@ /** * Creates a new ComputeThreatListDiffRequest instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest instance + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest instance */ ComputeThreatListDiffRequest.create = function create(properties) { return new ComputeThreatListDiffRequest(properties); }; /** - * Encodes the specified ComputeThreatListDiffRequest message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.verify|verify} messages. + * Encodes the specified ComputeThreatListDiffRequest message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} message ComputeThreatListDiffRequest message or plain object to encode + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffRequest} message ComputeThreatListDiffRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -279,16 +312,16 @@ if (message.versionToken != null && message.hasOwnProperty("versionToken")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.versionToken); if (message.constraints != null && message.hasOwnProperty("constraints")) - $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.encode(message.constraints, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.encode(message.constraints, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ComputeThreatListDiffRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.verify|verify} messages. + * Encodes the specified ComputeThreatListDiffRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} message ComputeThreatListDiffRequest message or plain object to encode + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffRequest} message ComputeThreatListDiffRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -299,18 +332,18 @@ /** * Decodes a ComputeThreatListDiffRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ComputeThreatListDiffRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -321,7 +354,7 @@ message.versionToken = reader.bytes(); break; case 3: - message.constraints = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.decode(reader, reader.uint32()); + message.constraints = $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -334,10 +367,10 @@ /** * Decodes a ComputeThreatListDiffRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -350,7 +383,7 @@ /** * Verifies a ComputeThreatListDiffRequest message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -372,7 +405,7 @@ if (!(message.versionToken && typeof message.versionToken.length === "number" || $util.isString(message.versionToken))) return "versionToken: buffer expected"; if (message.constraints != null && message.hasOwnProperty("constraints")) { - var error = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.verify(message.constraints); + var error = $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.verify(message.constraints); if (error) return "constraints." + error; } @@ -382,15 +415,15 @@ /** * Creates a ComputeThreatListDiffRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest */ ComputeThreatListDiffRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest) + if (object instanceof $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest) return object; - var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest(); + var message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest(); switch (object.threatType) { case "THREAT_TYPE_UNSPECIFIED": case 0: @@ -416,8 +449,8 @@ message.versionToken = object.versionToken; if (object.constraints != null) { if (typeof object.constraints !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.constraints: object expected"); - message.constraints = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.fromObject(object.constraints); + throw TypeError(".google.cloud.webrisk.v1.ComputeThreatListDiffRequest.constraints: object expected"); + message.constraints = $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.fromObject(object.constraints); } return message; }; @@ -425,9 +458,9 @@ /** * Creates a plain object from a ComputeThreatListDiffRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} message ComputeThreatListDiffRequest + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest} message ComputeThreatListDiffRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -447,18 +480,18 @@ object.constraints = null; } if (message.threatType != null && message.hasOwnProperty("threatType")) - object.threatType = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatType] : message.threatType; + object.threatType = options.enums === String ? $root.google.cloud.webrisk.v1.ThreatType[message.threatType] : message.threatType; if (message.versionToken != null && message.hasOwnProperty("versionToken")) object.versionToken = options.bytes === String ? $util.base64.encode(message.versionToken, 0, message.versionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.versionToken) : message.versionToken; if (message.constraints != null && message.hasOwnProperty("constraints")) - object.constraints = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.toObject(message.constraints, options); + object.constraints = $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.toObject(message.constraints, options); return object; }; /** * Converts this ComputeThreatListDiffRequest to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @instance * @returns {Object.} JSON object */ @@ -470,20 +503,20 @@ /** * Properties of a Constraints. - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @interface IConstraints * @property {number|null} [maxDiffEntries] Constraints maxDiffEntries * @property {number|null} [maxDatabaseEntries] Constraints maxDatabaseEntries - * @property {Array.|null} [supportedCompressions] Constraints supportedCompressions + * @property {Array.|null} [supportedCompressions] Constraints supportedCompressions */ /** * Constructs a new Constraints. - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest * @classdesc Represents a Constraints. * @implements IConstraints * @constructor - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints=} [properties] Properties to set */ function Constraints(properties) { this.supportedCompressions = []; @@ -496,7 +529,7 @@ /** * Constraints maxDiffEntries. * @member {number} maxDiffEntries - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @instance */ Constraints.prototype.maxDiffEntries = 0; @@ -504,15 +537,15 @@ /** * Constraints maxDatabaseEntries. * @member {number} maxDatabaseEntries - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @instance */ Constraints.prototype.maxDatabaseEntries = 0; /** * Constraints supportedCompressions. - * @member {Array.} supportedCompressions - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @member {Array.} supportedCompressions + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @instance */ Constraints.prototype.supportedCompressions = $util.emptyArray; @@ -520,21 +553,21 @@ /** * Creates a new Constraints instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints instance + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints} Constraints instance */ Constraints.create = function create(properties) { return new Constraints(properties); }; /** - * Encodes the specified Constraints message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. + * Encodes the specified Constraints message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints} message Constraints message or plain object to encode + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints} message Constraints message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -555,11 +588,11 @@ }; /** - * Encodes the specified Constraints message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. + * Encodes the specified Constraints message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints} message Constraints message or plain object to encode + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.IConstraints} message Constraints message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -570,18 +603,18 @@ /** * Decodes a Constraints message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints} Constraints * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Constraints.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -612,10 +645,10 @@ /** * Decodes a Constraints message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints} Constraints * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -628,7 +661,7 @@ /** * Verifies a Constraints message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -661,22 +694,22 @@ /** * Creates a Constraints message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints} Constraints */ Constraints.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints) + if (object instanceof $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints) return object; - var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints(); + var message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints(); if (object.maxDiffEntries != null) message.maxDiffEntries = object.maxDiffEntries | 0; if (object.maxDatabaseEntries != null) message.maxDatabaseEntries = object.maxDatabaseEntries | 0; if (object.supportedCompressions) { if (!Array.isArray(object.supportedCompressions)) - throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.supportedCompressions: array expected"); + throw TypeError(".google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints.supportedCompressions: array expected"); message.supportedCompressions = []; for (var i = 0; i < object.supportedCompressions.length; ++i) switch (object.supportedCompressions[i]) { @@ -701,9 +734,9 @@ /** * Creates a plain object from a Constraints message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} message Constraints + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints} message Constraints * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -724,7 +757,7 @@ if (message.supportedCompressions && message.supportedCompressions.length) { object.supportedCompressions = []; for (var j = 0; j < message.supportedCompressions.length; ++j) - object.supportedCompressions[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.CompressionType[message.supportedCompressions[j]] : message.supportedCompressions[j]; + object.supportedCompressions[j] = options.enums === String ? $root.google.cloud.webrisk.v1.CompressionType[message.supportedCompressions[j]] : message.supportedCompressions[j]; } return object; }; @@ -732,7 +765,7 @@ /** * Converts this Constraints to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints * @instance * @returns {Object.} JSON object */ @@ -746,27 +779,27 @@ return ComputeThreatListDiffRequest; })(); - v1beta1.ComputeThreatListDiffResponse = (function() { + v1.ComputeThreatListDiffResponse = (function() { /** * Properties of a ComputeThreatListDiffResponse. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IComputeThreatListDiffResponse - * @property {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType|null} [responseType] ComputeThreatListDiffResponse responseType - * @property {google.cloud.webrisk.v1beta1.IThreatEntryAdditions|null} [additions] ComputeThreatListDiffResponse additions - * @property {google.cloud.webrisk.v1beta1.IThreatEntryRemovals|null} [removals] ComputeThreatListDiffResponse removals + * @property {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType|null} [responseType] ComputeThreatListDiffResponse responseType + * @property {google.cloud.webrisk.v1.IThreatEntryAdditions|null} [additions] ComputeThreatListDiffResponse additions + * @property {google.cloud.webrisk.v1.IThreatEntryRemovals|null} [removals] ComputeThreatListDiffResponse removals * @property {Uint8Array|null} [newVersionToken] ComputeThreatListDiffResponse newVersionToken - * @property {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum|null} [checksum] ComputeThreatListDiffResponse checksum + * @property {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum|null} [checksum] ComputeThreatListDiffResponse checksum * @property {google.protobuf.ITimestamp|null} [recommendedNextDiff] ComputeThreatListDiffResponse recommendedNextDiff */ /** * Constructs a new ComputeThreatListDiffResponse. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a ComputeThreatListDiffResponse. * @implements IComputeThreatListDiffResponse * @constructor - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffResponse=} [properties] Properties to set */ function ComputeThreatListDiffResponse(properties) { if (properties) @@ -777,24 +810,24 @@ /** * ComputeThreatListDiffResponse responseType. - * @member {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType} responseType - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @member {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType} responseType + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance */ ComputeThreatListDiffResponse.prototype.responseType = 0; /** * ComputeThreatListDiffResponse additions. - * @member {google.cloud.webrisk.v1beta1.IThreatEntryAdditions|null|undefined} additions - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @member {google.cloud.webrisk.v1.IThreatEntryAdditions|null|undefined} additions + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance */ ComputeThreatListDiffResponse.prototype.additions = null; /** * ComputeThreatListDiffResponse removals. - * @member {google.cloud.webrisk.v1beta1.IThreatEntryRemovals|null|undefined} removals - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @member {google.cloud.webrisk.v1.IThreatEntryRemovals|null|undefined} removals + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance */ ComputeThreatListDiffResponse.prototype.removals = null; @@ -802,15 +835,15 @@ /** * ComputeThreatListDiffResponse newVersionToken. * @member {Uint8Array} newVersionToken - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance */ ComputeThreatListDiffResponse.prototype.newVersionToken = $util.newBuffer([]); /** * ComputeThreatListDiffResponse checksum. - * @member {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum|null|undefined} checksum - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @member {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum|null|undefined} checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance */ ComputeThreatListDiffResponse.prototype.checksum = null; @@ -818,7 +851,7 @@ /** * ComputeThreatListDiffResponse recommendedNextDiff. * @member {google.protobuf.ITimestamp|null|undefined} recommendedNextDiff - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance */ ComputeThreatListDiffResponse.prototype.recommendedNextDiff = null; @@ -826,21 +859,21 @@ /** * Creates a new ComputeThreatListDiffResponse instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse instance + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffResponse=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse instance */ ComputeThreatListDiffResponse.create = function create(properties) { return new ComputeThreatListDiffResponse(properties); }; /** - * Encodes the specified ComputeThreatListDiffResponse message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.verify|verify} messages. + * Encodes the specified ComputeThreatListDiffResponse message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse} message ComputeThreatListDiffResponse message or plain object to encode + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffResponse} message ComputeThreatListDiffResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -852,22 +885,22 @@ if (message.responseType != null && message.hasOwnProperty("responseType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.responseType); if (message.additions != null && message.hasOwnProperty("additions")) - $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.encode(message.additions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.webrisk.v1.ThreatEntryAdditions.encode(message.additions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.removals != null && message.hasOwnProperty("removals")) - $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.encode(message.removals, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.webrisk.v1.ThreatEntryRemovals.encode(message.removals, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.newVersionToken != null && message.hasOwnProperty("newVersionToken")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.newVersionToken); if (message.checksum != null && message.hasOwnProperty("checksum")) - $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.encode(message.checksum, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.encode(message.checksum, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified ComputeThreatListDiffResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.verify|verify} messages. + * Encodes the specified ComputeThreatListDiffResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static - * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse} message ComputeThreatListDiffResponse message or plain object to encode + * @param {google.cloud.webrisk.v1.IComputeThreatListDiffResponse} message ComputeThreatListDiffResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -878,18 +911,18 @@ /** * Decodes a ComputeThreatListDiffResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ComputeThreatListDiffResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -897,16 +930,16 @@ message.responseType = reader.int32(); break; case 5: - message.additions = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.decode(reader, reader.uint32()); + message.additions = $root.google.cloud.webrisk.v1.ThreatEntryAdditions.decode(reader, reader.uint32()); break; case 6: - message.removals = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.decode(reader, reader.uint32()); + message.removals = $root.google.cloud.webrisk.v1.ThreatEntryRemovals.decode(reader, reader.uint32()); break; case 7: message.newVersionToken = reader.bytes(); break; case 8: - message.checksum = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.decode(reader, reader.uint32()); + message.checksum = $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.decode(reader, reader.uint32()); break; case 2: message.recommendedNextDiff = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); @@ -922,10 +955,10 @@ /** * Decodes a ComputeThreatListDiffResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -938,7 +971,7 @@ /** * Verifies a ComputeThreatListDiffResponse message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -956,12 +989,12 @@ break; } if (message.additions != null && message.hasOwnProperty("additions")) { - var error = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.verify(message.additions); + var error = $root.google.cloud.webrisk.v1.ThreatEntryAdditions.verify(message.additions); if (error) return "additions." + error; } if (message.removals != null && message.hasOwnProperty("removals")) { - var error = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.verify(message.removals); + var error = $root.google.cloud.webrisk.v1.ThreatEntryRemovals.verify(message.removals); if (error) return "removals." + error; } @@ -969,7 +1002,7 @@ if (!(message.newVersionToken && typeof message.newVersionToken.length === "number" || $util.isString(message.newVersionToken))) return "newVersionToken: buffer expected"; if (message.checksum != null && message.hasOwnProperty("checksum")) { - var error = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.verify(message.checksum); + var error = $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.verify(message.checksum); if (error) return "checksum." + error; } @@ -984,15 +1017,15 @@ /** * Creates a ComputeThreatListDiffResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse */ ComputeThreatListDiffResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse) + if (object instanceof $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse) return object; - var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse(); + var message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse(); switch (object.responseType) { case "RESPONSE_TYPE_UNSPECIFIED": case 0: @@ -1009,13 +1042,13 @@ } if (object.additions != null) { if (typeof object.additions !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.additions: object expected"); - message.additions = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.fromObject(object.additions); + throw TypeError(".google.cloud.webrisk.v1.ComputeThreatListDiffResponse.additions: object expected"); + message.additions = $root.google.cloud.webrisk.v1.ThreatEntryAdditions.fromObject(object.additions); } if (object.removals != null) { if (typeof object.removals !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.removals: object expected"); - message.removals = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.fromObject(object.removals); + throw TypeError(".google.cloud.webrisk.v1.ComputeThreatListDiffResponse.removals: object expected"); + message.removals = $root.google.cloud.webrisk.v1.ThreatEntryRemovals.fromObject(object.removals); } if (object.newVersionToken != null) if (typeof object.newVersionToken === "string") @@ -1024,12 +1057,12 @@ message.newVersionToken = object.newVersionToken; if (object.checksum != null) { if (typeof object.checksum !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.checksum: object expected"); - message.checksum = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.fromObject(object.checksum); + throw TypeError(".google.cloud.webrisk.v1.ComputeThreatListDiffResponse.checksum: object expected"); + message.checksum = $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.fromObject(object.checksum); } if (object.recommendedNextDiff != null) { if (typeof object.recommendedNextDiff !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.recommendedNextDiff: object expected"); + throw TypeError(".google.cloud.webrisk.v1.ComputeThreatListDiffResponse.recommendedNextDiff: object expected"); message.recommendedNextDiff = $root.google.protobuf.Timestamp.fromObject(object.recommendedNextDiff); } return message; @@ -1038,9 +1071,9 @@ /** * Creates a plain object from a ComputeThreatListDiffResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} message ComputeThreatListDiffResponse + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse} message ComputeThreatListDiffResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1065,22 +1098,22 @@ if (message.recommendedNextDiff != null && message.hasOwnProperty("recommendedNextDiff")) object.recommendedNextDiff = $root.google.protobuf.Timestamp.toObject(message.recommendedNextDiff, options); if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType[message.responseType] : message.responseType; + object.responseType = options.enums === String ? $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType[message.responseType] : message.responseType; if (message.additions != null && message.hasOwnProperty("additions")) - object.additions = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.toObject(message.additions, options); + object.additions = $root.google.cloud.webrisk.v1.ThreatEntryAdditions.toObject(message.additions, options); if (message.removals != null && message.hasOwnProperty("removals")) - object.removals = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.toObject(message.removals, options); + object.removals = $root.google.cloud.webrisk.v1.ThreatEntryRemovals.toObject(message.removals, options); if (message.newVersionToken != null && message.hasOwnProperty("newVersionToken")) object.newVersionToken = options.bytes === String ? $util.base64.encode(message.newVersionToken, 0, message.newVersionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.newVersionToken) : message.newVersionToken; if (message.checksum != null && message.hasOwnProperty("checksum")) - object.checksum = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.toObject(message.checksum, options); + object.checksum = $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.toObject(message.checksum, options); return object; }; /** * Converts this ComputeThreatListDiffResponse to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @instance * @returns {Object.} JSON object */ @@ -1092,18 +1125,18 @@ /** * Properties of a Checksum. - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @interface IChecksum * @property {Uint8Array|null} [sha256] Checksum sha256 */ /** * Constructs a new Checksum. - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse * @classdesc Represents a Checksum. * @implements IChecksum * @constructor - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum=} [properties] Properties to set */ function Checksum(properties) { if (properties) @@ -1115,7 +1148,7 @@ /** * Checksum sha256. * @member {Uint8Array} sha256 - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @instance */ Checksum.prototype.sha256 = $util.newBuffer([]); @@ -1123,21 +1156,21 @@ /** * Creates a new Checksum instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum instance + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum} Checksum instance */ Checksum.create = function create(properties) { return new Checksum(properties); }; /** - * Encodes the specified Checksum message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. + * Encodes the specified Checksum message. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum} message Checksum message or plain object to encode + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum} message Checksum message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1150,11 +1183,11 @@ }; /** - * Encodes the specified Checksum message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. + * Encodes the specified Checksum message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum} message Checksum message or plain object to encode + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.IChecksum} message Checksum message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1165,18 +1198,18 @@ /** * Decodes a Checksum message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum} Checksum * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Checksum.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1194,10 +1227,10 @@ /** * Decodes a Checksum message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum} Checksum * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1210,7 +1243,7 @@ /** * Verifies a Checksum message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1227,15 +1260,15 @@ /** * Creates a Checksum message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum + * @returns {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum} Checksum */ Checksum.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum) + if (object instanceof $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum) return object; - var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum(); + var message = new $root.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum(); if (object.sha256 != null) if (typeof object.sha256 === "string") $util.base64.decode(object.sha256, message.sha256 = $util.newBuffer($util.base64.length(object.sha256)), 0); @@ -1247,9 +1280,9 @@ /** * Creates a plain object from a Checksum message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @static - * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} message Checksum + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum} message Checksum * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1273,7 +1306,7 @@ /** * Converts this Checksum to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @memberof google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum * @instance * @returns {Object.} JSON object */ @@ -1286,7 +1319,7 @@ /** * ResponseType enum. - * @name google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType + * @name google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType * @enum {string} * @property {number} RESPONSE_TYPE_UNSPECIFIED=0 RESPONSE_TYPE_UNSPECIFIED value * @property {number} DIFF=1 DIFF value @@ -1303,23 +1336,23 @@ return ComputeThreatListDiffResponse; })(); - v1beta1.SearchUrisRequest = (function() { + v1.SearchUrisRequest = (function() { /** * Properties of a SearchUrisRequest. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface ISearchUrisRequest * @property {string|null} [uri] SearchUrisRequest uri - * @property {Array.|null} [threatTypes] SearchUrisRequest threatTypes + * @property {Array.|null} [threatTypes] SearchUrisRequest threatTypes */ /** * Constructs a new SearchUrisRequest. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a SearchUrisRequest. * @implements ISearchUrisRequest * @constructor - * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.ISearchUrisRequest=} [properties] Properties to set */ function SearchUrisRequest(properties) { this.threatTypes = []; @@ -1332,15 +1365,15 @@ /** * SearchUrisRequest uri. * @member {string} uri - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @instance */ SearchUrisRequest.prototype.uri = ""; /** * SearchUrisRequest threatTypes. - * @member {Array.} threatTypes - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @instance */ SearchUrisRequest.prototype.threatTypes = $util.emptyArray; @@ -1348,21 +1381,21 @@ /** * Creates a new SearchUrisRequest instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static - * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest instance + * @param {google.cloud.webrisk.v1.ISearchUrisRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.SearchUrisRequest} SearchUrisRequest instance */ SearchUrisRequest.create = function create(properties) { return new SearchUrisRequest(properties); }; /** - * Encodes the specified SearchUrisRequest message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisRequest.verify|verify} messages. + * Encodes the specified SearchUrisRequest message. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static - * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} message SearchUrisRequest message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchUrisRequest} message SearchUrisRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1381,11 +1414,11 @@ }; /** - * Encodes the specified SearchUrisRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisRequest.verify|verify} messages. + * Encodes the specified SearchUrisRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static - * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} message SearchUrisRequest message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchUrisRequest} message SearchUrisRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1396,18 +1429,18 @@ /** * Decodes a SearchUrisRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest + * @returns {google.cloud.webrisk.v1.SearchUrisRequest} SearchUrisRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SearchUrisRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchUrisRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.SearchUrisRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1435,10 +1468,10 @@ /** * Decodes a SearchUrisRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest + * @returns {google.cloud.webrisk.v1.SearchUrisRequest} SearchUrisRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1451,7 +1484,7 @@ /** * Verifies a SearchUrisRequest message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1482,20 +1515,20 @@ /** * Creates a SearchUrisRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest + * @returns {google.cloud.webrisk.v1.SearchUrisRequest} SearchUrisRequest */ SearchUrisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchUrisRequest) + if (object instanceof $root.google.cloud.webrisk.v1.SearchUrisRequest) return object; - var message = new $root.google.cloud.webrisk.v1beta1.SearchUrisRequest(); + var message = new $root.google.cloud.webrisk.v1.SearchUrisRequest(); if (object.uri != null) message.uri = String(object.uri); if (object.threatTypes) { if (!Array.isArray(object.threatTypes)) - throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisRequest.threatTypes: array expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchUrisRequest.threatTypes: array expected"); message.threatTypes = []; for (var i = 0; i < object.threatTypes.length; ++i) switch (object.threatTypes[i]) { @@ -1524,9 +1557,9 @@ /** * Creates a plain object from a SearchUrisRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @static - * @param {google.cloud.webrisk.v1beta1.SearchUrisRequest} message SearchUrisRequest + * @param {google.cloud.webrisk.v1.SearchUrisRequest} message SearchUrisRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1543,7 +1576,7 @@ if (message.threatTypes && message.threatTypes.length) { object.threatTypes = []; for (var j = 0; j < message.threatTypes.length; ++j) - object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; } return object; }; @@ -1551,7 +1584,7 @@ /** * Converts this SearchUrisRequest to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @memberof google.cloud.webrisk.v1.SearchUrisRequest * @instance * @returns {Object.} JSON object */ @@ -1562,22 +1595,22 @@ return SearchUrisRequest; })(); - v1beta1.SearchUrisResponse = (function() { + v1.SearchUrisResponse = (function() { /** * Properties of a SearchUrisResponse. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface ISearchUrisResponse - * @property {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri|null} [threat] SearchUrisResponse threat + * @property {google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri|null} [threat] SearchUrisResponse threat */ /** * Constructs a new SearchUrisResponse. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a SearchUrisResponse. * @implements ISearchUrisResponse * @constructor - * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.ISearchUrisResponse=} [properties] Properties to set */ function SearchUrisResponse(properties) { if (properties) @@ -1588,8 +1621,8 @@ /** * SearchUrisResponse threat. - * @member {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri|null|undefined} threat - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @member {google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri|null|undefined} threat + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @instance */ SearchUrisResponse.prototype.threat = null; @@ -1597,21 +1630,21 @@ /** * Creates a new SearchUrisResponse instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static - * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse instance + * @param {google.cloud.webrisk.v1.ISearchUrisResponse=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.SearchUrisResponse} SearchUrisResponse instance */ SearchUrisResponse.create = function create(properties) { return new SearchUrisResponse(properties); }; /** - * Encodes the specified SearchUrisResponse message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.verify|verify} messages. + * Encodes the specified SearchUrisResponse message. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static - * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse} message SearchUrisResponse message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchUrisResponse} message SearchUrisResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1619,16 +1652,16 @@ if (!writer) writer = $Writer.create(); if (message.threat != null && message.hasOwnProperty("threat")) - $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.encode(message.threat, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.encode(message.threat, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchUrisResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.verify|verify} messages. + * Encodes the specified SearchUrisResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static - * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse} message SearchUrisResponse message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchUrisResponse} message SearchUrisResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1639,23 +1672,23 @@ /** * Decodes a SearchUrisResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse + * @returns {google.cloud.webrisk.v1.SearchUrisResponse} SearchUrisResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SearchUrisResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.SearchUrisResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.threat = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.decode(reader, reader.uint32()); + message.threat = $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1668,10 +1701,10 @@ /** * Decodes a SearchUrisResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse + * @returns {google.cloud.webrisk.v1.SearchUrisResponse} SearchUrisResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1684,7 +1717,7 @@ /** * Verifies a SearchUrisResponse message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1693,7 +1726,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.threat != null && message.hasOwnProperty("threat")) { - var error = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.verify(message.threat); + var error = $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.verify(message.threat); if (error) return "threat." + error; } @@ -1703,19 +1736,19 @@ /** * Creates a SearchUrisResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse + * @returns {google.cloud.webrisk.v1.SearchUrisResponse} SearchUrisResponse */ SearchUrisResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchUrisResponse) + if (object instanceof $root.google.cloud.webrisk.v1.SearchUrisResponse) return object; - var message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse(); + var message = new $root.google.cloud.webrisk.v1.SearchUrisResponse(); if (object.threat != null) { if (typeof object.threat !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisResponse.threat: object expected"); - message.threat = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.fromObject(object.threat); + throw TypeError(".google.cloud.webrisk.v1.SearchUrisResponse.threat: object expected"); + message.threat = $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.fromObject(object.threat); } return message; }; @@ -1723,9 +1756,9 @@ /** * Creates a plain object from a SearchUrisResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @static - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse} message SearchUrisResponse + * @param {google.cloud.webrisk.v1.SearchUrisResponse} message SearchUrisResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1736,14 +1769,14 @@ if (options.defaults) object.threat = null; if (message.threat != null && message.hasOwnProperty("threat")) - object.threat = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.toObject(message.threat, options); + object.threat = $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.toObject(message.threat, options); return object; }; /** * Converts this SearchUrisResponse to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @instance * @returns {Object.} JSON object */ @@ -1755,19 +1788,19 @@ /** * Properties of a ThreatUri. - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @interface IThreatUri - * @property {Array.|null} [threatTypes] ThreatUri threatTypes + * @property {Array.|null} [threatTypes] ThreatUri threatTypes * @property {google.protobuf.ITimestamp|null} [expireTime] ThreatUri expireTime */ /** * Constructs a new ThreatUri. - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @memberof google.cloud.webrisk.v1.SearchUrisResponse * @classdesc Represents a ThreatUri. * @implements IThreatUri * @constructor - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri=} [properties] Properties to set */ function ThreatUri(properties) { this.threatTypes = []; @@ -1779,8 +1812,8 @@ /** * ThreatUri threatTypes. - * @member {Array.} threatTypes - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @instance */ ThreatUri.prototype.threatTypes = $util.emptyArray; @@ -1788,7 +1821,7 @@ /** * ThreatUri expireTime. * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @instance */ ThreatUri.prototype.expireTime = null; @@ -1796,21 +1829,21 @@ /** * Creates a new ThreatUri instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri instance + * @param {google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri} ThreatUri instance */ ThreatUri.create = function create(properties) { return new ThreatUri(properties); }; /** - * Encodes the specified ThreatUri message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.verify|verify} messages. + * Encodes the specified ThreatUri message. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri} message ThreatUri message or plain object to encode + * @param {google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri} message ThreatUri message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1829,11 +1862,11 @@ }; /** - * Encodes the specified ThreatUri message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.verify|verify} messages. + * Encodes the specified ThreatUri message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri} message ThreatUri message or plain object to encode + * @param {google.cloud.webrisk.v1.SearchUrisResponse.IThreatUri} message ThreatUri message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1844,18 +1877,18 @@ /** * Decodes a ThreatUri message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri + * @returns {google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri} ThreatUri * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ThreatUri.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1883,10 +1916,10 @@ /** * Decodes a ThreatUri message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri + * @returns {google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri} ThreatUri * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1899,7 +1932,7 @@ /** * Verifies a ThreatUri message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1932,18 +1965,18 @@ /** * Creates a ThreatUri message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri + * @returns {google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri} ThreatUri */ ThreatUri.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri) + if (object instanceof $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri) return object; - var message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri(); + var message = new $root.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri(); if (object.threatTypes) { if (!Array.isArray(object.threatTypes)) - throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.threatTypes: array expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.threatTypes: array expected"); message.threatTypes = []; for (var i = 0; i < object.threatTypes.length; ++i) switch (object.threatTypes[i]) { @@ -1968,7 +2001,7 @@ } if (object.expireTime != null) { if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.expireTime: object expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); } return message; @@ -1977,9 +2010,9 @@ /** * Creates a plain object from a ThreatUri message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @static - * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} message ThreatUri + * @param {google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri} message ThreatUri * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1994,7 +2027,7 @@ if (message.threatTypes && message.threatTypes.length) { object.threatTypes = []; for (var j = 0; j < message.threatTypes.length; ++j) - object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; } if (message.expireTime != null && message.hasOwnProperty("expireTime")) object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); @@ -2004,7 +2037,7 @@ /** * Converts this ThreatUri to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @memberof google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri * @instance * @returns {Object.} JSON object */ @@ -2018,23 +2051,23 @@ return SearchUrisResponse; })(); - v1beta1.SearchHashesRequest = (function() { + v1.SearchHashesRequest = (function() { /** * Properties of a SearchHashesRequest. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface ISearchHashesRequest * @property {Uint8Array|null} [hashPrefix] SearchHashesRequest hashPrefix - * @property {Array.|null} [threatTypes] SearchHashesRequest threatTypes + * @property {Array.|null} [threatTypes] SearchHashesRequest threatTypes */ /** * Constructs a new SearchHashesRequest. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a SearchHashesRequest. * @implements ISearchHashesRequest * @constructor - * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.ISearchHashesRequest=} [properties] Properties to set */ function SearchHashesRequest(properties) { this.threatTypes = []; @@ -2047,15 +2080,15 @@ /** * SearchHashesRequest hashPrefix. * @member {Uint8Array} hashPrefix - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @instance */ SearchHashesRequest.prototype.hashPrefix = $util.newBuffer([]); /** * SearchHashesRequest threatTypes. - * @member {Array.} threatTypes - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @instance */ SearchHashesRequest.prototype.threatTypes = $util.emptyArray; @@ -2063,21 +2096,21 @@ /** * Creates a new SearchHashesRequest instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static - * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest instance + * @param {google.cloud.webrisk.v1.ISearchHashesRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.SearchHashesRequest} SearchHashesRequest instance */ SearchHashesRequest.create = function create(properties) { return new SearchHashesRequest(properties); }; /** - * Encodes the specified SearchHashesRequest message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesRequest.verify|verify} messages. + * Encodes the specified SearchHashesRequest message. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static - * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} message SearchHashesRequest message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchHashesRequest} message SearchHashesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2096,11 +2129,11 @@ }; /** - * Encodes the specified SearchHashesRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesRequest.verify|verify} messages. + * Encodes the specified SearchHashesRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static - * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} message SearchHashesRequest message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchHashesRequest} message SearchHashesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2111,18 +2144,18 @@ /** * Decodes a SearchHashesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest + * @returns {google.cloud.webrisk.v1.SearchHashesRequest} SearchHashesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SearchHashesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchHashesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.SearchHashesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2150,10 +2183,10 @@ /** * Decodes a SearchHashesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest + * @returns {google.cloud.webrisk.v1.SearchHashesRequest} SearchHashesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2166,7 +2199,7 @@ /** * Verifies a SearchHashesRequest message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2197,15 +2230,15 @@ /** * Creates a SearchHashesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest + * @returns {google.cloud.webrisk.v1.SearchHashesRequest} SearchHashesRequest */ SearchHashesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchHashesRequest) + if (object instanceof $root.google.cloud.webrisk.v1.SearchHashesRequest) return object; - var message = new $root.google.cloud.webrisk.v1beta1.SearchHashesRequest(); + var message = new $root.google.cloud.webrisk.v1.SearchHashesRequest(); if (object.hashPrefix != null) if (typeof object.hashPrefix === "string") $util.base64.decode(object.hashPrefix, message.hashPrefix = $util.newBuffer($util.base64.length(object.hashPrefix)), 0); @@ -2213,7 +2246,7 @@ message.hashPrefix = object.hashPrefix; if (object.threatTypes) { if (!Array.isArray(object.threatTypes)) - throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesRequest.threatTypes: array expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchHashesRequest.threatTypes: array expected"); message.threatTypes = []; for (var i = 0; i < object.threatTypes.length; ++i) switch (object.threatTypes[i]) { @@ -2242,9 +2275,9 @@ /** * Creates a plain object from a SearchHashesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @static - * @param {google.cloud.webrisk.v1beta1.SearchHashesRequest} message SearchHashesRequest + * @param {google.cloud.webrisk.v1.SearchHashesRequest} message SearchHashesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2267,7 +2300,7 @@ if (message.threatTypes && message.threatTypes.length) { object.threatTypes = []; for (var j = 0; j < message.threatTypes.length; ++j) - object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; } return object; }; @@ -2275,7 +2308,7 @@ /** * Converts this SearchHashesRequest to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @memberof google.cloud.webrisk.v1.SearchHashesRequest * @instance * @returns {Object.} JSON object */ @@ -2286,23 +2319,23 @@ return SearchHashesRequest; })(); - v1beta1.SearchHashesResponse = (function() { + v1.SearchHashesResponse = (function() { /** * Properties of a SearchHashesResponse. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface ISearchHashesResponse - * @property {Array.|null} [threats] SearchHashesResponse threats + * @property {Array.|null} [threats] SearchHashesResponse threats * @property {google.protobuf.ITimestamp|null} [negativeExpireTime] SearchHashesResponse negativeExpireTime */ /** * Constructs a new SearchHashesResponse. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a SearchHashesResponse. * @implements ISearchHashesResponse * @constructor - * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.ISearchHashesResponse=} [properties] Properties to set */ function SearchHashesResponse(properties) { this.threats = []; @@ -2314,8 +2347,8 @@ /** * SearchHashesResponse threats. - * @member {Array.} threats - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @member {Array.} threats + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @instance */ SearchHashesResponse.prototype.threats = $util.emptyArray; @@ -2323,7 +2356,7 @@ /** * SearchHashesResponse negativeExpireTime. * @member {google.protobuf.ITimestamp|null|undefined} negativeExpireTime - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @instance */ SearchHashesResponse.prototype.negativeExpireTime = null; @@ -2331,21 +2364,21 @@ /** * Creates a new SearchHashesResponse instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static - * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse instance + * @param {google.cloud.webrisk.v1.ISearchHashesResponse=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.SearchHashesResponse} SearchHashesResponse instance */ SearchHashesResponse.create = function create(properties) { return new SearchHashesResponse(properties); }; /** - * Encodes the specified SearchHashesResponse message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.verify|verify} messages. + * Encodes the specified SearchHashesResponse message. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static - * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse} message SearchHashesResponse message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchHashesResponse} message SearchHashesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2354,18 +2387,18 @@ writer = $Writer.create(); if (message.threats != null && message.threats.length) for (var i = 0; i < message.threats.length; ++i) - $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.encode(message.threats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.encode(message.threats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.negativeExpireTime != null && message.hasOwnProperty("negativeExpireTime")) $root.google.protobuf.Timestamp.encode(message.negativeExpireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchHashesResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.verify|verify} messages. + * Encodes the specified SearchHashesResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static - * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse} message SearchHashesResponse message or plain object to encode + * @param {google.cloud.webrisk.v1.ISearchHashesResponse} message SearchHashesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2376,25 +2409,25 @@ /** * Decodes a SearchHashesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse + * @returns {google.cloud.webrisk.v1.SearchHashesResponse} SearchHashesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SearchHashesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.SearchHashesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.threats && message.threats.length)) message.threats = []; - message.threats.push($root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.decode(reader, reader.uint32())); + message.threats.push($root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.decode(reader, reader.uint32())); break; case 2: message.negativeExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); @@ -2410,10 +2443,10 @@ /** * Decodes a SearchHashesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse + * @returns {google.cloud.webrisk.v1.SearchHashesResponse} SearchHashesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2426,7 +2459,7 @@ /** * Verifies a SearchHashesResponse message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2438,7 +2471,7 @@ if (!Array.isArray(message.threats)) return "threats: array expected"; for (var i = 0; i < message.threats.length; ++i) { - var error = $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.verify(message.threats[i]); + var error = $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.verify(message.threats[i]); if (error) return "threats." + error; } @@ -2454,28 +2487,28 @@ /** * Creates a SearchHashesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse + * @returns {google.cloud.webrisk.v1.SearchHashesResponse} SearchHashesResponse */ SearchHashesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchHashesResponse) + if (object instanceof $root.google.cloud.webrisk.v1.SearchHashesResponse) return object; - var message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse(); + var message = new $root.google.cloud.webrisk.v1.SearchHashesResponse(); if (object.threats) { if (!Array.isArray(object.threats)) - throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.threats: array expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchHashesResponse.threats: array expected"); message.threats = []; for (var i = 0; i < object.threats.length; ++i) { if (typeof object.threats[i] !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.threats: object expected"); - message.threats[i] = $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.fromObject(object.threats[i]); + throw TypeError(".google.cloud.webrisk.v1.SearchHashesResponse.threats: object expected"); + message.threats[i] = $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.fromObject(object.threats[i]); } } if (object.negativeExpireTime != null) { if (typeof object.negativeExpireTime !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.negativeExpireTime: object expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchHashesResponse.negativeExpireTime: object expected"); message.negativeExpireTime = $root.google.protobuf.Timestamp.fromObject(object.negativeExpireTime); } return message; @@ -2484,9 +2517,9 @@ /** * Creates a plain object from a SearchHashesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @static - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse} message SearchHashesResponse + * @param {google.cloud.webrisk.v1.SearchHashesResponse} message SearchHashesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2501,7 +2534,7 @@ if (message.threats && message.threats.length) { object.threats = []; for (var j = 0; j < message.threats.length; ++j) - object.threats[j] = $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.toObject(message.threats[j], options); + object.threats[j] = $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.toObject(message.threats[j], options); } if (message.negativeExpireTime != null && message.hasOwnProperty("negativeExpireTime")) object.negativeExpireTime = $root.google.protobuf.Timestamp.toObject(message.negativeExpireTime, options); @@ -2511,7 +2544,7 @@ /** * Converts this SearchHashesResponse to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @instance * @returns {Object.} JSON object */ @@ -2523,20 +2556,20 @@ /** * Properties of a ThreatHash. - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @interface IThreatHash - * @property {Array.|null} [threatTypes] ThreatHash threatTypes + * @property {Array.|null} [threatTypes] ThreatHash threatTypes * @property {Uint8Array|null} [hash] ThreatHash hash * @property {google.protobuf.ITimestamp|null} [expireTime] ThreatHash expireTime */ /** * Constructs a new ThreatHash. - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @memberof google.cloud.webrisk.v1.SearchHashesResponse * @classdesc Represents a ThreatHash. * @implements IThreatHash * @constructor - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash=} [properties] Properties to set */ function ThreatHash(properties) { this.threatTypes = []; @@ -2548,8 +2581,8 @@ /** * ThreatHash threatTypes. - * @member {Array.} threatTypes - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @instance */ ThreatHash.prototype.threatTypes = $util.emptyArray; @@ -2557,7 +2590,7 @@ /** * ThreatHash hash. * @member {Uint8Array} hash - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @instance */ ThreatHash.prototype.hash = $util.newBuffer([]); @@ -2565,7 +2598,7 @@ /** * ThreatHash expireTime. * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @instance */ ThreatHash.prototype.expireTime = null; @@ -2573,21 +2606,21 @@ /** * Creates a new ThreatHash instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash instance + * @param {google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash} ThreatHash instance */ ThreatHash.create = function create(properties) { return new ThreatHash(properties); }; /** - * Encodes the specified ThreatHash message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.verify|verify} messages. + * Encodes the specified ThreatHash message. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash} message ThreatHash message or plain object to encode + * @param {google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash} message ThreatHash message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2608,11 +2641,11 @@ }; /** - * Encodes the specified ThreatHash message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.verify|verify} messages. + * Encodes the specified ThreatHash message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash} message ThreatHash message or plain object to encode + * @param {google.cloud.webrisk.v1.SearchHashesResponse.IThreatHash} message ThreatHash message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2623,18 +2656,18 @@ /** * Decodes a ThreatHash message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash + * @returns {google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash} ThreatHash * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ThreatHash.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2665,10 +2698,10 @@ /** * Decodes a ThreatHash message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash + * @returns {google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash} ThreatHash * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2681,7 +2714,7 @@ /** * Verifies a ThreatHash message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2717,18 +2750,18 @@ /** * Creates a ThreatHash message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash + * @returns {google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash} ThreatHash */ ThreatHash.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash) + if (object instanceof $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash) return object; - var message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash(); + var message = new $root.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash(); if (object.threatTypes) { if (!Array.isArray(object.threatTypes)) - throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.threatTypes: array expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.threatTypes: array expected"); message.threatTypes = []; for (var i = 0; i < object.threatTypes.length; ++i) switch (object.threatTypes[i]) { @@ -2758,7 +2791,7 @@ message.hash = object.hash; if (object.expireTime != null) { if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.expireTime: object expected"); + throw TypeError(".google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); } return message; @@ -2767,9 +2800,9 @@ /** * Creates a plain object from a ThreatHash message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @static - * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} message ThreatHash + * @param {google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash} message ThreatHash * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2792,7 +2825,7 @@ if (message.threatTypes && message.threatTypes.length) { object.threatTypes = []; for (var j = 0; j < message.threatTypes.length; ++j) - object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; } if (message.hash != null && message.hasOwnProperty("hash")) object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; @@ -2804,7 +2837,7 @@ /** * Converts this ThreatHash to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @memberof google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash * @instance * @returns {Object.} JSON object */ @@ -2818,23 +2851,23 @@ return SearchHashesResponse; })(); - v1beta1.ThreatEntryAdditions = (function() { + v1.ThreatEntryAdditions = (function() { /** * Properties of a ThreatEntryAdditions. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IThreatEntryAdditions - * @property {Array.|null} [rawHashes] ThreatEntryAdditions rawHashes - * @property {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null} [riceHashes] ThreatEntryAdditions riceHashes + * @property {Array.|null} [rawHashes] ThreatEntryAdditions rawHashes + * @property {google.cloud.webrisk.v1.IRiceDeltaEncoding|null} [riceHashes] ThreatEntryAdditions riceHashes */ /** * Constructs a new ThreatEntryAdditions. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a ThreatEntryAdditions. * @implements IThreatEntryAdditions * @constructor - * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IThreatEntryAdditions=} [properties] Properties to set */ function ThreatEntryAdditions(properties) { this.rawHashes = []; @@ -2846,16 +2879,16 @@ /** * ThreatEntryAdditions rawHashes. - * @member {Array.} rawHashes - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @member {Array.} rawHashes + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @instance */ ThreatEntryAdditions.prototype.rawHashes = $util.emptyArray; /** * ThreatEntryAdditions riceHashes. - * @member {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null|undefined} riceHashes - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @member {google.cloud.webrisk.v1.IRiceDeltaEncoding|null|undefined} riceHashes + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @instance */ ThreatEntryAdditions.prototype.riceHashes = null; @@ -2863,21 +2896,21 @@ /** * Creates a new ThreatEntryAdditions instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static - * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions instance + * @param {google.cloud.webrisk.v1.IThreatEntryAdditions=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.ThreatEntryAdditions} ThreatEntryAdditions instance */ ThreatEntryAdditions.create = function create(properties) { return new ThreatEntryAdditions(properties); }; /** - * Encodes the specified ThreatEntryAdditions message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryAdditions.verify|verify} messages. + * Encodes the specified ThreatEntryAdditions message. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryAdditions.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static - * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions} message ThreatEntryAdditions message or plain object to encode + * @param {google.cloud.webrisk.v1.IThreatEntryAdditions} message ThreatEntryAdditions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2886,18 +2919,18 @@ writer = $Writer.create(); if (message.rawHashes != null && message.rawHashes.length) for (var i = 0; i < message.rawHashes.length; ++i) - $root.google.cloud.webrisk.v1beta1.RawHashes.encode(message.rawHashes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.webrisk.v1.RawHashes.encode(message.rawHashes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.riceHashes != null && message.hasOwnProperty("riceHashes")) - $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.encode(message.riceHashes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.webrisk.v1.RiceDeltaEncoding.encode(message.riceHashes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ThreatEntryAdditions message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryAdditions.verify|verify} messages. + * Encodes the specified ThreatEntryAdditions message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryAdditions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static - * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions} message ThreatEntryAdditions message or plain object to encode + * @param {google.cloud.webrisk.v1.IThreatEntryAdditions} message ThreatEntryAdditions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2908,28 +2941,28 @@ /** * Decodes a ThreatEntryAdditions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions + * @returns {google.cloud.webrisk.v1.ThreatEntryAdditions} ThreatEntryAdditions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ThreatEntryAdditions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.ThreatEntryAdditions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.rawHashes && message.rawHashes.length)) message.rawHashes = []; - message.rawHashes.push($root.google.cloud.webrisk.v1beta1.RawHashes.decode(reader, reader.uint32())); + message.rawHashes.push($root.google.cloud.webrisk.v1.RawHashes.decode(reader, reader.uint32())); break; case 2: - message.riceHashes = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.decode(reader, reader.uint32()); + message.riceHashes = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2942,10 +2975,10 @@ /** * Decodes a ThreatEntryAdditions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions + * @returns {google.cloud.webrisk.v1.ThreatEntryAdditions} ThreatEntryAdditions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2958,7 +2991,7 @@ /** * Verifies a ThreatEntryAdditions message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2970,13 +3003,13 @@ if (!Array.isArray(message.rawHashes)) return "rawHashes: array expected"; for (var i = 0; i < message.rawHashes.length; ++i) { - var error = $root.google.cloud.webrisk.v1beta1.RawHashes.verify(message.rawHashes[i]); + var error = $root.google.cloud.webrisk.v1.RawHashes.verify(message.rawHashes[i]); if (error) return "rawHashes." + error; } } if (message.riceHashes != null && message.hasOwnProperty("riceHashes")) { - var error = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify(message.riceHashes); + var error = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.verify(message.riceHashes); if (error) return "riceHashes." + error; } @@ -2986,29 +3019,29 @@ /** * Creates a ThreatEntryAdditions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions + * @returns {google.cloud.webrisk.v1.ThreatEntryAdditions} ThreatEntryAdditions */ ThreatEntryAdditions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions) + if (object instanceof $root.google.cloud.webrisk.v1.ThreatEntryAdditions) return object; - var message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions(); + var message = new $root.google.cloud.webrisk.v1.ThreatEntryAdditions(); if (object.rawHashes) { if (!Array.isArray(object.rawHashes)) - throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryAdditions.rawHashes: array expected"); + throw TypeError(".google.cloud.webrisk.v1.ThreatEntryAdditions.rawHashes: array expected"); message.rawHashes = []; for (var i = 0; i < object.rawHashes.length; ++i) { if (typeof object.rawHashes[i] !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryAdditions.rawHashes: object expected"); - message.rawHashes[i] = $root.google.cloud.webrisk.v1beta1.RawHashes.fromObject(object.rawHashes[i]); + throw TypeError(".google.cloud.webrisk.v1.ThreatEntryAdditions.rawHashes: object expected"); + message.rawHashes[i] = $root.google.cloud.webrisk.v1.RawHashes.fromObject(object.rawHashes[i]); } } if (object.riceHashes != null) { if (typeof object.riceHashes !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryAdditions.riceHashes: object expected"); - message.riceHashes = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.fromObject(object.riceHashes); + throw TypeError(".google.cloud.webrisk.v1.ThreatEntryAdditions.riceHashes: object expected"); + message.riceHashes = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.fromObject(object.riceHashes); } return message; }; @@ -3016,9 +3049,9 @@ /** * Creates a plain object from a ThreatEntryAdditions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @static - * @param {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} message ThreatEntryAdditions + * @param {google.cloud.webrisk.v1.ThreatEntryAdditions} message ThreatEntryAdditions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3033,17 +3066,17 @@ if (message.rawHashes && message.rawHashes.length) { object.rawHashes = []; for (var j = 0; j < message.rawHashes.length; ++j) - object.rawHashes[j] = $root.google.cloud.webrisk.v1beta1.RawHashes.toObject(message.rawHashes[j], options); + object.rawHashes[j] = $root.google.cloud.webrisk.v1.RawHashes.toObject(message.rawHashes[j], options); } if (message.riceHashes != null && message.hasOwnProperty("riceHashes")) - object.riceHashes = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.toObject(message.riceHashes, options); + object.riceHashes = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.toObject(message.riceHashes, options); return object; }; /** * Converts this ThreatEntryAdditions to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @memberof google.cloud.webrisk.v1.ThreatEntryAdditions * @instance * @returns {Object.} JSON object */ @@ -3054,23 +3087,23 @@ return ThreatEntryAdditions; })(); - v1beta1.ThreatEntryRemovals = (function() { + v1.ThreatEntryRemovals = (function() { /** * Properties of a ThreatEntryRemovals. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IThreatEntryRemovals - * @property {google.cloud.webrisk.v1beta1.IRawIndices|null} [rawIndices] ThreatEntryRemovals rawIndices - * @property {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null} [riceIndices] ThreatEntryRemovals riceIndices + * @property {google.cloud.webrisk.v1.IRawIndices|null} [rawIndices] ThreatEntryRemovals rawIndices + * @property {google.cloud.webrisk.v1.IRiceDeltaEncoding|null} [riceIndices] ThreatEntryRemovals riceIndices */ /** * Constructs a new ThreatEntryRemovals. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a ThreatEntryRemovals. * @implements IThreatEntryRemovals * @constructor - * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IThreatEntryRemovals=} [properties] Properties to set */ function ThreatEntryRemovals(properties) { if (properties) @@ -3081,16 +3114,16 @@ /** * ThreatEntryRemovals rawIndices. - * @member {google.cloud.webrisk.v1beta1.IRawIndices|null|undefined} rawIndices - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @member {google.cloud.webrisk.v1.IRawIndices|null|undefined} rawIndices + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @instance */ ThreatEntryRemovals.prototype.rawIndices = null; /** * ThreatEntryRemovals riceIndices. - * @member {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null|undefined} riceIndices - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @member {google.cloud.webrisk.v1.IRiceDeltaEncoding|null|undefined} riceIndices + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @instance */ ThreatEntryRemovals.prototype.riceIndices = null; @@ -3098,21 +3131,21 @@ /** * Creates a new ThreatEntryRemovals instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static - * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals instance + * @param {google.cloud.webrisk.v1.IThreatEntryRemovals=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.ThreatEntryRemovals} ThreatEntryRemovals instance */ ThreatEntryRemovals.create = function create(properties) { return new ThreatEntryRemovals(properties); }; /** - * Encodes the specified ThreatEntryRemovals message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryRemovals.verify|verify} messages. + * Encodes the specified ThreatEntryRemovals message. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryRemovals.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static - * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals} message ThreatEntryRemovals message or plain object to encode + * @param {google.cloud.webrisk.v1.IThreatEntryRemovals} message ThreatEntryRemovals message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3120,18 +3153,18 @@ if (!writer) writer = $Writer.create(); if (message.rawIndices != null && message.hasOwnProperty("rawIndices")) - $root.google.cloud.webrisk.v1beta1.RawIndices.encode(message.rawIndices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.webrisk.v1.RawIndices.encode(message.rawIndices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.riceIndices != null && message.hasOwnProperty("riceIndices")) - $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.encode(message.riceIndices, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.webrisk.v1.RiceDeltaEncoding.encode(message.riceIndices, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ThreatEntryRemovals message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryRemovals.verify|verify} messages. + * Encodes the specified ThreatEntryRemovals message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.ThreatEntryRemovals.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static - * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals} message ThreatEntryRemovals message or plain object to encode + * @param {google.cloud.webrisk.v1.IThreatEntryRemovals} message ThreatEntryRemovals message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3142,26 +3175,26 @@ /** * Decodes a ThreatEntryRemovals message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals + * @returns {google.cloud.webrisk.v1.ThreatEntryRemovals} ThreatEntryRemovals * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ThreatEntryRemovals.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.ThreatEntryRemovals(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rawIndices = $root.google.cloud.webrisk.v1beta1.RawIndices.decode(reader, reader.uint32()); + message.rawIndices = $root.google.cloud.webrisk.v1.RawIndices.decode(reader, reader.uint32()); break; case 2: - message.riceIndices = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.decode(reader, reader.uint32()); + message.riceIndices = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3174,10 +3207,10 @@ /** * Decodes a ThreatEntryRemovals message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals + * @returns {google.cloud.webrisk.v1.ThreatEntryRemovals} ThreatEntryRemovals * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3190,7 +3223,7 @@ /** * Verifies a ThreatEntryRemovals message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3199,12 +3232,12 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.rawIndices != null && message.hasOwnProperty("rawIndices")) { - var error = $root.google.cloud.webrisk.v1beta1.RawIndices.verify(message.rawIndices); + var error = $root.google.cloud.webrisk.v1.RawIndices.verify(message.rawIndices); if (error) return "rawIndices." + error; } if (message.riceIndices != null && message.hasOwnProperty("riceIndices")) { - var error = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify(message.riceIndices); + var error = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.verify(message.riceIndices); if (error) return "riceIndices." + error; } @@ -3214,24 +3247,24 @@ /** * Creates a ThreatEntryRemovals message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals + * @returns {google.cloud.webrisk.v1.ThreatEntryRemovals} ThreatEntryRemovals */ ThreatEntryRemovals.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals) + if (object instanceof $root.google.cloud.webrisk.v1.ThreatEntryRemovals) return object; - var message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals(); + var message = new $root.google.cloud.webrisk.v1.ThreatEntryRemovals(); if (object.rawIndices != null) { if (typeof object.rawIndices !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryRemovals.rawIndices: object expected"); - message.rawIndices = $root.google.cloud.webrisk.v1beta1.RawIndices.fromObject(object.rawIndices); + throw TypeError(".google.cloud.webrisk.v1.ThreatEntryRemovals.rawIndices: object expected"); + message.rawIndices = $root.google.cloud.webrisk.v1.RawIndices.fromObject(object.rawIndices); } if (object.riceIndices != null) { if (typeof object.riceIndices !== "object") - throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryRemovals.riceIndices: object expected"); - message.riceIndices = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.fromObject(object.riceIndices); + throw TypeError(".google.cloud.webrisk.v1.ThreatEntryRemovals.riceIndices: object expected"); + message.riceIndices = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.fromObject(object.riceIndices); } return message; }; @@ -3239,9 +3272,9 @@ /** * Creates a plain object from a ThreatEntryRemovals message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @static - * @param {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} message ThreatEntryRemovals + * @param {google.cloud.webrisk.v1.ThreatEntryRemovals} message ThreatEntryRemovals * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3254,16 +3287,16 @@ object.riceIndices = null; } if (message.rawIndices != null && message.hasOwnProperty("rawIndices")) - object.rawIndices = $root.google.cloud.webrisk.v1beta1.RawIndices.toObject(message.rawIndices, options); + object.rawIndices = $root.google.cloud.webrisk.v1.RawIndices.toObject(message.rawIndices, options); if (message.riceIndices != null && message.hasOwnProperty("riceIndices")) - object.riceIndices = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.toObject(message.riceIndices, options); + object.riceIndices = $root.google.cloud.webrisk.v1.RiceDeltaEncoding.toObject(message.riceIndices, options); return object; }; /** * Converts this ThreatEntryRemovals to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @memberof google.cloud.webrisk.v1.ThreatEntryRemovals * @instance * @returns {Object.} JSON object */ @@ -3276,14 +3309,14 @@ /** * ThreatType enum. - * @name google.cloud.webrisk.v1beta1.ThreatType + * @name google.cloud.webrisk.v1.ThreatType * @enum {string} * @property {number} THREAT_TYPE_UNSPECIFIED=0 THREAT_TYPE_UNSPECIFIED value * @property {number} MALWARE=1 MALWARE value * @property {number} SOCIAL_ENGINEERING=2 SOCIAL_ENGINEERING value * @property {number} UNWANTED_SOFTWARE=3 UNWANTED_SOFTWARE value */ - v1beta1.ThreatType = (function() { + v1.ThreatType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "THREAT_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "MALWARE"] = 1; @@ -3294,13 +3327,13 @@ /** * CompressionType enum. - * @name google.cloud.webrisk.v1beta1.CompressionType + * @name google.cloud.webrisk.v1.CompressionType * @enum {string} * @property {number} COMPRESSION_TYPE_UNSPECIFIED=0 COMPRESSION_TYPE_UNSPECIFIED value * @property {number} RAW=1 RAW value * @property {number} RICE=2 RICE value */ - v1beta1.CompressionType = (function() { + v1.CompressionType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "COMPRESSION_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "RAW"] = 1; @@ -3308,22 +3341,22 @@ return values; })(); - v1beta1.RawIndices = (function() { + v1.RawIndices = (function() { /** * Properties of a RawIndices. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IRawIndices * @property {Array.|null} [indices] RawIndices indices */ /** * Constructs a new RawIndices. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a RawIndices. * @implements IRawIndices * @constructor - * @param {google.cloud.webrisk.v1beta1.IRawIndices=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IRawIndices=} [properties] Properties to set */ function RawIndices(properties) { this.indices = []; @@ -3336,7 +3369,7 @@ /** * RawIndices indices. * @member {Array.} indices - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @instance */ RawIndices.prototype.indices = $util.emptyArray; @@ -3344,21 +3377,21 @@ /** * Creates a new RawIndices instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static - * @param {google.cloud.webrisk.v1beta1.IRawIndices=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices instance + * @param {google.cloud.webrisk.v1.IRawIndices=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.RawIndices} RawIndices instance */ RawIndices.create = function create(properties) { return new RawIndices(properties); }; /** - * Encodes the specified RawIndices message. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawIndices.verify|verify} messages. + * Encodes the specified RawIndices message. Does not implicitly {@link google.cloud.webrisk.v1.RawIndices.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static - * @param {google.cloud.webrisk.v1beta1.IRawIndices} message RawIndices message or plain object to encode + * @param {google.cloud.webrisk.v1.IRawIndices} message RawIndices message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3375,11 +3408,11 @@ }; /** - * Encodes the specified RawIndices message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawIndices.verify|verify} messages. + * Encodes the specified RawIndices message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.RawIndices.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static - * @param {google.cloud.webrisk.v1beta1.IRawIndices} message RawIndices message or plain object to encode + * @param {google.cloud.webrisk.v1.IRawIndices} message RawIndices message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3390,18 +3423,18 @@ /** * Decodes a RawIndices message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices + * @returns {google.cloud.webrisk.v1.RawIndices} RawIndices * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RawIndices.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.RawIndices(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.RawIndices(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3426,10 +3459,10 @@ /** * Decodes a RawIndices message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices + * @returns {google.cloud.webrisk.v1.RawIndices} RawIndices * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3442,7 +3475,7 @@ /** * Verifies a RawIndices message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3463,18 +3496,18 @@ /** * Creates a RawIndices message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices + * @returns {google.cloud.webrisk.v1.RawIndices} RawIndices */ RawIndices.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.RawIndices) + if (object instanceof $root.google.cloud.webrisk.v1.RawIndices) return object; - var message = new $root.google.cloud.webrisk.v1beta1.RawIndices(); + var message = new $root.google.cloud.webrisk.v1.RawIndices(); if (object.indices) { if (!Array.isArray(object.indices)) - throw TypeError(".google.cloud.webrisk.v1beta1.RawIndices.indices: array expected"); + throw TypeError(".google.cloud.webrisk.v1.RawIndices.indices: array expected"); message.indices = []; for (var i = 0; i < object.indices.length; ++i) message.indices[i] = object.indices[i] | 0; @@ -3485,9 +3518,9 @@ /** * Creates a plain object from a RawIndices message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @static - * @param {google.cloud.webrisk.v1beta1.RawIndices} message RawIndices + * @param {google.cloud.webrisk.v1.RawIndices} message RawIndices * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3508,7 +3541,7 @@ /** * Converts this RawIndices to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @memberof google.cloud.webrisk.v1.RawIndices * @instance * @returns {Object.} JSON object */ @@ -3519,11 +3552,11 @@ return RawIndices; })(); - v1beta1.RawHashes = (function() { + v1.RawHashes = (function() { /** * Properties of a RawHashes. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IRawHashes * @property {number|null} [prefixSize] RawHashes prefixSize * @property {Uint8Array|null} [rawHashes] RawHashes rawHashes @@ -3531,11 +3564,11 @@ /** * Constructs a new RawHashes. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a RawHashes. * @implements IRawHashes * @constructor - * @param {google.cloud.webrisk.v1beta1.IRawHashes=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IRawHashes=} [properties] Properties to set */ function RawHashes(properties) { if (properties) @@ -3547,7 +3580,7 @@ /** * RawHashes prefixSize. * @member {number} prefixSize - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @instance */ RawHashes.prototype.prefixSize = 0; @@ -3555,7 +3588,7 @@ /** * RawHashes rawHashes. * @member {Uint8Array} rawHashes - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @instance */ RawHashes.prototype.rawHashes = $util.newBuffer([]); @@ -3563,21 +3596,21 @@ /** * Creates a new RawHashes instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static - * @param {google.cloud.webrisk.v1beta1.IRawHashes=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes instance + * @param {google.cloud.webrisk.v1.IRawHashes=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.RawHashes} RawHashes instance */ RawHashes.create = function create(properties) { return new RawHashes(properties); }; /** - * Encodes the specified RawHashes message. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawHashes.verify|verify} messages. + * Encodes the specified RawHashes message. Does not implicitly {@link google.cloud.webrisk.v1.RawHashes.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static - * @param {google.cloud.webrisk.v1beta1.IRawHashes} message RawHashes message or plain object to encode + * @param {google.cloud.webrisk.v1.IRawHashes} message RawHashes message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3592,11 +3625,11 @@ }; /** - * Encodes the specified RawHashes message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawHashes.verify|verify} messages. + * Encodes the specified RawHashes message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.RawHashes.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static - * @param {google.cloud.webrisk.v1beta1.IRawHashes} message RawHashes message or plain object to encode + * @param {google.cloud.webrisk.v1.IRawHashes} message RawHashes message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3607,18 +3640,18 @@ /** * Decodes a RawHashes message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes + * @returns {google.cloud.webrisk.v1.RawHashes} RawHashes * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RawHashes.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.RawHashes(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.RawHashes(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3639,10 +3672,10 @@ /** * Decodes a RawHashes message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes + * @returns {google.cloud.webrisk.v1.RawHashes} RawHashes * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3655,7 +3688,7 @@ /** * Verifies a RawHashes message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3675,15 +3708,15 @@ /** * Creates a RawHashes message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes + * @returns {google.cloud.webrisk.v1.RawHashes} RawHashes */ RawHashes.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.RawHashes) + if (object instanceof $root.google.cloud.webrisk.v1.RawHashes) return object; - var message = new $root.google.cloud.webrisk.v1beta1.RawHashes(); + var message = new $root.google.cloud.webrisk.v1.RawHashes(); if (object.prefixSize != null) message.prefixSize = object.prefixSize | 0; if (object.rawHashes != null) @@ -3697,9 +3730,9 @@ /** * Creates a plain object from a RawHashes message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @static - * @param {google.cloud.webrisk.v1beta1.RawHashes} message RawHashes + * @param {google.cloud.webrisk.v1.RawHashes} message RawHashes * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3727,7 +3760,7 @@ /** * Converts this RawHashes to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @memberof google.cloud.webrisk.v1.RawHashes * @instance * @returns {Object.} JSON object */ @@ -3738,11 +3771,11 @@ return RawHashes; })(); - v1beta1.RiceDeltaEncoding = (function() { + v1.RiceDeltaEncoding = (function() { /** * Properties of a RiceDeltaEncoding. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @interface IRiceDeltaEncoding * @property {number|Long|null} [firstValue] RiceDeltaEncoding firstValue * @property {number|null} [riceParameter] RiceDeltaEncoding riceParameter @@ -3752,11 +3785,11 @@ /** * Constructs a new RiceDeltaEncoding. - * @memberof google.cloud.webrisk.v1beta1 + * @memberof google.cloud.webrisk.v1 * @classdesc Represents a RiceDeltaEncoding. * @implements IRiceDeltaEncoding * @constructor - * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding=} [properties] Properties to set + * @param {google.cloud.webrisk.v1.IRiceDeltaEncoding=} [properties] Properties to set */ function RiceDeltaEncoding(properties) { if (properties) @@ -3768,7 +3801,7 @@ /** * RiceDeltaEncoding firstValue. * @member {number|Long} firstValue - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @instance */ RiceDeltaEncoding.prototype.firstValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; @@ -3776,7 +3809,7 @@ /** * RiceDeltaEncoding riceParameter. * @member {number} riceParameter - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @instance */ RiceDeltaEncoding.prototype.riceParameter = 0; @@ -3784,7 +3817,7 @@ /** * RiceDeltaEncoding entryCount. * @member {number} entryCount - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @instance */ RiceDeltaEncoding.prototype.entryCount = 0; @@ -3792,7 +3825,7 @@ /** * RiceDeltaEncoding encodedData. * @member {Uint8Array} encodedData - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @instance */ RiceDeltaEncoding.prototype.encodedData = $util.newBuffer([]); @@ -3800,21 +3833,21 @@ /** * Creates a new RiceDeltaEncoding instance using the specified properties. * @function create - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static - * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding=} [properties] Properties to set - * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding instance + * @param {google.cloud.webrisk.v1.IRiceDeltaEncoding=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.RiceDeltaEncoding} RiceDeltaEncoding instance */ RiceDeltaEncoding.create = function create(properties) { return new RiceDeltaEncoding(properties); }; /** - * Encodes the specified RiceDeltaEncoding message. Does not implicitly {@link google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify|verify} messages. + * Encodes the specified RiceDeltaEncoding message. Does not implicitly {@link google.cloud.webrisk.v1.RiceDeltaEncoding.verify|verify} messages. * @function encode - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static - * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding} message RiceDeltaEncoding message or plain object to encode + * @param {google.cloud.webrisk.v1.IRiceDeltaEncoding} message RiceDeltaEncoding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3833,11 +3866,11 @@ }; /** - * Encodes the specified RiceDeltaEncoding message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify|verify} messages. + * Encodes the specified RiceDeltaEncoding message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.RiceDeltaEncoding.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static - * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding} message RiceDeltaEncoding message or plain object to encode + * @param {google.cloud.webrisk.v1.IRiceDeltaEncoding} message RiceDeltaEncoding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3848,18 +3881,18 @@ /** * Decodes a RiceDeltaEncoding message from the specified reader or buffer. * @function decode - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding + * @returns {google.cloud.webrisk.v1.RiceDeltaEncoding} RiceDeltaEncoding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RiceDeltaEncoding.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.RiceDeltaEncoding(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3886,10 +3919,10 @@ /** * Decodes a RiceDeltaEncoding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding + * @returns {google.cloud.webrisk.v1.RiceDeltaEncoding} RiceDeltaEncoding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3902,7 +3935,7 @@ /** * Verifies a RiceDeltaEncoding message. * @function verify - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3928,15 +3961,15 @@ /** * Creates a RiceDeltaEncoding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static * @param {Object.} object Plain object - * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding + * @returns {google.cloud.webrisk.v1.RiceDeltaEncoding} RiceDeltaEncoding */ RiceDeltaEncoding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding) + if (object instanceof $root.google.cloud.webrisk.v1.RiceDeltaEncoding) return object; - var message = new $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding(); + var message = new $root.google.cloud.webrisk.v1.RiceDeltaEncoding(); if (object.firstValue != null) if ($util.Long) (message.firstValue = $util.Long.fromValue(object.firstValue)).unsigned = false; @@ -3961,9 +3994,9 @@ /** * Creates a plain object from a RiceDeltaEncoding message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @static - * @param {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} message RiceDeltaEncoding + * @param {google.cloud.webrisk.v1.RiceDeltaEncoding} message RiceDeltaEncoding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4004,7 +4037,7 @@ /** * Converts this RiceDeltaEncoding to JSON. * @function toJSON - * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @memberof google.cloud.webrisk.v1.RiceDeltaEncoding * @instance * @returns {Object.} JSON object */ @@ -4015,136 +4048,5189 @@ return RiceDeltaEncoding; })(); - return v1beta1; - })(); + v1.Submission = (function() { - return webrisk; - })(); + /** + * Properties of a Submission. + * @memberof google.cloud.webrisk.v1 + * @interface ISubmission + * @property {string|null} [uri] Submission uri + */ - return cloud; - })(); + /** + * Constructs a new Submission. + * @memberof google.cloud.webrisk.v1 + * @classdesc Represents a Submission. + * @implements ISubmission + * @constructor + * @param {google.cloud.webrisk.v1.ISubmission=} [properties] Properties to set + */ + function Submission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - google.api = (function() { + /** + * Submission uri. + * @member {string} uri + * @memberof google.cloud.webrisk.v1.Submission + * @instance + */ + Submission.prototype.uri = ""; - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Creates a new Submission instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {google.cloud.webrisk.v1.ISubmission=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.Submission} Submission instance + */ + Submission.create = function create(properties) { + return new Submission(properties); + }; - api.Http = (function() { + /** + * Encodes the specified Submission message. Does not implicitly {@link google.cloud.webrisk.v1.Submission.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {google.cloud.webrisk.v1.ISubmission} message Submission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Submission.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; + }; - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ + /** + * Encodes the specified Submission message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.Submission.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {google.cloud.webrisk.v1.ISubmission} message Submission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Submission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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]]; - } + /** + * Decodes a Submission message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1.Submission} Submission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Submission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.Submission(); + 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; + }; - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; + /** + * Decodes a Submission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1.Submission} Submission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Submission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; + /** + * Verifies a Submission message. + * @function verify + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Submission.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 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); - }; + /** + * Creates a Submission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1.Submission} Submission + */ + Submission.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1.Submission) + return object; + var message = new $root.google.cloud.webrisk.v1.Submission(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; - /** - * 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 + /** + * Creates a plain object from a Submission message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1.Submission + * @static + * @param {google.cloud.webrisk.v1.Submission} message Submission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Submission.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 Submission to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1.Submission + * @instance + * @returns {Object.} JSON object + */ + Submission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Submission; + })(); + + v1.CreateSubmissionRequest = (function() { + + /** + * Properties of a CreateSubmissionRequest. + * @memberof google.cloud.webrisk.v1 + * @interface ICreateSubmissionRequest + * @property {string|null} [parent] CreateSubmissionRequest parent + * @property {google.cloud.webrisk.v1.ISubmission|null} [submission] CreateSubmissionRequest submission + */ + + /** + * Constructs a new CreateSubmissionRequest. + * @memberof google.cloud.webrisk.v1 + * @classdesc Represents a CreateSubmissionRequest. + * @implements ICreateSubmissionRequest + * @constructor + * @param {google.cloud.webrisk.v1.ICreateSubmissionRequest=} [properties] Properties to set + */ + function CreateSubmissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSubmissionRequest parent. + * @member {string} parent + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @instance + */ + CreateSubmissionRequest.prototype.parent = ""; + + /** + * CreateSubmissionRequest submission. + * @member {google.cloud.webrisk.v1.ISubmission|null|undefined} submission + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @instance + */ + CreateSubmissionRequest.prototype.submission = null; + + /** + * Creates a new CreateSubmissionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {google.cloud.webrisk.v1.ICreateSubmissionRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1.CreateSubmissionRequest} CreateSubmissionRequest instance + */ + CreateSubmissionRequest.create = function create(properties) { + return new CreateSubmissionRequest(properties); + }; + + /** + * Encodes the specified CreateSubmissionRequest message. Does not implicitly {@link google.cloud.webrisk.v1.CreateSubmissionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {google.cloud.webrisk.v1.ICreateSubmissionRequest} message CreateSubmissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSubmissionRequest.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.submission != null && message.hasOwnProperty("submission")) + $root.google.cloud.webrisk.v1.Submission.encode(message.submission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSubmissionRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1.CreateSubmissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {google.cloud.webrisk.v1.ICreateSubmissionRequest} message CreateSubmissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSubmissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSubmissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1.CreateSubmissionRequest} CreateSubmissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSubmissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1.CreateSubmissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.submission = $root.google.cloud.webrisk.v1.Submission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSubmissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1.CreateSubmissionRequest} CreateSubmissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSubmissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSubmissionRequest message. + * @function verify + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSubmissionRequest.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.submission != null && message.hasOwnProperty("submission")) { + var error = $root.google.cloud.webrisk.v1.Submission.verify(message.submission); + if (error) + return "submission." + error; + } + return null; + }; + + /** + * Creates a CreateSubmissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1.CreateSubmissionRequest} CreateSubmissionRequest + */ + CreateSubmissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1.CreateSubmissionRequest) + return object; + var message = new $root.google.cloud.webrisk.v1.CreateSubmissionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.submission != null) { + if (typeof object.submission !== "object") + throw TypeError(".google.cloud.webrisk.v1.CreateSubmissionRequest.submission: object expected"); + message.submission = $root.google.cloud.webrisk.v1.Submission.fromObject(object.submission); + } + return message; + }; + + /** + * Creates a plain object from a CreateSubmissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @static + * @param {google.cloud.webrisk.v1.CreateSubmissionRequest} message CreateSubmissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSubmissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.submission = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.submission != null && message.hasOwnProperty("submission")) + object.submission = $root.google.cloud.webrisk.v1.Submission.toObject(message.submission, options); + return object; + }; + + /** + * Converts this CreateSubmissionRequest to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1.CreateSubmissionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSubmissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSubmissionRequest; + })(); + + return v1; + })(); + + webrisk.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.webrisk + * @namespace + */ + var v1beta1 = {}; + + v1beta1.WebRiskServiceV1Beta1 = (function() { + + /** + * Constructs a new WebRiskServiceV1Beta1 service. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a WebRiskServiceV1Beta1 + * @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 WebRiskServiceV1Beta1(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WebRiskServiceV1Beta1.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WebRiskServiceV1Beta1; + + /** + * Creates new WebRiskServiceV1Beta1 service using the specified rpc implementation. + * @function create + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @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 {WebRiskServiceV1Beta1} RPC service. Useful where requests and/or responses are streamed. + */ + WebRiskServiceV1Beta1.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1#computeThreatListDiff}. + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @typedef ComputeThreatListDiffCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} [response] ComputeThreatListDiffResponse + */ + + /** + * Calls ComputeThreatListDiff. + * @function computeThreatListDiff + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @instance + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} request ComputeThreatListDiffRequest message or plain object + * @param {google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.ComputeThreatListDiffCallback} callback Node-style callback called with the error, if any, and ComputeThreatListDiffResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebRiskServiceV1Beta1.prototype.computeThreatListDiff = function computeThreatListDiff(request, callback) { + return this.rpcCall(computeThreatListDiff, $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest, $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse, request, callback); + }, "name", { value: "ComputeThreatListDiff" }); + + /** + * Calls ComputeThreatListDiff. + * @function computeThreatListDiff + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @instance + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} request ComputeThreatListDiffRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1#searchUris}. + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @typedef SearchUrisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse} [response] SearchUrisResponse + */ + + /** + * Calls SearchUris. + * @function searchUris + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @instance + * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} request SearchUrisRequest message or plain object + * @param {google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchUrisCallback} callback Node-style callback called with the error, if any, and SearchUrisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebRiskServiceV1Beta1.prototype.searchUris = function searchUris(request, callback) { + return this.rpcCall(searchUris, $root.google.cloud.webrisk.v1beta1.SearchUrisRequest, $root.google.cloud.webrisk.v1beta1.SearchUrisResponse, request, callback); + }, "name", { value: "SearchUris" }); + + /** + * Calls SearchUris. + * @function searchUris + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @instance + * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} request SearchUrisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1#searchHashes}. + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @typedef SearchHashesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse} [response] SearchHashesResponse + */ + + /** + * Calls SearchHashes. + * @function searchHashes + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @instance + * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} request SearchHashesRequest message or plain object + * @param {google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchHashesCallback} callback Node-style callback called with the error, if any, and SearchHashesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebRiskServiceV1Beta1.prototype.searchHashes = function searchHashes(request, callback) { + return this.rpcCall(searchHashes, $root.google.cloud.webrisk.v1beta1.SearchHashesRequest, $root.google.cloud.webrisk.v1beta1.SearchHashesResponse, request, callback); + }, "name", { value: "SearchHashes" }); + + /** + * Calls SearchHashes. + * @function searchHashes + * @memberof google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1 + * @instance + * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} request SearchHashesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WebRiskServiceV1Beta1; + })(); + + v1beta1.ComputeThreatListDiffRequest = (function() { + + /** + * Properties of a ComputeThreatListDiffRequest. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IComputeThreatListDiffRequest + * @property {google.cloud.webrisk.v1beta1.ThreatType|null} [threatType] ComputeThreatListDiffRequest threatType + * @property {Uint8Array|null} [versionToken] ComputeThreatListDiffRequest versionToken + * @property {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints|null} [constraints] ComputeThreatListDiffRequest constraints + */ + + /** + * Constructs a new ComputeThreatListDiffRequest. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a ComputeThreatListDiffRequest. + * @implements IComputeThreatListDiffRequest + * @constructor + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest=} [properties] Properties to set + */ + function ComputeThreatListDiffRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeThreatListDiffRequest threatType. + * @member {google.cloud.webrisk.v1beta1.ThreatType} threatType + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @instance + */ + ComputeThreatListDiffRequest.prototype.threatType = 0; + + /** + * ComputeThreatListDiffRequest versionToken. + * @member {Uint8Array} versionToken + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @instance + */ + ComputeThreatListDiffRequest.prototype.versionToken = $util.newBuffer([]); + + /** + * ComputeThreatListDiffRequest constraints. + * @member {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints|null|undefined} constraints + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @instance + */ + ComputeThreatListDiffRequest.prototype.constraints = null; + + /** + * Creates a new ComputeThreatListDiffRequest instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest instance + */ + ComputeThreatListDiffRequest.create = function create(properties) { + return new ComputeThreatListDiffRequest(properties); + }; + + /** + * Encodes the specified ComputeThreatListDiffRequest message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} message ComputeThreatListDiffRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeThreatListDiffRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threatType != null && message.hasOwnProperty("threatType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.threatType); + if (message.versionToken != null && message.hasOwnProperty("versionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.versionToken); + if (message.constraints != null && message.hasOwnProperty("constraints")) + $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.encode(message.constraints, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeThreatListDiffRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffRequest} message ComputeThreatListDiffRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeThreatListDiffRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeThreatListDiffRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeThreatListDiffRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threatType = reader.int32(); + break; + case 2: + message.versionToken = reader.bytes(); + break; + case 3: + message.constraints = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeThreatListDiffRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeThreatListDiffRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeThreatListDiffRequest message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeThreatListDiffRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threatType != null && message.hasOwnProperty("threatType")) + switch (message.threatType) { + default: + return "threatType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.versionToken != null && message.hasOwnProperty("versionToken")) + if (!(message.versionToken && typeof message.versionToken.length === "number" || $util.isString(message.versionToken))) + return "versionToken: buffer expected"; + if (message.constraints != null && message.hasOwnProperty("constraints")) { + var error = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.verify(message.constraints); + if (error) + return "constraints." + error; + } + return null; + }; + + /** + * Creates a ComputeThreatListDiffRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} ComputeThreatListDiffRequest + */ + ComputeThreatListDiffRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest(); + switch (object.threatType) { + case "THREAT_TYPE_UNSPECIFIED": + case 0: + message.threatType = 0; + break; + case "MALWARE": + case 1: + message.threatType = 1; + break; + case "SOCIAL_ENGINEERING": + case 2: + message.threatType = 2; + break; + case "UNWANTED_SOFTWARE": + case 3: + message.threatType = 3; + break; + } + if (object.versionToken != null) + if (typeof object.versionToken === "string") + $util.base64.decode(object.versionToken, message.versionToken = $util.newBuffer($util.base64.length(object.versionToken)), 0); + else if (object.versionToken.length) + message.versionToken = object.versionToken; + if (object.constraints != null) { + if (typeof object.constraints !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.constraints: object expected"); + message.constraints = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.fromObject(object.constraints); + } + return message; + }; + + /** + * Creates a plain object from a ComputeThreatListDiffRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest} message ComputeThreatListDiffRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeThreatListDiffRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.threatType = options.enums === String ? "THREAT_TYPE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.versionToken = ""; + else { + object.versionToken = []; + if (options.bytes !== Array) + object.versionToken = $util.newBuffer(object.versionToken); + } + object.constraints = null; + } + if (message.threatType != null && message.hasOwnProperty("threatType")) + object.threatType = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatType] : message.threatType; + if (message.versionToken != null && message.hasOwnProperty("versionToken")) + object.versionToken = options.bytes === String ? $util.base64.encode(message.versionToken, 0, message.versionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.versionToken) : message.versionToken; + if (message.constraints != null && message.hasOwnProperty("constraints")) + object.constraints = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.toObject(message.constraints, options); + return object; + }; + + /** + * Converts this ComputeThreatListDiffRequest to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @instance + * @returns {Object.} JSON object + */ + ComputeThreatListDiffRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ComputeThreatListDiffRequest.Constraints = (function() { + + /** + * Properties of a Constraints. + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @interface IConstraints + * @property {number|null} [maxDiffEntries] Constraints maxDiffEntries + * @property {number|null} [maxDatabaseEntries] Constraints maxDatabaseEntries + * @property {Array.|null} [supportedCompressions] Constraints supportedCompressions + */ + + /** + * Constructs a new Constraints. + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest + * @classdesc Represents a Constraints. + * @implements IConstraints + * @constructor + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints=} [properties] Properties to set + */ + function Constraints(properties) { + this.supportedCompressions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Constraints maxDiffEntries. + * @member {number} maxDiffEntries + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @instance + */ + Constraints.prototype.maxDiffEntries = 0; + + /** + * Constraints maxDatabaseEntries. + * @member {number} maxDatabaseEntries + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @instance + */ + Constraints.prototype.maxDatabaseEntries = 0; + + /** + * Constraints supportedCompressions. + * @member {Array.} supportedCompressions + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @instance + */ + Constraints.prototype.supportedCompressions = $util.emptyArray; + + /** + * Creates a new Constraints instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints instance + */ + Constraints.create = function create(properties) { + return new Constraints(properties); + }; + + /** + * Encodes the specified Constraints message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints} message Constraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxDiffEntries != null && message.hasOwnProperty("maxDiffEntries")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxDiffEntries); + if (message.maxDatabaseEntries != null && message.hasOwnProperty("maxDatabaseEntries")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDatabaseEntries); + if (message.supportedCompressions != null && message.supportedCompressions.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.supportedCompressions.length; ++i) + writer.int32(message.supportedCompressions[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Constraints message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.IConstraints} message Constraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Constraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxDiffEntries = reader.int32(); + break; + case 2: + message.maxDatabaseEntries = reader.int32(); + break; + case 3: + if (!(message.supportedCompressions && message.supportedCompressions.length)) + message.supportedCompressions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedCompressions.push(reader.int32()); + } else + message.supportedCompressions.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Constraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Constraints message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Constraints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxDiffEntries != null && message.hasOwnProperty("maxDiffEntries")) + if (!$util.isInteger(message.maxDiffEntries)) + return "maxDiffEntries: integer expected"; + if (message.maxDatabaseEntries != null && message.hasOwnProperty("maxDatabaseEntries")) + if (!$util.isInteger(message.maxDatabaseEntries)) + return "maxDatabaseEntries: integer expected"; + if (message.supportedCompressions != null && message.hasOwnProperty("supportedCompressions")) { + if (!Array.isArray(message.supportedCompressions)) + return "supportedCompressions: array expected"; + for (var i = 0; i < message.supportedCompressions.length; ++i) + switch (message.supportedCompressions[i]) { + default: + return "supportedCompressions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a Constraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} Constraints + */ + Constraints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints(); + if (object.maxDiffEntries != null) + message.maxDiffEntries = object.maxDiffEntries | 0; + if (object.maxDatabaseEntries != null) + message.maxDatabaseEntries = object.maxDatabaseEntries | 0; + if (object.supportedCompressions) { + if (!Array.isArray(object.supportedCompressions)) + throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.supportedCompressions: array expected"); + message.supportedCompressions = []; + for (var i = 0; i < object.supportedCompressions.length; ++i) + switch (object.supportedCompressions[i]) { + default: + case "COMPRESSION_TYPE_UNSPECIFIED": + case 0: + message.supportedCompressions[i] = 0; + break; + case "RAW": + case 1: + message.supportedCompressions[i] = 1; + break; + case "RICE": + case 2: + message.supportedCompressions[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a Constraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints} message Constraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Constraints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedCompressions = []; + if (options.defaults) { + object.maxDiffEntries = 0; + object.maxDatabaseEntries = 0; + } + if (message.maxDiffEntries != null && message.hasOwnProperty("maxDiffEntries")) + object.maxDiffEntries = message.maxDiffEntries; + if (message.maxDatabaseEntries != null && message.hasOwnProperty("maxDatabaseEntries")) + object.maxDatabaseEntries = message.maxDatabaseEntries; + if (message.supportedCompressions && message.supportedCompressions.length) { + object.supportedCompressions = []; + for (var j = 0; j < message.supportedCompressions.length; ++j) + object.supportedCompressions[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.CompressionType[message.supportedCompressions[j]] : message.supportedCompressions[j]; + } + return object; + }; + + /** + * Converts this Constraints to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints + * @instance + * @returns {Object.} JSON object + */ + Constraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Constraints; + })(); + + return ComputeThreatListDiffRequest; + })(); + + v1beta1.ComputeThreatListDiffResponse = (function() { + + /** + * Properties of a ComputeThreatListDiffResponse. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IComputeThreatListDiffResponse + * @property {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType|null} [responseType] ComputeThreatListDiffResponse responseType + * @property {google.cloud.webrisk.v1beta1.IThreatEntryAdditions|null} [additions] ComputeThreatListDiffResponse additions + * @property {google.cloud.webrisk.v1beta1.IThreatEntryRemovals|null} [removals] ComputeThreatListDiffResponse removals + * @property {Uint8Array|null} [newVersionToken] ComputeThreatListDiffResponse newVersionToken + * @property {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum|null} [checksum] ComputeThreatListDiffResponse checksum + * @property {google.protobuf.ITimestamp|null} [recommendedNextDiff] ComputeThreatListDiffResponse recommendedNextDiff + */ + + /** + * Constructs a new ComputeThreatListDiffResponse. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a ComputeThreatListDiffResponse. + * @implements IComputeThreatListDiffResponse + * @constructor + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse=} [properties] Properties to set + */ + function ComputeThreatListDiffResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeThreatListDiffResponse responseType. + * @member {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType} responseType + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + */ + ComputeThreatListDiffResponse.prototype.responseType = 0; + + /** + * ComputeThreatListDiffResponse additions. + * @member {google.cloud.webrisk.v1beta1.IThreatEntryAdditions|null|undefined} additions + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + */ + ComputeThreatListDiffResponse.prototype.additions = null; + + /** + * ComputeThreatListDiffResponse removals. + * @member {google.cloud.webrisk.v1beta1.IThreatEntryRemovals|null|undefined} removals + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + */ + ComputeThreatListDiffResponse.prototype.removals = null; + + /** + * ComputeThreatListDiffResponse newVersionToken. + * @member {Uint8Array} newVersionToken + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + */ + ComputeThreatListDiffResponse.prototype.newVersionToken = $util.newBuffer([]); + + /** + * ComputeThreatListDiffResponse checksum. + * @member {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum|null|undefined} checksum + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + */ + ComputeThreatListDiffResponse.prototype.checksum = null; + + /** + * ComputeThreatListDiffResponse recommendedNextDiff. + * @member {google.protobuf.ITimestamp|null|undefined} recommendedNextDiff + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + */ + ComputeThreatListDiffResponse.prototype.recommendedNextDiff = null; + + /** + * Creates a new ComputeThreatListDiffResponse instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse instance + */ + ComputeThreatListDiffResponse.create = function create(properties) { + return new ComputeThreatListDiffResponse(properties); + }; + + /** + * Encodes the specified ComputeThreatListDiffResponse message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse} message ComputeThreatListDiffResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeThreatListDiffResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recommendedNextDiff != null && message.hasOwnProperty("recommendedNextDiff")) + $root.google.protobuf.Timestamp.encode(message.recommendedNextDiff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.responseType != null && message.hasOwnProperty("responseType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.responseType); + if (message.additions != null && message.hasOwnProperty("additions")) + $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.encode(message.additions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.removals != null && message.hasOwnProperty("removals")) + $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.encode(message.removals, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.newVersionToken != null && message.hasOwnProperty("newVersionToken")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.newVersionToken); + if (message.checksum != null && message.hasOwnProperty("checksum")) + $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.encode(message.checksum, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeThreatListDiffResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {google.cloud.webrisk.v1beta1.IComputeThreatListDiffResponse} message ComputeThreatListDiffResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeThreatListDiffResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeThreatListDiffResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeThreatListDiffResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.responseType = reader.int32(); + break; + case 5: + message.additions = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.decode(reader, reader.uint32()); + break; + case 6: + message.removals = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.decode(reader, reader.uint32()); + break; + case 7: + message.newVersionToken = reader.bytes(); + break; + case 8: + message.checksum = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.decode(reader, reader.uint32()); + break; + case 2: + message.recommendedNextDiff = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeThreatListDiffResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeThreatListDiffResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeThreatListDiffResponse message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeThreatListDiffResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + switch (message.responseType) { + default: + return "responseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.additions != null && message.hasOwnProperty("additions")) { + var error = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.verify(message.additions); + if (error) + return "additions." + error; + } + if (message.removals != null && message.hasOwnProperty("removals")) { + var error = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.verify(message.removals); + if (error) + return "removals." + error; + } + if (message.newVersionToken != null && message.hasOwnProperty("newVersionToken")) + if (!(message.newVersionToken && typeof message.newVersionToken.length === "number" || $util.isString(message.newVersionToken))) + return "newVersionToken: buffer expected"; + if (message.checksum != null && message.hasOwnProperty("checksum")) { + var error = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.verify(message.checksum); + if (error) + return "checksum." + error; + } + if (message.recommendedNextDiff != null && message.hasOwnProperty("recommendedNextDiff")) { + var error = $root.google.protobuf.Timestamp.verify(message.recommendedNextDiff); + if (error) + return "recommendedNextDiff." + error; + } + return null; + }; + + /** + * Creates a ComputeThreatListDiffResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} ComputeThreatListDiffResponse + */ + ComputeThreatListDiffResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse(); + switch (object.responseType) { + case "RESPONSE_TYPE_UNSPECIFIED": + case 0: + message.responseType = 0; + break; + case "DIFF": + case 1: + message.responseType = 1; + break; + case "RESET": + case 2: + message.responseType = 2; + break; + } + if (object.additions != null) { + if (typeof object.additions !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.additions: object expected"); + message.additions = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.fromObject(object.additions); + } + if (object.removals != null) { + if (typeof object.removals !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.removals: object expected"); + message.removals = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.fromObject(object.removals); + } + if (object.newVersionToken != null) + if (typeof object.newVersionToken === "string") + $util.base64.decode(object.newVersionToken, message.newVersionToken = $util.newBuffer($util.base64.length(object.newVersionToken)), 0); + else if (object.newVersionToken.length) + message.newVersionToken = object.newVersionToken; + if (object.checksum != null) { + if (typeof object.checksum !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.checksum: object expected"); + message.checksum = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.fromObject(object.checksum); + } + if (object.recommendedNextDiff != null) { + if (typeof object.recommendedNextDiff !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.recommendedNextDiff: object expected"); + message.recommendedNextDiff = $root.google.protobuf.Timestamp.fromObject(object.recommendedNextDiff); + } + return message; + }; + + /** + * Creates a plain object from a ComputeThreatListDiffResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse} message ComputeThreatListDiffResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeThreatListDiffResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.recommendedNextDiff = null; + object.responseType = options.enums === String ? "RESPONSE_TYPE_UNSPECIFIED" : 0; + object.additions = null; + object.removals = null; + if (options.bytes === String) + object.newVersionToken = ""; + else { + object.newVersionToken = []; + if (options.bytes !== Array) + object.newVersionToken = $util.newBuffer(object.newVersionToken); + } + object.checksum = null; + } + if (message.recommendedNextDiff != null && message.hasOwnProperty("recommendedNextDiff")) + object.recommendedNextDiff = $root.google.protobuf.Timestamp.toObject(message.recommendedNextDiff, options); + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType[message.responseType] : message.responseType; + if (message.additions != null && message.hasOwnProperty("additions")) + object.additions = $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions.toObject(message.additions, options); + if (message.removals != null && message.hasOwnProperty("removals")) + object.removals = $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals.toObject(message.removals, options); + if (message.newVersionToken != null && message.hasOwnProperty("newVersionToken")) + object.newVersionToken = options.bytes === String ? $util.base64.encode(message.newVersionToken, 0, message.newVersionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.newVersionToken) : message.newVersionToken; + if (message.checksum != null && message.hasOwnProperty("checksum")) + object.checksum = $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.toObject(message.checksum, options); + return object; + }; + + /** + * Converts this ComputeThreatListDiffResponse to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @instance + * @returns {Object.} JSON object + */ + ComputeThreatListDiffResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ComputeThreatListDiffResponse.Checksum = (function() { + + /** + * Properties of a Checksum. + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @interface IChecksum + * @property {Uint8Array|null} [sha256] Checksum sha256 + */ + + /** + * Constructs a new Checksum. + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse + * @classdesc Represents a Checksum. + * @implements IChecksum + * @constructor + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum=} [properties] Properties to set + */ + function Checksum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Checksum sha256. + * @member {Uint8Array} sha256 + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @instance + */ + Checksum.prototype.sha256 = $util.newBuffer([]); + + /** + * Creates a new Checksum instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum instance + */ + Checksum.create = function create(properties) { + return new Checksum(properties); + }; + + /** + * Encodes the specified Checksum message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum} message Checksum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Checksum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sha256 != null && message.hasOwnProperty("sha256")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.sha256); + return writer; + }; + + /** + * Encodes the specified Checksum message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.IChecksum} message Checksum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Checksum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Checksum message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Checksum.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sha256 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Checksum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Checksum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Checksum message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Checksum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + if (!(message.sha256 && typeof message.sha256.length === "number" || $util.isString(message.sha256))) + return "sha256: buffer expected"; + return null; + }; + + /** + * Creates a Checksum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} Checksum + */ + Checksum.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum(); + if (object.sha256 != null) + if (typeof object.sha256 === "string") + $util.base64.decode(object.sha256, message.sha256 = $util.newBuffer($util.base64.length(object.sha256)), 0); + else if (object.sha256.length) + message.sha256 = object.sha256; + return message; + }; + + /** + * Creates a plain object from a Checksum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @static + * @param {google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum} message Checksum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Checksum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.sha256 = ""; + else { + object.sha256 = []; + if (options.bytes !== Array) + object.sha256 = $util.newBuffer(object.sha256); + } + if (message.sha256 != null && message.hasOwnProperty("sha256")) + object.sha256 = options.bytes === String ? $util.base64.encode(message.sha256, 0, message.sha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha256) : message.sha256; + return object; + }; + + /** + * Converts this Checksum to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum + * @instance + * @returns {Object.} JSON object + */ + Checksum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Checksum; + })(); + + /** + * ResponseType enum. + * @name google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType + * @enum {string} + * @property {number} RESPONSE_TYPE_UNSPECIFIED=0 RESPONSE_TYPE_UNSPECIFIED value + * @property {number} DIFF=1 DIFF value + * @property {number} RESET=2 RESET value + */ + ComputeThreatListDiffResponse.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIFF"] = 1; + values[valuesById[2] = "RESET"] = 2; + return values; + })(); + + return ComputeThreatListDiffResponse; + })(); + + v1beta1.SearchUrisRequest = (function() { + + /** + * Properties of a SearchUrisRequest. + * @memberof google.cloud.webrisk.v1beta1 + * @interface ISearchUrisRequest + * @property {string|null} [uri] SearchUrisRequest uri + * @property {Array.|null} [threatTypes] SearchUrisRequest threatTypes + */ + + /** + * Constructs a new SearchUrisRequest. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a SearchUrisRequest. + * @implements ISearchUrisRequest + * @constructor + * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest=} [properties] Properties to set + */ + function SearchUrisRequest(properties) { + this.threatTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchUrisRequest uri. + * @member {string} uri + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @instance + */ + SearchUrisRequest.prototype.uri = ""; + + /** + * SearchUrisRequest threatTypes. + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @instance + */ + SearchUrisRequest.prototype.threatTypes = $util.emptyArray; + + /** + * Creates a new SearchUrisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest instance + */ + SearchUrisRequest.create = function create(properties) { + return new SearchUrisRequest(properties); + }; + + /** + * Encodes the specified SearchUrisRequest message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} message SearchUrisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchUrisRequest.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.threatTypes != null && message.threatTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.threatTypes.length; ++i) + writer.int32(message.threatTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SearchUrisRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchUrisRequest} message SearchUrisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchUrisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchUrisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchUrisRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchUrisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + if (!(message.threatTypes && message.threatTypes.length)) + message.threatTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.threatTypes.push(reader.int32()); + } else + message.threatTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchUrisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchUrisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchUrisRequest message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchUrisRequest.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.threatTypes != null && message.hasOwnProperty("threatTypes")) { + if (!Array.isArray(message.threatTypes)) + return "threatTypes: array expected"; + for (var i = 0; i < message.threatTypes.length; ++i) + switch (message.threatTypes[i]) { + default: + return "threatTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a SearchUrisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.SearchUrisRequest} SearchUrisRequest + */ + SearchUrisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchUrisRequest) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.SearchUrisRequest(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.threatTypes) { + if (!Array.isArray(object.threatTypes)) + throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisRequest.threatTypes: array expected"); + message.threatTypes = []; + for (var i = 0; i < object.threatTypes.length; ++i) + switch (object.threatTypes[i]) { + default: + case "THREAT_TYPE_UNSPECIFIED": + case 0: + message.threatTypes[i] = 0; + break; + case "MALWARE": + case 1: + message.threatTypes[i] = 1; + break; + case "SOCIAL_ENGINEERING": + case 2: + message.threatTypes[i] = 2; + break; + case "UNWANTED_SOFTWARE": + case 3: + message.threatTypes[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SearchUrisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @static + * @param {google.cloud.webrisk.v1beta1.SearchUrisRequest} message SearchUrisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchUrisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.threatTypes = []; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.threatTypes && message.threatTypes.length) { + object.threatTypes = []; + for (var j = 0; j < message.threatTypes.length; ++j) + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + } + return object; + }; + + /** + * Converts this SearchUrisRequest to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.SearchUrisRequest + * @instance + * @returns {Object.} JSON object + */ + SearchUrisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchUrisRequest; + })(); + + v1beta1.SearchUrisResponse = (function() { + + /** + * Properties of a SearchUrisResponse. + * @memberof google.cloud.webrisk.v1beta1 + * @interface ISearchUrisResponse + * @property {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri|null} [threat] SearchUrisResponse threat + */ + + /** + * Constructs a new SearchUrisResponse. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a SearchUrisResponse. + * @implements ISearchUrisResponse + * @constructor + * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse=} [properties] Properties to set + */ + function SearchUrisResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchUrisResponse threat. + * @member {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri|null|undefined} threat + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @instance + */ + SearchUrisResponse.prototype.threat = null; + + /** + * Creates a new SearchUrisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse instance + */ + SearchUrisResponse.create = function create(properties) { + return new SearchUrisResponse(properties); + }; + + /** + * Encodes the specified SearchUrisResponse message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse} message SearchUrisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchUrisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threat != null && message.hasOwnProperty("threat")) + $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.encode(message.threat, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchUrisResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchUrisResponse} message SearchUrisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchUrisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchUrisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchUrisResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threat = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchUrisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchUrisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchUrisResponse message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchUrisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threat != null && message.hasOwnProperty("threat")) { + var error = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.verify(message.threat); + if (error) + return "threat." + error; + } + return null; + }; + + /** + * Creates a SearchUrisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse} SearchUrisResponse + */ + SearchUrisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchUrisResponse) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse(); + if (object.threat != null) { + if (typeof object.threat !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisResponse.threat: object expected"); + message.threat = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.fromObject(object.threat); + } + return message; + }; + + /** + * Creates a plain object from a SearchUrisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @static + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse} message SearchUrisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchUrisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.threat = null; + if (message.threat != null && message.hasOwnProperty("threat")) + object.threat = $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.toObject(message.threat, options); + return object; + }; + + /** + * Converts this SearchUrisResponse to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @instance + * @returns {Object.} JSON object + */ + SearchUrisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SearchUrisResponse.ThreatUri = (function() { + + /** + * Properties of a ThreatUri. + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @interface IThreatUri + * @property {Array.|null} [threatTypes] ThreatUri threatTypes + * @property {google.protobuf.ITimestamp|null} [expireTime] ThreatUri expireTime + */ + + /** + * Constructs a new ThreatUri. + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse + * @classdesc Represents a ThreatUri. + * @implements IThreatUri + * @constructor + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri=} [properties] Properties to set + */ + function ThreatUri(properties) { + this.threatTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreatUri threatTypes. + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @instance + */ + ThreatUri.prototype.threatTypes = $util.emptyArray; + + /** + * ThreatUri expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @instance + */ + ThreatUri.prototype.expireTime = null; + + /** + * Creates a new ThreatUri instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri instance + */ + ThreatUri.create = function create(properties) { + return new ThreatUri(properties); + }; + + /** + * Encodes the specified ThreatUri message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri} message ThreatUri message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatUri.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threatTypes != null && message.threatTypes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.threatTypes.length; ++i) + writer.int32(message.threatTypes[i]); + writer.ldelim(); + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ThreatUri message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.IThreatUri} message ThreatUri message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatUri.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreatUri message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatUri.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.threatTypes && message.threatTypes.length)) + message.threatTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.threatTypes.push(reader.int32()); + } else + message.threatTypes.push(reader.int32()); + break; + case 2: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreatUri message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatUri.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreatUri message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreatUri.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threatTypes != null && message.hasOwnProperty("threatTypes")) { + if (!Array.isArray(message.threatTypes)) + return "threatTypes: array expected"; + for (var i = 0; i < message.threatTypes.length; ++i) + switch (message.threatTypes[i]) { + default: + return "threatTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a ThreatUri message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} ThreatUri + */ + ThreatUri.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri(); + if (object.threatTypes) { + if (!Array.isArray(object.threatTypes)) + throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.threatTypes: array expected"); + message.threatTypes = []; + for (var i = 0; i < object.threatTypes.length; ++i) + switch (object.threatTypes[i]) { + default: + case "THREAT_TYPE_UNSPECIFIED": + case 0: + message.threatTypes[i] = 0; + break; + case "MALWARE": + case 1: + message.threatTypes[i] = 1; + break; + case "SOCIAL_ENGINEERING": + case 2: + message.threatTypes[i] = 2; + break; + case "UNWANTED_SOFTWARE": + case 3: + message.threatTypes[i] = 3; + break; + } + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a ThreatUri message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @static + * @param {google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri} message ThreatUri + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThreatUri.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.threatTypes = []; + if (options.defaults) + object.expireTime = null; + if (message.threatTypes && message.threatTypes.length) { + object.threatTypes = []; + for (var j = 0; j < message.threatTypes.length; ++j) + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this ThreatUri to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri + * @instance + * @returns {Object.} JSON object + */ + ThreatUri.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThreatUri; + })(); + + return SearchUrisResponse; + })(); + + v1beta1.SearchHashesRequest = (function() { + + /** + * Properties of a SearchHashesRequest. + * @memberof google.cloud.webrisk.v1beta1 + * @interface ISearchHashesRequest + * @property {Uint8Array|null} [hashPrefix] SearchHashesRequest hashPrefix + * @property {Array.|null} [threatTypes] SearchHashesRequest threatTypes + */ + + /** + * Constructs a new SearchHashesRequest. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a SearchHashesRequest. + * @implements ISearchHashesRequest + * @constructor + * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest=} [properties] Properties to set + */ + function SearchHashesRequest(properties) { + this.threatTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchHashesRequest hashPrefix. + * @member {Uint8Array} hashPrefix + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @instance + */ + SearchHashesRequest.prototype.hashPrefix = $util.newBuffer([]); + + /** + * SearchHashesRequest threatTypes. + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @instance + */ + SearchHashesRequest.prototype.threatTypes = $util.emptyArray; + + /** + * Creates a new SearchHashesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest instance + */ + SearchHashesRequest.create = function create(properties) { + return new SearchHashesRequest(properties); + }; + + /** + * Encodes the specified SearchHashesRequest message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} message SearchHashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchHashesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hashPrefix != null && message.hasOwnProperty("hashPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hashPrefix); + if (message.threatTypes != null && message.threatTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.threatTypes.length; ++i) + writer.int32(message.threatTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SearchHashesRequest message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchHashesRequest} message SearchHashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchHashesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchHashesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchHashesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchHashesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hashPrefix = reader.bytes(); + break; + case 2: + if (!(message.threatTypes && message.threatTypes.length)) + message.threatTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.threatTypes.push(reader.int32()); + } else + message.threatTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchHashesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchHashesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchHashesRequest message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchHashesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hashPrefix != null && message.hasOwnProperty("hashPrefix")) + if (!(message.hashPrefix && typeof message.hashPrefix.length === "number" || $util.isString(message.hashPrefix))) + return "hashPrefix: buffer expected"; + if (message.threatTypes != null && message.hasOwnProperty("threatTypes")) { + if (!Array.isArray(message.threatTypes)) + return "threatTypes: array expected"; + for (var i = 0; i < message.threatTypes.length; ++i) + switch (message.threatTypes[i]) { + default: + return "threatTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a SearchHashesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.SearchHashesRequest} SearchHashesRequest + */ + SearchHashesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchHashesRequest) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.SearchHashesRequest(); + if (object.hashPrefix != null) + if (typeof object.hashPrefix === "string") + $util.base64.decode(object.hashPrefix, message.hashPrefix = $util.newBuffer($util.base64.length(object.hashPrefix)), 0); + else if (object.hashPrefix.length) + message.hashPrefix = object.hashPrefix; + if (object.threatTypes) { + if (!Array.isArray(object.threatTypes)) + throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesRequest.threatTypes: array expected"); + message.threatTypes = []; + for (var i = 0; i < object.threatTypes.length; ++i) + switch (object.threatTypes[i]) { + default: + case "THREAT_TYPE_UNSPECIFIED": + case 0: + message.threatTypes[i] = 0; + break; + case "MALWARE": + case 1: + message.threatTypes[i] = 1; + break; + case "SOCIAL_ENGINEERING": + case 2: + message.threatTypes[i] = 2; + break; + case "UNWANTED_SOFTWARE": + case 3: + message.threatTypes[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SearchHashesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @static + * @param {google.cloud.webrisk.v1beta1.SearchHashesRequest} message SearchHashesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchHashesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.threatTypes = []; + if (options.defaults) + if (options.bytes === String) + object.hashPrefix = ""; + else { + object.hashPrefix = []; + if (options.bytes !== Array) + object.hashPrefix = $util.newBuffer(object.hashPrefix); + } + if (message.hashPrefix != null && message.hasOwnProperty("hashPrefix")) + object.hashPrefix = options.bytes === String ? $util.base64.encode(message.hashPrefix, 0, message.hashPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashPrefix) : message.hashPrefix; + if (message.threatTypes && message.threatTypes.length) { + object.threatTypes = []; + for (var j = 0; j < message.threatTypes.length; ++j) + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + } + return object; + }; + + /** + * Converts this SearchHashesRequest to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.SearchHashesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchHashesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchHashesRequest; + })(); + + v1beta1.SearchHashesResponse = (function() { + + /** + * Properties of a SearchHashesResponse. + * @memberof google.cloud.webrisk.v1beta1 + * @interface ISearchHashesResponse + * @property {Array.|null} [threats] SearchHashesResponse threats + * @property {google.protobuf.ITimestamp|null} [negativeExpireTime] SearchHashesResponse negativeExpireTime + */ + + /** + * Constructs a new SearchHashesResponse. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a SearchHashesResponse. + * @implements ISearchHashesResponse + * @constructor + * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse=} [properties] Properties to set + */ + function SearchHashesResponse(properties) { + this.threats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchHashesResponse threats. + * @member {Array.} threats + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @instance + */ + SearchHashesResponse.prototype.threats = $util.emptyArray; + + /** + * SearchHashesResponse negativeExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} negativeExpireTime + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @instance + */ + SearchHashesResponse.prototype.negativeExpireTime = null; + + /** + * Creates a new SearchHashesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse instance + */ + SearchHashesResponse.create = function create(properties) { + return new SearchHashesResponse(properties); + }; + + /** + * Encodes the specified SearchHashesResponse message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse} message SearchHashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchHashesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threats != null && message.threats.length) + for (var i = 0; i < message.threats.length; ++i) + $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.encode(message.threats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.negativeExpireTime != null && message.hasOwnProperty("negativeExpireTime")) + $root.google.protobuf.Timestamp.encode(message.negativeExpireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchHashesResponse message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {google.cloud.webrisk.v1beta1.ISearchHashesResponse} message SearchHashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchHashesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchHashesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchHashesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.threats && message.threats.length)) + message.threats = []; + message.threats.push($root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.decode(reader, reader.uint32())); + break; + case 2: + message.negativeExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchHashesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchHashesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchHashesResponse message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchHashesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threats != null && message.hasOwnProperty("threats")) { + if (!Array.isArray(message.threats)) + return "threats: array expected"; + for (var i = 0; i < message.threats.length; ++i) { + var error = $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.verify(message.threats[i]); + if (error) + return "threats." + error; + } + } + if (message.negativeExpireTime != null && message.hasOwnProperty("negativeExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.negativeExpireTime); + if (error) + return "negativeExpireTime." + error; + } + return null; + }; + + /** + * Creates a SearchHashesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse} SearchHashesResponse + */ + SearchHashesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchHashesResponse) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse(); + if (object.threats) { + if (!Array.isArray(object.threats)) + throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.threats: array expected"); + message.threats = []; + for (var i = 0; i < object.threats.length; ++i) { + if (typeof object.threats[i] !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.threats: object expected"); + message.threats[i] = $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.fromObject(object.threats[i]); + } + } + if (object.negativeExpireTime != null) { + if (typeof object.negativeExpireTime !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.negativeExpireTime: object expected"); + message.negativeExpireTime = $root.google.protobuf.Timestamp.fromObject(object.negativeExpireTime); + } + return message; + }; + + /** + * Creates a plain object from a SearchHashesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @static + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse} message SearchHashesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchHashesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.threats = []; + if (options.defaults) + object.negativeExpireTime = null; + if (message.threats && message.threats.length) { + object.threats = []; + for (var j = 0; j < message.threats.length; ++j) + object.threats[j] = $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.toObject(message.threats[j], options); + } + if (message.negativeExpireTime != null && message.hasOwnProperty("negativeExpireTime")) + object.negativeExpireTime = $root.google.protobuf.Timestamp.toObject(message.negativeExpireTime, options); + return object; + }; + + /** + * Converts this SearchHashesResponse to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchHashesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SearchHashesResponse.ThreatHash = (function() { + + /** + * Properties of a ThreatHash. + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @interface IThreatHash + * @property {Array.|null} [threatTypes] ThreatHash threatTypes + * @property {Uint8Array|null} [hash] ThreatHash hash + * @property {google.protobuf.ITimestamp|null} [expireTime] ThreatHash expireTime + */ + + /** + * Constructs a new ThreatHash. + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse + * @classdesc Represents a ThreatHash. + * @implements IThreatHash + * @constructor + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash=} [properties] Properties to set + */ + function ThreatHash(properties) { + this.threatTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreatHash threatTypes. + * @member {Array.} threatTypes + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @instance + */ + ThreatHash.prototype.threatTypes = $util.emptyArray; + + /** + * ThreatHash hash. + * @member {Uint8Array} hash + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @instance + */ + ThreatHash.prototype.hash = $util.newBuffer([]); + + /** + * ThreatHash expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @instance + */ + ThreatHash.prototype.expireTime = null; + + /** + * Creates a new ThreatHash instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash instance + */ + ThreatHash.create = function create(properties) { + return new ThreatHash(properties); + }; + + /** + * Encodes the specified ThreatHash message. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash} message ThreatHash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatHash.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threatTypes != null && message.threatTypes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.threatTypes.length; ++i) + writer.int32(message.threatTypes[i]); + writer.ldelim(); + } + if (message.hash != null && message.hasOwnProperty("hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ThreatHash message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.IThreatHash} message ThreatHash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatHash.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreatHash message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatHash.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.threatTypes && message.threatTypes.length)) + message.threatTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.threatTypes.push(reader.int32()); + } else + message.threatTypes.push(reader.int32()); + break; + case 2: + message.hash = reader.bytes(); + break; + case 3: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreatHash message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatHash.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreatHash message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreatHash.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threatTypes != null && message.hasOwnProperty("threatTypes")) { + if (!Array.isArray(message.threatTypes)) + return "threatTypes: array expected"; + for (var i = 0; i < message.threatTypes.length; ++i) + switch (message.threatTypes[i]) { + default: + return "threatTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a ThreatHash message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} ThreatHash + */ + ThreatHash.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash(); + if (object.threatTypes) { + if (!Array.isArray(object.threatTypes)) + throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.threatTypes: array expected"); + message.threatTypes = []; + for (var i = 0; i < object.threatTypes.length; ++i) + switch (object.threatTypes[i]) { + default: + case "THREAT_TYPE_UNSPECIFIED": + case 0: + message.threatTypes[i] = 0; + break; + case "MALWARE": + case 1: + message.threatTypes[i] = 1; + break; + case "SOCIAL_ENGINEERING": + case 2: + message.threatTypes[i] = 2; + break; + case "UNWANTED_SOFTWARE": + case 3: + message.threatTypes[i] = 3; + break; + } + } + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a ThreatHash message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @static + * @param {google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash} message ThreatHash + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThreatHash.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.threatTypes = []; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.expireTime = null; + } + if (message.threatTypes && message.threatTypes.length) { + object.threatTypes = []; + for (var j = 0; j < message.threatTypes.length; ++j) + object.threatTypes[j] = options.enums === String ? $root.google.cloud.webrisk.v1beta1.ThreatType[message.threatTypes[j]] : message.threatTypes[j]; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this ThreatHash to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash + * @instance + * @returns {Object.} JSON object + */ + ThreatHash.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThreatHash; + })(); + + return SearchHashesResponse; + })(); + + v1beta1.ThreatEntryAdditions = (function() { + + /** + * Properties of a ThreatEntryAdditions. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IThreatEntryAdditions + * @property {Array.|null} [rawHashes] ThreatEntryAdditions rawHashes + * @property {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null} [riceHashes] ThreatEntryAdditions riceHashes + */ + + /** + * Constructs a new ThreatEntryAdditions. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a ThreatEntryAdditions. + * @implements IThreatEntryAdditions + * @constructor + * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions=} [properties] Properties to set + */ + function ThreatEntryAdditions(properties) { + this.rawHashes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreatEntryAdditions rawHashes. + * @member {Array.} rawHashes + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @instance + */ + ThreatEntryAdditions.prototype.rawHashes = $util.emptyArray; + + /** + * ThreatEntryAdditions riceHashes. + * @member {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null|undefined} riceHashes + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @instance + */ + ThreatEntryAdditions.prototype.riceHashes = null; + + /** + * Creates a new ThreatEntryAdditions instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions instance + */ + ThreatEntryAdditions.create = function create(properties) { + return new ThreatEntryAdditions(properties); + }; + + /** + * Encodes the specified ThreatEntryAdditions message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryAdditions.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions} message ThreatEntryAdditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatEntryAdditions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rawHashes != null && message.rawHashes.length) + for (var i = 0; i < message.rawHashes.length; ++i) + $root.google.cloud.webrisk.v1beta1.RawHashes.encode(message.rawHashes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.riceHashes != null && message.hasOwnProperty("riceHashes")) + $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.encode(message.riceHashes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ThreatEntryAdditions message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryAdditions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {google.cloud.webrisk.v1beta1.IThreatEntryAdditions} message ThreatEntryAdditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatEntryAdditions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreatEntryAdditions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatEntryAdditions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rawHashes && message.rawHashes.length)) + message.rawHashes = []; + message.rawHashes.push($root.google.cloud.webrisk.v1beta1.RawHashes.decode(reader, reader.uint32())); + break; + case 2: + message.riceHashes = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreatEntryAdditions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatEntryAdditions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreatEntryAdditions message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreatEntryAdditions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rawHashes != null && message.hasOwnProperty("rawHashes")) { + if (!Array.isArray(message.rawHashes)) + return "rawHashes: array expected"; + for (var i = 0; i < message.rawHashes.length; ++i) { + var error = $root.google.cloud.webrisk.v1beta1.RawHashes.verify(message.rawHashes[i]); + if (error) + return "rawHashes." + error; + } + } + if (message.riceHashes != null && message.hasOwnProperty("riceHashes")) { + var error = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify(message.riceHashes); + if (error) + return "riceHashes." + error; + } + return null; + }; + + /** + * Creates a ThreatEntryAdditions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} ThreatEntryAdditions + */ + ThreatEntryAdditions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryAdditions(); + if (object.rawHashes) { + if (!Array.isArray(object.rawHashes)) + throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryAdditions.rawHashes: array expected"); + message.rawHashes = []; + for (var i = 0; i < object.rawHashes.length; ++i) { + if (typeof object.rawHashes[i] !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryAdditions.rawHashes: object expected"); + message.rawHashes[i] = $root.google.cloud.webrisk.v1beta1.RawHashes.fromObject(object.rawHashes[i]); + } + } + if (object.riceHashes != null) { + if (typeof object.riceHashes !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryAdditions.riceHashes: object expected"); + message.riceHashes = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.fromObject(object.riceHashes); + } + return message; + }; + + /** + * Creates a plain object from a ThreatEntryAdditions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @static + * @param {google.cloud.webrisk.v1beta1.ThreatEntryAdditions} message ThreatEntryAdditions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThreatEntryAdditions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rawHashes = []; + if (options.defaults) + object.riceHashes = null; + if (message.rawHashes && message.rawHashes.length) { + object.rawHashes = []; + for (var j = 0; j < message.rawHashes.length; ++j) + object.rawHashes[j] = $root.google.cloud.webrisk.v1beta1.RawHashes.toObject(message.rawHashes[j], options); + } + if (message.riceHashes != null && message.hasOwnProperty("riceHashes")) + object.riceHashes = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.toObject(message.riceHashes, options); + return object; + }; + + /** + * Converts this ThreatEntryAdditions to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryAdditions + * @instance + * @returns {Object.} JSON object + */ + ThreatEntryAdditions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThreatEntryAdditions; + })(); + + v1beta1.ThreatEntryRemovals = (function() { + + /** + * Properties of a ThreatEntryRemovals. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IThreatEntryRemovals + * @property {google.cloud.webrisk.v1beta1.IRawIndices|null} [rawIndices] ThreatEntryRemovals rawIndices + * @property {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null} [riceIndices] ThreatEntryRemovals riceIndices + */ + + /** + * Constructs a new ThreatEntryRemovals. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a ThreatEntryRemovals. + * @implements IThreatEntryRemovals + * @constructor + * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals=} [properties] Properties to set + */ + function ThreatEntryRemovals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreatEntryRemovals rawIndices. + * @member {google.cloud.webrisk.v1beta1.IRawIndices|null|undefined} rawIndices + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @instance + */ + ThreatEntryRemovals.prototype.rawIndices = null; + + /** + * ThreatEntryRemovals riceIndices. + * @member {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding|null|undefined} riceIndices + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @instance + */ + ThreatEntryRemovals.prototype.riceIndices = null; + + /** + * Creates a new ThreatEntryRemovals instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals instance + */ + ThreatEntryRemovals.create = function create(properties) { + return new ThreatEntryRemovals(properties); + }; + + /** + * Encodes the specified ThreatEntryRemovals message. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryRemovals.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals} message ThreatEntryRemovals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatEntryRemovals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rawIndices != null && message.hasOwnProperty("rawIndices")) + $root.google.cloud.webrisk.v1beta1.RawIndices.encode(message.rawIndices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.riceIndices != null && message.hasOwnProperty("riceIndices")) + $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.encode(message.riceIndices, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ThreatEntryRemovals message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.ThreatEntryRemovals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {google.cloud.webrisk.v1beta1.IThreatEntryRemovals} message ThreatEntryRemovals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatEntryRemovals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreatEntryRemovals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatEntryRemovals.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rawIndices = $root.google.cloud.webrisk.v1beta1.RawIndices.decode(reader, reader.uint32()); + break; + case 2: + message.riceIndices = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreatEntryRemovals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatEntryRemovals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreatEntryRemovals message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreatEntryRemovals.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rawIndices != null && message.hasOwnProperty("rawIndices")) { + var error = $root.google.cloud.webrisk.v1beta1.RawIndices.verify(message.rawIndices); + if (error) + return "rawIndices." + error; + } + if (message.riceIndices != null && message.hasOwnProperty("riceIndices")) { + var error = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify(message.riceIndices); + if (error) + return "riceIndices." + error; + } + return null; + }; + + /** + * Creates a ThreatEntryRemovals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} ThreatEntryRemovals + */ + ThreatEntryRemovals.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.ThreatEntryRemovals(); + if (object.rawIndices != null) { + if (typeof object.rawIndices !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryRemovals.rawIndices: object expected"); + message.rawIndices = $root.google.cloud.webrisk.v1beta1.RawIndices.fromObject(object.rawIndices); + } + if (object.riceIndices != null) { + if (typeof object.riceIndices !== "object") + throw TypeError(".google.cloud.webrisk.v1beta1.ThreatEntryRemovals.riceIndices: object expected"); + message.riceIndices = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.fromObject(object.riceIndices); + } + return message; + }; + + /** + * Creates a plain object from a ThreatEntryRemovals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @static + * @param {google.cloud.webrisk.v1beta1.ThreatEntryRemovals} message ThreatEntryRemovals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThreatEntryRemovals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rawIndices = null; + object.riceIndices = null; + } + if (message.rawIndices != null && message.hasOwnProperty("rawIndices")) + object.rawIndices = $root.google.cloud.webrisk.v1beta1.RawIndices.toObject(message.rawIndices, options); + if (message.riceIndices != null && message.hasOwnProperty("riceIndices")) + object.riceIndices = $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding.toObject(message.riceIndices, options); + return object; + }; + + /** + * Converts this ThreatEntryRemovals to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.ThreatEntryRemovals + * @instance + * @returns {Object.} JSON object + */ + ThreatEntryRemovals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThreatEntryRemovals; + })(); + + /** + * ThreatType enum. + * @name google.cloud.webrisk.v1beta1.ThreatType + * @enum {string} + * @property {number} THREAT_TYPE_UNSPECIFIED=0 THREAT_TYPE_UNSPECIFIED value + * @property {number} MALWARE=1 MALWARE value + * @property {number} SOCIAL_ENGINEERING=2 SOCIAL_ENGINEERING value + * @property {number} UNWANTED_SOFTWARE=3 UNWANTED_SOFTWARE value + */ + v1beta1.ThreatType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THREAT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MALWARE"] = 1; + values[valuesById[2] = "SOCIAL_ENGINEERING"] = 2; + values[valuesById[3] = "UNWANTED_SOFTWARE"] = 3; + return values; + })(); + + /** + * CompressionType enum. + * @name google.cloud.webrisk.v1beta1.CompressionType + * @enum {string} + * @property {number} COMPRESSION_TYPE_UNSPECIFIED=0 COMPRESSION_TYPE_UNSPECIFIED value + * @property {number} RAW=1 RAW value + * @property {number} RICE=2 RICE value + */ + v1beta1.CompressionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPRESSION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RAW"] = 1; + values[valuesById[2] = "RICE"] = 2; + return values; + })(); + + v1beta1.RawIndices = (function() { + + /** + * Properties of a RawIndices. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IRawIndices + * @property {Array.|null} [indices] RawIndices indices + */ + + /** + * Constructs a new RawIndices. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a RawIndices. + * @implements IRawIndices + * @constructor + * @param {google.cloud.webrisk.v1beta1.IRawIndices=} [properties] Properties to set + */ + function RawIndices(properties) { + this.indices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawIndices indices. + * @member {Array.} indices + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @instance + */ + RawIndices.prototype.indices = $util.emptyArray; + + /** + * Creates a new RawIndices instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {google.cloud.webrisk.v1beta1.IRawIndices=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices instance + */ + RawIndices.create = function create(properties) { + return new RawIndices(properties); + }; + + /** + * Encodes the specified RawIndices message. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawIndices.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {google.cloud.webrisk.v1beta1.IRawIndices} message RawIndices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawIndices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indices != null && message.indices.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.indices.length; ++i) + writer.int32(message.indices[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RawIndices message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawIndices.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {google.cloud.webrisk.v1beta1.IRawIndices} message RawIndices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawIndices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawIndices message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawIndices.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.RawIndices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.indices && message.indices.length)) + message.indices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.indices.push(reader.int32()); + } else + message.indices.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawIndices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawIndices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawIndices message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawIndices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indices != null && message.hasOwnProperty("indices")) { + if (!Array.isArray(message.indices)) + return "indices: array expected"; + for (var i = 0; i < message.indices.length; ++i) + if (!$util.isInteger(message.indices[i])) + return "indices: integer[] expected"; + } + return null; + }; + + /** + * Creates a RawIndices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.RawIndices} RawIndices + */ + RawIndices.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.RawIndices) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.RawIndices(); + if (object.indices) { + if (!Array.isArray(object.indices)) + throw TypeError(".google.cloud.webrisk.v1beta1.RawIndices.indices: array expected"); + message.indices = []; + for (var i = 0; i < object.indices.length; ++i) + message.indices[i] = object.indices[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a RawIndices message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @static + * @param {google.cloud.webrisk.v1beta1.RawIndices} message RawIndices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawIndices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indices = []; + if (message.indices && message.indices.length) { + object.indices = []; + for (var j = 0; j < message.indices.length; ++j) + object.indices[j] = message.indices[j]; + } + return object; + }; + + /** + * Converts this RawIndices to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.RawIndices + * @instance + * @returns {Object.} JSON object + */ + RawIndices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RawIndices; + })(); + + v1beta1.RawHashes = (function() { + + /** + * Properties of a RawHashes. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IRawHashes + * @property {number|null} [prefixSize] RawHashes prefixSize + * @property {Uint8Array|null} [rawHashes] RawHashes rawHashes + */ + + /** + * Constructs a new RawHashes. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a RawHashes. + * @implements IRawHashes + * @constructor + * @param {google.cloud.webrisk.v1beta1.IRawHashes=} [properties] Properties to set + */ + function RawHashes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawHashes prefixSize. + * @member {number} prefixSize + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @instance + */ + RawHashes.prototype.prefixSize = 0; + + /** + * RawHashes rawHashes. + * @member {Uint8Array} rawHashes + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @instance + */ + RawHashes.prototype.rawHashes = $util.newBuffer([]); + + /** + * Creates a new RawHashes instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {google.cloud.webrisk.v1beta1.IRawHashes=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes instance + */ + RawHashes.create = function create(properties) { + return new RawHashes(properties); + }; + + /** + * Encodes the specified RawHashes message. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawHashes.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {google.cloud.webrisk.v1beta1.IRawHashes} message RawHashes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawHashes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prefixSize != null && message.hasOwnProperty("prefixSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.prefixSize); + if (message.rawHashes != null && message.hasOwnProperty("rawHashes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawHashes); + return writer; + }; + + /** + * Encodes the specified RawHashes message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.RawHashes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {google.cloud.webrisk.v1beta1.IRawHashes} message RawHashes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawHashes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawHashes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawHashes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.RawHashes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixSize = reader.int32(); + break; + case 2: + message.rawHashes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawHashes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawHashes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawHashes message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawHashes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prefixSize != null && message.hasOwnProperty("prefixSize")) + if (!$util.isInteger(message.prefixSize)) + return "prefixSize: integer expected"; + if (message.rawHashes != null && message.hasOwnProperty("rawHashes")) + if (!(message.rawHashes && typeof message.rawHashes.length === "number" || $util.isString(message.rawHashes))) + return "rawHashes: buffer expected"; + return null; + }; + + /** + * Creates a RawHashes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.RawHashes} RawHashes + */ + RawHashes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.RawHashes) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.RawHashes(); + if (object.prefixSize != null) + message.prefixSize = object.prefixSize | 0; + if (object.rawHashes != null) + if (typeof object.rawHashes === "string") + $util.base64.decode(object.rawHashes, message.rawHashes = $util.newBuffer($util.base64.length(object.rawHashes)), 0); + else if (object.rawHashes.length) + message.rawHashes = object.rawHashes; + return message; + }; + + /** + * Creates a plain object from a RawHashes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @static + * @param {google.cloud.webrisk.v1beta1.RawHashes} message RawHashes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawHashes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.prefixSize = 0; + if (options.bytes === String) + object.rawHashes = ""; + else { + object.rawHashes = []; + if (options.bytes !== Array) + object.rawHashes = $util.newBuffer(object.rawHashes); + } + } + if (message.prefixSize != null && message.hasOwnProperty("prefixSize")) + object.prefixSize = message.prefixSize; + if (message.rawHashes != null && message.hasOwnProperty("rawHashes")) + object.rawHashes = options.bytes === String ? $util.base64.encode(message.rawHashes, 0, message.rawHashes.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawHashes) : message.rawHashes; + return object; + }; + + /** + * Converts this RawHashes to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.RawHashes + * @instance + * @returns {Object.} JSON object + */ + RawHashes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RawHashes; + })(); + + v1beta1.RiceDeltaEncoding = (function() { + + /** + * Properties of a RiceDeltaEncoding. + * @memberof google.cloud.webrisk.v1beta1 + * @interface IRiceDeltaEncoding + * @property {number|Long|null} [firstValue] RiceDeltaEncoding firstValue + * @property {number|null} [riceParameter] RiceDeltaEncoding riceParameter + * @property {number|null} [entryCount] RiceDeltaEncoding entryCount + * @property {Uint8Array|null} [encodedData] RiceDeltaEncoding encodedData + */ + + /** + * Constructs a new RiceDeltaEncoding. + * @memberof google.cloud.webrisk.v1beta1 + * @classdesc Represents a RiceDeltaEncoding. + * @implements IRiceDeltaEncoding + * @constructor + * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding=} [properties] Properties to set + */ + function RiceDeltaEncoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RiceDeltaEncoding firstValue. + * @member {number|Long} firstValue + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @instance + */ + RiceDeltaEncoding.prototype.firstValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RiceDeltaEncoding riceParameter. + * @member {number} riceParameter + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @instance + */ + RiceDeltaEncoding.prototype.riceParameter = 0; + + /** + * RiceDeltaEncoding entryCount. + * @member {number} entryCount + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @instance + */ + RiceDeltaEncoding.prototype.entryCount = 0; + + /** + * RiceDeltaEncoding encodedData. + * @member {Uint8Array} encodedData + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @instance + */ + RiceDeltaEncoding.prototype.encodedData = $util.newBuffer([]); + + /** + * Creates a new RiceDeltaEncoding instance using the specified properties. + * @function create + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding=} [properties] Properties to set + * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding instance + */ + RiceDeltaEncoding.create = function create(properties) { + return new RiceDeltaEncoding(properties); + }; + + /** + * Encodes the specified RiceDeltaEncoding message. Does not implicitly {@link google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify|verify} messages. + * @function encode + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding} message RiceDeltaEncoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RiceDeltaEncoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstValue != null && message.hasOwnProperty("firstValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.firstValue); + if (message.riceParameter != null && message.hasOwnProperty("riceParameter")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.riceParameter); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.entryCount); + if (message.encodedData != null && message.hasOwnProperty("encodedData")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.encodedData); + return writer; + }; + + /** + * Encodes the specified RiceDeltaEncoding message, length delimited. Does not implicitly {@link google.cloud.webrisk.v1beta1.RiceDeltaEncoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {google.cloud.webrisk.v1beta1.IRiceDeltaEncoding} message RiceDeltaEncoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RiceDeltaEncoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RiceDeltaEncoding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RiceDeltaEncoding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.firstValue = reader.int64(); + break; + case 2: + message.riceParameter = reader.int32(); + break; + case 3: + message.entryCount = reader.int32(); + break; + case 4: + message.encodedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RiceDeltaEncoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RiceDeltaEncoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RiceDeltaEncoding message. + * @function verify + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RiceDeltaEncoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstValue != null && message.hasOwnProperty("firstValue")) + if (!$util.isInteger(message.firstValue) && !(message.firstValue && $util.isInteger(message.firstValue.low) && $util.isInteger(message.firstValue.high))) + return "firstValue: integer|Long expected"; + if (message.riceParameter != null && message.hasOwnProperty("riceParameter")) + if (!$util.isInteger(message.riceParameter)) + return "riceParameter: integer expected"; + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (!$util.isInteger(message.entryCount)) + return "entryCount: integer expected"; + if (message.encodedData != null && message.hasOwnProperty("encodedData")) + if (!(message.encodedData && typeof message.encodedData.length === "number" || $util.isString(message.encodedData))) + return "encodedData: buffer expected"; + return null; + }; + + /** + * Creates a RiceDeltaEncoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} RiceDeltaEncoding + */ + RiceDeltaEncoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding) + return object; + var message = new $root.google.cloud.webrisk.v1beta1.RiceDeltaEncoding(); + if (object.firstValue != null) + if ($util.Long) + (message.firstValue = $util.Long.fromValue(object.firstValue)).unsigned = false; + else if (typeof object.firstValue === "string") + message.firstValue = parseInt(object.firstValue, 10); + else if (typeof object.firstValue === "number") + message.firstValue = object.firstValue; + else if (typeof object.firstValue === "object") + message.firstValue = new $util.LongBits(object.firstValue.low >>> 0, object.firstValue.high >>> 0).toNumber(); + if (object.riceParameter != null) + message.riceParameter = object.riceParameter | 0; + if (object.entryCount != null) + message.entryCount = object.entryCount | 0; + if (object.encodedData != null) + if (typeof object.encodedData === "string") + $util.base64.decode(object.encodedData, message.encodedData = $util.newBuffer($util.base64.length(object.encodedData)), 0); + else if (object.encodedData.length) + message.encodedData = object.encodedData; + return message; + }; + + /** + * Creates a plain object from a RiceDeltaEncoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @static + * @param {google.cloud.webrisk.v1beta1.RiceDeltaEncoding} message RiceDeltaEncoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RiceDeltaEncoding.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.firstValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.firstValue = options.longs === String ? "0" : 0; + object.riceParameter = 0; + object.entryCount = 0; + if (options.bytes === String) + object.encodedData = ""; + else { + object.encodedData = []; + if (options.bytes !== Array) + object.encodedData = $util.newBuffer(object.encodedData); + } + } + if (message.firstValue != null && message.hasOwnProperty("firstValue")) + if (typeof message.firstValue === "number") + object.firstValue = options.longs === String ? String(message.firstValue) : message.firstValue; + else + object.firstValue = options.longs === String ? $util.Long.prototype.toString.call(message.firstValue) : options.longs === Number ? new $util.LongBits(message.firstValue.low >>> 0, message.firstValue.high >>> 0).toNumber() : message.firstValue; + if (message.riceParameter != null && message.hasOwnProperty("riceParameter")) + object.riceParameter = message.riceParameter; + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + object.entryCount = message.entryCount; + if (message.encodedData != null && message.hasOwnProperty("encodedData")) + object.encodedData = options.bytes === String ? $util.base64.encode(message.encodedData, 0, message.encodedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encodedData) : message.encodedData; + return object; + }; + + /** + * Converts this RiceDeltaEncoding to JSON. + * @function toJSON + * @memberof google.cloud.webrisk.v1beta1.RiceDeltaEncoding + * @instance + * @returns {Object.} JSON object + */ + RiceDeltaEncoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RiceDeltaEncoding; + })(); + + return v1beta1; + })(); + + return webrisk; + })(); + + 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 */ - Http.encode = function encode(message, writer) { + 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.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); + 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 Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.kind = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -4155,143 +9241,144 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + CustomHttpPattern.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"; + 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 Http message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.Http} message Http + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + CustomHttpPattern.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 (options.defaults) { + object.kind = ""; + object.path = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + 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 Http to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return CustomHttpPattern; })(); - api.HttpRule = (function() { + /** + * 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 HttpRule. + * Properties of a ResourceDescriptor. * @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 + * @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 + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular */ /** - * Constructs a new HttpRule. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4299,209 +9386,143 @@ } /** - * 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 + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.patch = ""; + ResourceDescriptor.prototype.type = ""; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.custom = null; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.body = ""; + ResourceDescriptor.prototype.nameField = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.responseBody = ""; + ResourceDescriptor.prototype.history = 0; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceDescriptor.prototype.plural = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceDescriptor.prototype.singular = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceDescriptor.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); + 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); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; case 3: - message.put = reader.string(); + message.nameField = reader.string(); break; case 4: - message.post = reader.string(); + message.history = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.plural = 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())); + message.singular = reader.string(); break; default: reader.skipType(tag & 7); @@ -4512,240 +9533,196 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.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; - } + }; + + /** + * 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; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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); + 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.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]); - } + 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; } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.additionalBindings = []; + object.pattern = []; 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"; + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - 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.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.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * 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.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4753,88 +9730,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.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); + 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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -4845,118 +9822,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + 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 CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.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; + return ResourceReference; })(); return api; @@ -9130,6 +14085,7 @@ * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** @@ -9142,6 +14098,7 @@ */ function FileOptions(properties) { this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9316,6 +14273,14 @@ */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** * Creates a new FileOptions instance using the specified properties. * @function create @@ -9383,6 +14348,9 @@ 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.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -9482,6 +14450,11 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -9592,6 +14565,15 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } return null; }; @@ -9669,6 +14651,16 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } return message; }; @@ -9685,8 +14677,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -9754,6 +14748,11 @@ 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.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } return object; }; @@ -9798,6 +14797,7 @@ * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** @@ -9856,6 +14856,14 @@ */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + /** * Creates a new MessageOptions instance using the specified properties. * @function create @@ -9891,6 +14899,8 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -9942,6 +14952,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -9998,6 +15011,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } return null; }; @@ -10031,6 +15049,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } return message; }; @@ -10054,6 +15077,7 @@ object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; + object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; @@ -10068,6 +15092,8 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; @@ -10099,6 +15125,7 @@ * @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 */ /** @@ -10182,6 +15209,14 @@ */ 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 @@ -10227,6 +15262,8 @@ 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; }; @@ -10294,6 +15331,9 @@ } 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; @@ -10384,6 +15424,11 @@ 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; }; @@ -10478,6 +15523,11 @@ 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; }; @@ -10505,6 +15555,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; + object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -10528,6 +15579,8 @@ 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; }; diff --git a/packages/google-cloud-webrisk/protos/protos.json b/packages/google-cloud-webrisk/protos/protos.json index dc1dd911143..5e53e334bab 100644 --- a/packages/google-cloud-webrisk/protos/protos.json +++ b/packages/google-cloud-webrisk/protos/protos.json @@ -6,6 +6,347 @@ "nested": { "webrisk": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.WebRisk.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/webrisk/v1;webrisk", + "java_multiple_files": true, + "java_outer_classname": "WebRiskProto", + "java_package": "com.google.webrisk.v1", + "objc_class_prefix": "GCWR", + "php_namespace": "Google\\Cloud\\WebRisk\\V1" + }, + "nested": { + "WebRiskService": { + "options": { + "(google.api.default_host)": "webrisk.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ComputeThreatListDiff": { + "requestType": "ComputeThreatListDiffRequest", + "responseType": "ComputeThreatListDiffResponse", + "options": { + "(google.api.http).get": "/v1/threatLists:computeDiff", + "(google.api.method_signature)": "threat_type,version_token,constraints" + } + }, + "SearchUris": { + "requestType": "SearchUrisRequest", + "responseType": "SearchUrisResponse", + "options": { + "(google.api.http).get": "/v1/uris:search", + "(google.api.method_signature)": "uri,threat_types" + } + }, + "SearchHashes": { + "requestType": "SearchHashesRequest", + "responseType": "SearchHashesResponse", + "options": { + "(google.api.http).get": "/v1/hashes:search", + "(google.api.method_signature)": "hash_prefix,threat_types" + } + }, + "CreateSubmission": { + "requestType": "CreateSubmissionRequest", + "responseType": "Submission", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/submissions", + "(google.api.http).body": "submission", + "(google.api.method_signature)": "parent,submission" + } + } + } + }, + "ComputeThreatListDiffRequest": { + "fields": { + "threatType": { + "type": "ThreatType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "versionToken": { + "type": "bytes", + "id": 2 + }, + "constraints": { + "type": "Constraints", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Constraints": { + "fields": { + "maxDiffEntries": { + "type": "int32", + "id": 1 + }, + "maxDatabaseEntries": { + "type": "int32", + "id": 2 + }, + "supportedCompressions": { + "rule": "repeated", + "type": "CompressionType", + "id": 3 + } + } + } + } + }, + "ComputeThreatListDiffResponse": { + "fields": { + "responseType": { + "type": "ResponseType", + "id": 4 + }, + "additions": { + "type": "ThreatEntryAdditions", + "id": 5 + }, + "removals": { + "type": "ThreatEntryRemovals", + "id": 6 + }, + "newVersionToken": { + "type": "bytes", + "id": 7 + }, + "checksum": { + "type": "Checksum", + "id": 8 + }, + "recommendedNextDiff": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + }, + "nested": { + "Checksum": { + "fields": { + "sha256": { + "type": "bytes", + "id": 1 + } + } + }, + "ResponseType": { + "values": { + "RESPONSE_TYPE_UNSPECIFIED": 0, + "DIFF": 1, + "RESET": 2 + } + } + } + }, + "SearchUrisRequest": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threatTypes": { + "rule": "repeated", + "type": "ThreatType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SearchUrisResponse": { + "fields": { + "threat": { + "type": "ThreatUri", + "id": 1 + } + }, + "nested": { + "ThreatUri": { + "fields": { + "threatTypes": { + "rule": "repeated", + "type": "ThreatType", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "SearchHashesRequest": { + "fields": { + "hashPrefix": { + "type": "bytes", + "id": 1 + }, + "threatTypes": { + "rule": "repeated", + "type": "ThreatType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SearchHashesResponse": { + "fields": { + "threats": { + "rule": "repeated", + "type": "ThreatHash", + "id": 1 + }, + "negativeExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + }, + "nested": { + "ThreatHash": { + "fields": { + "threatTypes": { + "rule": "repeated", + "type": "ThreatType", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + }, + "ThreatEntryAdditions": { + "fields": { + "rawHashes": { + "rule": "repeated", + "type": "RawHashes", + "id": 1 + }, + "riceHashes": { + "type": "RiceDeltaEncoding", + "id": 2 + } + } + }, + "ThreatEntryRemovals": { + "fields": { + "rawIndices": { + "type": "RawIndices", + "id": 1 + }, + "riceIndices": { + "type": "RiceDeltaEncoding", + "id": 2 + } + } + }, + "ThreatType": { + "values": { + "THREAT_TYPE_UNSPECIFIED": 0, + "MALWARE": 1, + "SOCIAL_ENGINEERING": 2, + "UNWANTED_SOFTWARE": 3 + } + }, + "CompressionType": { + "values": { + "COMPRESSION_TYPE_UNSPECIFIED": 0, + "RAW": 1, + "RICE": 2 + } + }, + "RawIndices": { + "fields": { + "indices": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + }, + "RawHashes": { + "fields": { + "prefixSize": { + "type": "int32", + "id": 1 + }, + "rawHashes": { + "type": "bytes", + "id": 2 + } + } + }, + "RiceDeltaEncoding": { + "fields": { + "firstValue": { + "type": "int64", + "id": 1 + }, + "riceParameter": { + "type": "int32", + "id": 2 + }, + "entryCount": { + "type": "int32", + "id": 3 + }, + "encodedData": { + "type": "bytes", + "id": 4 + } + } + }, + "Submission": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSubmissionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "submission": { + "type": "Submission", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "v1beta1": { "options": { "csharp_namespace": "Google.Cloud.WebRisk.V1Beta1", @@ -316,7 +657,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "FieldBehaviorProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -440,6 +781,72 @@ "INPUT_ONLY": 4, "IMMUTABLE": 5 } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } } } }, diff --git a/packages/google-cloud-webrisk/samples/quickstart.js b/packages/google-cloud-webrisk/samples/quickstart.js index 5feded87372..2e27b57d4b5 100644 --- a/packages/google-cloud-webrisk/samples/quickstart.js +++ b/packages/google-cloud-webrisk/samples/quickstart.js @@ -21,8 +21,8 @@ */ async function quickstart(uri) { // Create the WebRisk client library. - const {WebRiskServiceV1Beta1Client} = require('@google-cloud/web-risk'); - const client = new WebRiskServiceV1Beta1Client(); + const {WebRiskServiceClient} = require('@google-cloud/web-risk'); + const client = new WebRiskServiceClient(); // Create an API request to check for malware, social engineering, // and unwanted software. diff --git a/packages/google-cloud-webrisk/src/index.ts b/packages/google-cloud-webrisk/src/index.ts index 8dfa47049d2..b70dd13ee28 100644 --- a/packages/google-cloud-webrisk/src/index.ts +++ b/packages/google-cloud-webrisk/src/index.ts @@ -17,10 +17,12 @@ // ** All changes to this file may be overwritten. ** import * as v1beta1 from './v1beta1'; +import * as v1 from './v1'; const WebRiskServiceV1Beta1Client = v1beta1.WebRiskServiceV1Beta1Client; -export {v1beta1, WebRiskServiceV1Beta1Client}; +const WebRiskServiceClient = v1.WebRiskServiceClient; +export {v1, v1beta1, WebRiskServiceV1Beta1Client, WebRiskServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export -export default {v1beta1, WebRiskServiceV1Beta1Client}; +export default {v1, v1beta1, WebRiskServiceV1Beta1Client, WebRiskServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-webrisk/src/v1/index.ts b/packages/google-cloud-webrisk/src/v1/index.ts new file mode 100644 index 00000000000..bfc16e0f7f6 --- /dev/null +++ b/packages/google-cloud-webrisk/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {WebRiskServiceClient} from './web_risk_service_client'; diff --git a/packages/google-cloud-webrisk/src/v1/web_risk_service_client.ts b/packages/google-cloud-webrisk/src/v1/web_risk_service_client.ts new file mode 100644 index 00000000000..151686d6c3f --- /dev/null +++ b/packages/google-cloud-webrisk/src/v1/web_risk_service_client.ts @@ -0,0 +1,616 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './web_risk_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Web Risk API defines an interface to detect malicious URLs on your + * website and in client applications. + * @class + * @memberof v1 + */ +export class WebRiskServiceClient { + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + private _innerApiCalls: {[name: string]: Function}; + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + webRiskServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WebRiskServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof WebRiskServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof WebRiskServiceClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.webrisk.v1.WebRiskService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.webRiskServiceStub) { + return this.webRiskServiceStub; + } + + // Put together the "service stub" for + // google.cloud.webrisk.v1.WebRiskService. + this.webRiskServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.webrisk.v1.WebRiskService' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.cloud.webrisk.v1.WebRiskService, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const webRiskServiceStubMethods = [ + 'computeThreatListDiff', + 'searchUris', + 'searchHashes', + 'createSubmission', + ]; + + for (const methodName of webRiskServiceStubMethods) { + const innerCallPromise = this.webRiskServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.webRiskServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'webrisk.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'webrisk.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + computeThreatListDiff( + request: protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffResponse, + ( + | protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest + | undefined + ), + {} | undefined + ] + >; + computeThreatListDiff( + request: protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffResponse, + | protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets the most recent threat list diffs. These diffs should be applied to + * a local database of hashes to keep it up-to-date. If the local database is + * empty or excessively out-of-date, a complete snapshot of the database will + * be returned. This Method only updates a single ThreatList at a time. To + * update multiple ThreatList databases, this method needs to be called once + * for each list. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.webrisk.v1.ThreatType} request.threatType + * Required. The threat list to update. Only a single ThreatType should be specified. + * @param {Buffer} request.versionToken + * The current version token of the client for the requested list (the + * client version that was received from the last successful diff). + * If the client does not have a version token (this is the first time calling + * ComputeThreatListDiff), this may be left empty and a full database + * snapshot will be returned. + * @param {google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints} request.constraints + * Required. The constraints associated with this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ComputeThreatListDiffResponse]{@link google.cloud.webrisk.v1.ComputeThreatListDiffResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + computeThreatListDiff( + request: protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffResponse, + | protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffResponse, + | protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffResponse, + ( + | protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + this.initialize(); + return this._innerApiCalls.computeThreatListDiff( + request, + options, + callback + ); + } + searchUris( + request: protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.ISearchUrisResponse, + protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest | undefined, + {} | undefined + ] + >; + searchUris( + request: protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.webrisk.v1.ISearchUrisResponse, + protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest | undefined, + {} | undefined + > + ): void; + /** + * This method is used to check whether a URI is on a given threatList. + * Multiple threatLists may be searched in a single query. + * The response will list all requested threatLists the URI was found to + * match. If the URI is not found on any of the requested ThreatList an + * empty response will be returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.uri + * Required. The URI to be checked for matches. + * @param {number[]} request.threatTypes + * Required. The ThreatLists to search in. Multiple ThreatLists may be specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SearchUrisResponse]{@link google.cloud.webrisk.v1.SearchUrisResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchUris( + request: protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.webrisk.v1.ISearchUrisResponse, + protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.webrisk.v1.ISearchUrisResponse, + protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.ISearchUrisResponse, + protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + this.initialize(); + return this._innerApiCalls.searchUris(request, options, callback); + } + searchHashes( + request: protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.ISearchHashesResponse, + protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest | undefined, + {} | undefined + ] + >; + searchHashes( + request: protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.webrisk.v1.ISearchHashesResponse, + protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets the full hashes that match the requested hash prefix. + * This is used after a hash prefix is looked up in a threatList + * and there is a match. The client side threatList only holds partial hashes + * so the client must query this method to determine if there is a full + * hash match of a threat. + * + * @param {Object} request + * The request object that will be sent. + * @param {Buffer} request.hashPrefix + * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + * hash. For JSON requests, this field is base64-encoded. + * @param {number[]} request.threatTypes + * Required. The ThreatLists to search in. Multiple ThreatLists may be specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SearchHashesResponse]{@link google.cloud.webrisk.v1.SearchHashesResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchHashes( + request: protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.webrisk.v1.ISearchHashesResponse, + protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.webrisk.v1.ISearchHashesResponse, + protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.ISearchHashesResponse, + protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + this.initialize(); + return this._innerApiCalls.searchHashes(request, options, callback); + } + createSubmission( + request: protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.ISubmission, + protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest | undefined, + {} | undefined + ] + >; + createSubmission( + request: protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.webrisk.v1.ISubmission, + protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a Submission of a URI suspected of containing phishing content to + * be reviewed. If the result verifies the existence of malicious phishing + * content, the site will be added to the [Google's Social Engineering + * lists](https://support.google.com/webmasters/answer/6350487/) in order to + * protect users that could get exposed to this threat in the future. Only + * projects with CREATE_SUBMISSION_USERS visibility can use this method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that is making the submission. This string is in + * the format "projects/{project_number}". + * @param {google.cloud.webrisk.v1.Submission} request.submission + * Required. The submission that contains the content of the phishing report. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Submission]{@link google.cloud.webrisk.v1.Submission}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createSubmission( + request: protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.webrisk.v1.ISubmission, + | protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.webrisk.v1.ISubmission, + protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.webrisk.v1.ISubmission, + protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.createSubmission(request, options, callback); + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.webRiskServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-webrisk/src/v1/web_risk_service_client_config.json b/packages/google-cloud-webrisk/src/v1/web_risk_service_client_config.json new file mode 100644 index 00000000000..0400a213177 --- /dev/null +++ b/packages/google-cloud-webrisk/src/v1/web_risk_service_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.webrisk.v1.WebRiskService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ComputeThreatListDiff": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchUris": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchHashes": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateSubmission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-webrisk/src/v1/web_risk_service_proto_list.json b/packages/google-cloud-webrisk/src/v1/web_risk_service_proto_list.json new file mode 100644 index 00000000000..beac97653c6 --- /dev/null +++ b/packages/google-cloud-webrisk/src/v1/web_risk_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/webrisk/v1/webrisk.proto" +] diff --git a/packages/google-cloud-webrisk/src/v1beta1/index.ts b/packages/google-cloud-webrisk/src/v1beta1/index.ts index efd0e25a420..a6779543c98 100644 --- a/packages/google-cloud-webrisk/src/v1beta1/index.ts +++ b/packages/google-cloud-webrisk/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-webrisk/src/v1beta1/web_risk_service_v1_beta1_client.ts b/packages/google-cloud-webrisk/src/v1beta1/web_risk_service_v1_beta1_client.ts index 92803c92907..f7755c51efa 100644 --- a/packages/google-cloud-webrisk/src/v1beta1/web_risk_service_v1_beta1_client.ts +++ b/packages/google-cloud-webrisk/src/v1beta1/web_risk_service_v1_beta1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,7 +38,12 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class WebRiskServiceV1Beta1Client { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; @@ -201,7 +206,8 @@ export class WebRiskServiceV1Beta1Client { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-webrisk/synth.metadata b/packages/google-cloud-webrisk/synth.metadata index 0be95da8428..1d91ea28639 100644 --- a/packages/google-cloud-webrisk/synth.metadata +++ b/packages/google-cloud-webrisk/synth.metadata @@ -1,24 +1,26 @@ { - "updateTime": "2020-03-05T23:20:00.119308Z", + "updateTime": "2020-03-24T02:00:44.697546Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "sha": "078f222366ed344509a48f2f084944ef61476613", + "internalRef": "302529186", + "log": "078f222366ed344509a48f2f084944ef61476613\nFix containeranalysis v1beta1 assembly target name\n\nPiperOrigin-RevId: 302529186\n\n0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" } } ], "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "webrisk", + "apiVersion": "v1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, { "client": { "source": "googleapis", diff --git a/packages/google-cloud-webrisk/synth.py b/packages/google-cloud-webrisk/synth.py index 8de6581fe9d..7d8c4e80a69 100644 --- a/packages/google-cloud-webrisk/synth.py +++ b/packages/google-cloud-webrisk/synth.py @@ -22,7 +22,7 @@ # run the gapic generator gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1'] +versions = ['v1', 'v1beta1'] for version in versions: library = gapic.typescript_library( 'webrisk', diff --git a/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.js b/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.js index 0970a710fca..275d3f0fddf 100644 --- a/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.ts index 48dc25b3223..fcb659204dd 100644 --- a/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-webrisk/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-webrisk/system-test/install.ts b/packages/google-cloud-webrisk/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-webrisk/system-test/install.ts +++ b/packages/google-cloud-webrisk/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-webrisk/test/gapic-web_risk_service-v1.ts b/packages/google-cloud-webrisk/test/gapic-web_risk_service-v1.ts new file mode 100644 index 00000000000..375144bdb00 --- /dev/null +++ b/packages/google-cloud-webrisk/test/gapic-web_risk_service-v1.ts @@ -0,0 +1,304 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const webriskserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1.WebRiskServiceClient', () => { + it('has servicePath', () => { + const servicePath = + webriskserviceModule.v1.WebRiskServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + webriskserviceModule.v1.WebRiskServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = webriskserviceModule.v1.WebRiskServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new webriskserviceModule.v1.WebRiskServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + fallback: true, + }); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webRiskServiceStub, undefined); + await client.initialize(); + assert(client.webRiskServiceStub); + }); + it('has close method', () => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + describe('computeThreatListDiff', () => { + it('invokes computeThreatListDiff without error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.computeThreatListDiff = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.computeThreatListDiff(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes computeThreatListDiff with error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.IComputeThreatListDiffRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.computeThreatListDiff = mockSimpleGrpcMethod( + request, + null, + error + ); + client.computeThreatListDiff(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('searchUris', () => { + it('invokes searchUris without error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.searchUris = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.searchUris(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes searchUris with error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.ISearchUrisRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.searchUris = mockSimpleGrpcMethod( + request, + null, + error + ); + client.searchUris(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('searchHashes', () => { + it('invokes searchHashes without error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.searchHashes = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.searchHashes(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes searchHashes with error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.ISearchHashesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.searchHashes = mockSimpleGrpcMethod( + request, + null, + error + ); + client.searchHashes(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createSubmission', () => { + it('invokes createSubmission without error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSubmission = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createSubmission(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createSubmission with error', done => { + const client = new webriskserviceModule.v1.WebRiskServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.webrisk.v1.ICreateSubmissionRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSubmission = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createSubmission(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); +}); diff --git a/packages/google-cloud-webrisk/test/gapic-web_risk_service_v1_beta1-v1beta1.ts b/packages/google-cloud-webrisk/test/gapic-web_risk_service_v1_beta1-v1beta1.ts index e1cd0761e7e..b3100c010a4 100644 --- a/packages/google-cloud-webrisk/test/gapic-web_risk_service_v1_beta1-v1beta1.ts +++ b/packages/google-cloud-webrisk/test/gapic-web_risk_service_v1_beta1-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-webrisk/webpack.config.js b/packages/google-cloud-webrisk/webpack.config.js index 1a92095dab3..0a18e3549a1 100644 --- a/packages/google-cloud-webrisk/webpack.config.js +++ b/packages/google-cloud-webrisk/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.