From 29271ef5f34a92e6abf6b3632124b16e04f22461 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Tue, 22 Jun 2021 18:11:05 +0000 Subject: [PATCH 1/9] Add protos types for GAPIC client --- .../google/firebase/fcm/v1/fcm_service.proto | 559 ++ src/messaging/protos/protos.d.ts | 6592 +++++++++++++++++ src/messaging/protos/protos.json | 1641 ++++ 3 files changed, 8792 insertions(+) create mode 100644 src/messaging/protos/google/firebase/fcm/v1/fcm_service.proto create mode 100644 src/messaging/protos/protos.d.ts create mode 100644 src/messaging/protos/protos.json diff --git a/src/messaging/protos/google/firebase/fcm/v1/fcm_service.proto b/src/messaging/protos/google/firebase/fcm/v1/fcm_service.proto new file mode 100644 index 0000000000..cecf31e8b5 --- /dev/null +++ b/src/messaging/protos/google/firebase/fcm/v1/fcm_service.proto @@ -0,0 +1,559 @@ +// Copyright 2021 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.firebase.fcm.v1; + +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/color.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/firebase/fcm/v1;fcm"; +option java_multiple_files = true; +option java_outer_classname = "FcmServiceProto"; +option java_package = "com.google.firebase.fcm.v1"; + +// Firebase Cloud Messaging service (FCM) to target cross-platform messaging. +service FcmService { + option (google.api.default_host) = "fcm.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Send a message to specified target (a registration token, topic + // or condition). + rpc SendMessage(SendMessageRequest) returns (Message) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/messages:send" + body: "*" + }; + } +} + +// Request to send a message to specified target. +message SendMessageRequest { + // Required. It contains the Firebase project id (i.e. the unique identifier + // for your Firebase project), in the format of `projects/{project_id}`. + // For legacy support, the numeric project number with no padding is also + // supported in the format of `projects/{project_number}`. + string parent = 1; + + // Flag for testing the request without actually delivering the message. + bool validate_only = 2; + + // Required. Message to send. + Message message = 3; +} + +// Message to send by Firebase Cloud Messaging Service. +message Message { + // Output Only. The identifier of the message sent, in the format of + // `projects/*/messages/{message_id}`. + string name = 1; + + // Required. Input only. Target to send a message to. + oneof target { + // Registration token to send a message to. + string token = 2; + + // Topic name to send a message to, e.g. "weather". + // Note: "/topics/" prefix should not be provided. + string topic = 3; + + // Condition to send a message to, + // e.g. "'foo' in topics && 'bar' in topics". + string condition = 4; + } + + // Input only. Arbitrary key/value payload, which must be UTF-8 + // encoded. The key should not be a reserved + // word ("from", "message_type", or any word starting with "google" or "gcm"). + // When sending payloads containing only data fields to iOS devices, + // only normal priority (`"apns-priority": "5"`) is allowed in + // [`ApnsConfig`](/docs/reference/fcm/rest/v1/projects.messages#apnsconfig). + map data = 11; + + // Input only. Basic notification template to use across all platforms. + Notification notification = 12; + + // Input only. Android specific options for messages sent through + // [FCM connection server](https://goo.gl/4GLdUl). + AndroidConfig android = 13; + + // Input only. [Webpush protocol](https://tools.ietf.org/html/rfc8030) + // options. + WebpushConfig webpush = 14; + + // Input only. [Apple Push Notification Service](https://goo.gl/MXRTPa) + // specific options. + ApnsConfig apns = 15; + + // Input only. Template for FCM SDK feature options to use across all + // platforms. + FcmOptions fcm_options = 16; +} + +// Basic notification template to use across all platforms. +message Notification { + // The notification's title. + string title = 1; + + // The notification's body text. + string body = 2; + + // Contains the URL of an image that is going to be downloaded on the device + // and displayed in a notification. + // JPEG, PNG, BMP have full support across platforms. Animated GIF and video + // only work on iOS. WebP and HEIF have varying levels of support across + // platforms and platform versions. + // Android has 1MB image size limit. + // Quota usage and implications/costs for hosting image on Firebase Storage: + // https://firebase.google.com/pricing + string image = 3; +} + +// Android specific options for messages sent through +// [FCM connection server](https://goo.gl/4GLdUl). +message AndroidConfig { + // Priority of a message to send to Android devices. + // Note this priority is an FCM concept that controls when the message is + // delivered. See [FCM + // guides](https://firebase.google.com/docs/cloud-messaging/concept-options?authuser=0#setting-the-priority-of-a-message). + // Additionally, you can determine notification display priority on targeted + // Android devices using + // [AndroidNotification.NotificationPriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidnotification). + enum AndroidMessagePriority { + // Default priority for data messages. Normal priority messages won't open + // network connections on a sleeping device, and their delivery may be + // delayed to conserve the battery. For less time-sensitive messages, such + // as notifications of new email or other data to sync, choose normal + // delivery priority. + NORMAL = 0; + + // Default priority for notification messages. FCM attempts to deliver high + // priority messages immediately, allowing the FCM service to wake a + // sleeping device when possible and open a network connection to your app + // server. Apps with instant messaging, chat, or voice call alerts, for + // example, generally need to open a network connection and make sure FCM + // delivers the message to the device without delay. Set high priority if + // the message is time-critical and requires the user's immediate + // interaction, but beware that setting your messages to high priority + // contributes more to battery drain compared with normal priority messages. + HIGH = 1; + } + + // An identifier of a group of messages that can be collapsed, so that only + // the last message gets sent when delivery can be resumed. A maximum of 4 + // different collapse keys is allowed at any given time. + string collapse_key = 1; + + // Message priority. Can take "normal" and "high" values. + // For more information, see [Setting the priority of a + // message](https://goo.gl/GjONJv). + AndroidMessagePriority priority = 2; + + // How long (in seconds) the message should be kept in FCM storage if the + // device is offline. The maximum time to live supported is 4 weeks, and the + // default value is 4 weeks if not set. Set it to 0 if want to send the + // message immediately. + // In JSON format, the Duration type is encoded as a string rather than an + // object, where the string ends in the suffix "s" (indicating seconds) and + // is preceded by the number of seconds, with nanoseconds expressed as + // fractional seconds. For example, 3 seconds with 0 nanoseconds should be + // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + // be expressed in JSON format as "3.000000001s". The ttl will be rounded down + // to the nearest second. + google.protobuf.Duration ttl = 3; + + // Package name of the application where the registration token must match in + // order to receive the message. + string restricted_package_name = 4; + + // Arbitrary key/value payload. If present, it will override + // [google.firebase.fcm.v1.Message.data] [google.firebase.fcm.v1.Message.data]. + map data = 5; + + // Notification to send to android devices. + AndroidNotification notification = 6; + + // Options for features provided by the FCM SDK for Android. + AndroidFcmOptions fcm_options = 7; + + // If set to true, messages will be allowed to be delivered to the app while + // the device is in direct boot mode. See [Support Direct Boot + // mode](https://developer.android.com/training/articles/direct-boot). + bool direct_boot_ok = 8; +} + +// Notification to send to android devices. +message AndroidNotification { + // Settings to control notification LED. + message LightSettings { + // Required. Set `color` of the LED with + // [google.type.Color](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto). + google.type.Color color = 1; + + // Required. Along with `light_off_duration`, define the blink rate of LED + // flashes. Resolution defined by + // [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) + google.protobuf.Duration light_on_duration = 2; + + // Required. Along with `light_on_duration `, define the blink rate of LED + // flashes. Resolution defined by + // [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) + google.protobuf.Duration light_off_duration = 3; + } + + // Priority levels of a notification. + enum NotificationPriority { + // If priority is unspecified, notification priority is set to + // `PRIORITY_DEFAULT`. + PRIORITY_UNSPECIFIED = 0; + + // Lowest notification priority. Notifications with this `PRIORITY_MIN` + // might not be shown to the user except under special circumstances, + // such as detailed notification logs. + PRIORITY_MIN = 1; + + // Lower notification priority. The UI may choose to show the notifications + // smaller, or at a different position in the list, compared with + // notifications with `PRIORITY_DEFAULT`. + PRIORITY_LOW = 2; + + // Default notification priority. If the application does not prioritize its + // own notifications, use this value for all notifications. + PRIORITY_DEFAULT = 3; + + // Higher notification priority. Use this for more important notifications + // or alerts. The UI may choose to show these notifications larger, or at a + // different position in the notification lists, compared with notifications + // with `PRIORITY_DEFAULT`. + PRIORITY_HIGH = 4; + + // Highest notification priority. Use this for the application's most + // important items that require the user's prompt attention or input. + PRIORITY_MAX = 5; + } + + // Different visibility levels of a notification. + enum Visibility { + // If unspecified, default to `Visibility.PRIVATE`. + VISIBILITY_UNSPECIFIED = 0; + + // Show this notification on all lockscreens, but conceal sensitive or + // private information on secure lockscreens. + PRIVATE = 1; + + // Show this notification in its entirety on all lockscreens. + PUBLIC = 2; + + // Do not reveal any part of this notification on a secure lockscreen. + SECRET = 3; + } + + // The notification's title. If present, it will override + // [google.firebase.fcm.v1.Notification.title] [google.firebase.fcm.v1.Notification.title]. + string title = 1; + + // The notification's body text. If present, it will override + // [google.firebase.fcm.v1.Notification.body] [google.firebase.fcm.v1.Notification.body]. + string body = 2; + + // The notification's icon. + // Sets the notification icon to myicon for drawable resource myicon. + // If you don't send this key in the request, FCM displays the launcher icon + // specified in your app manifest. + string icon = 3; + + // The notification's icon color, expressed in #rrggbb format. + string color = 4; + + // The sound to play when the device receives the notification. + // Supports "default" or the filename of a sound resource bundled in the app. + // Sound files must reside in /res/raw/. + string sound = 5; + + // Identifier used to replace existing notifications in the notification + // drawer. + // If not specified, each request creates a new notification. + // If specified and a notification with the same tag is already being shown, + // the new notification replaces the existing one in the notification drawer. + string tag = 6; + + // The action associated with a user click on the notification. + // If specified, an activity with a matching intent filter is launched when + // a user clicks on the notification. + string click_action = 7; + + // The key to the body string in the app's string resources to use to localize + // the body text to the user's current localization. + // See [String Resources](https://goo.gl/NdFZGI) for more information. + string body_loc_key = 8; + + // Variable string values to be used in place of the format specifiers in + // body_loc_key to use to localize the body text to the user's current + // localization. + // See [Formatting and Styling](https://goo.gl/MalYE3) for more information. + repeated string body_loc_args = 9; + + // The key to the title string in the app's string resources to use to + // localize the title text to the user's current localization. + // See [String Resources](https://goo.gl/NdFZGI) for more information. + string title_loc_key = 10; + + // Variable string values to be used in place of the format specifiers in + // title_loc_key to use to localize the title text to the user's current + // localization. + // See [Formatting and Styling](https://goo.gl/MalYE3) for more information. + repeated string title_loc_args = 11; + + // The [notification's channel + // id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels) + // (new in Android O). The app must create a channel with this channel ID + // before any notification with this channel ID is received. If you don't send + // this channel ID in the request, or if the channel ID provided has not yet + // been created by the app, FCM uses the channel ID specified in the app + // manifest. + string channel_id = 12; + + // Sets the "ticker" text, which is sent to accessibility services. + // Prior to API level 21 (`Lollipop`), sets the text that is displayed in the + // status bar when the notification first arrives. + string ticker = 13; + + // When set to false or unset, the notification is automatically + // dismissed when the user clicks it in the panel. When set to true, the + // notification persists even when the user clicks it. + bool sticky = 14; + + // Set the time that the event in the notification occurred. Notifications in + // the panel are sorted by this time. A point in time is represented using + // [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp). + google.protobuf.Timestamp event_time = 15; + + // Set whether or not this notification is relevant only to the current + // device. Some notifications can be bridged to other devices for remote + // display, such as a Wear OS watch. This hint can be set to recommend this + // notification not be bridged. See [Wear OS + // guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging) + bool local_only = 16; + + // Set the relative priority for this notification. Priority is an indication + // of how much of the user's attention should be consumed by this + // notification. Low-priority notifications may be hidden from the user in + // certain situations, while the user might be interrupted for a + // higher-priority notification. The effect of setting the same priorities may + // differ slightly on different platforms. Note this priority differs from + // `AndroidMessagePriority`. This priority is processed by the client after + // the message has been delivered, whereas + // [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority) + // is an FCM concept that controls when the message is delivered. + NotificationPriority notification_priority = 17; + + // If set to true, use the Android framework's default sound for the + // notification. Default values are specified in + // [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). + bool default_sound = 18; + + // If set to true, use the Android framework's default vibrate pattern for the + // notification. Default values are specified in + // [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). + // If `default_vibrate_timings` is set to true and `vibrate_timings` is also + // set, the default value is used instead of the user-specified + // `vibrate_timings`. + bool default_vibrate_timings = 19; + + // If set to true, use the Android framework's default LED light settings for + // the notification. Default values are specified in + // [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). + // If `default_light_settings` is set to true and `light_settings` is also + // set, the user-specified `light_settings` is used instead of the + // default value. + bool default_light_settings = 20; + + // Set the vibration pattern to use. Pass in an array of + // [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) + // to turn on or off the vibrator. The first value indicates the `Duration` to + // wait before turning the vibrator on. The next value indicates the + // `Duration` to keep the vibrator on. Subsequent values alternate between + // `Duration` to turn the vibrator off and to turn the vibrator on. + // If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`, + // the default value is used instead of the user-specified `vibrate_timings`. + repeated google.protobuf.Duration vibrate_timings = 21; + + // Set the + // [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility) + // of the notification. + Visibility visibility = 22; + + // Sets the number of items this notification represents. May be displayed as + // a badge count for launchers that support badging.See [Notification + // Badge](https://developer.android.com/training/notify-user/badges). + // For example, this might be useful if you're using just one notification to + // represent multiple new messages but you want the count here to represent + // the number of total new messages. + // If zero or unspecified, systems that support badging use the default, which + // is to increment a number displayed on the long-press menu each time a new + // notification arrives. + int32 notification_count = 23; + + // Settings to control the notification's LED blinking rate and color if LED + // is available on the device. The total blinking time is controlled by the + // OS. + LightSettings light_settings = 24; + + // Contains the URL of an image that is going to be displayed in a + // notification. If present, it will override + // [google.firebase.fcm.v1.Notification.image] [google.firebase.fcm.v1.Notification.image]. + string image = 25; +} + +// Options for features provided by the FCM SDK for Android. +message AndroidFcmOptions { + // Label associated with the message's analytics data. + string analytics_label = 1; +} + +// [Webpush protocol](https://tools.ietf.org/html/rfc8030) options. +message WebpushConfig { + // HTTP headers defined in webpush protocol. Refer to + // [Webpush protocol](https://tools.ietf.org/html/rfc8030#section-5) for + // supported headers, e.g. "TTL": "15". + map headers = 1; + + // Arbitrary key/value payload. If present, it will override + // [google.firebase.fcm.v1.Message.data] [google.firebase.fcm.v1.Message.data]. + map data = 2; + + // Web Notification options as a JSON object. Supports Notification instance + // properties as defined in [Web Notification + // API](https://developer.mozilla.org/en-US/docs/Web/API/Notification). If + // present, "title" and "body" fields override + // [google.firebase.fcm.v1.Notification.title] and + // [google.firebase.fcm.v1.Notification.body]. + google.protobuf.Struct notification = 3; + + // Options for features provided by the FCM SDK for Web. + WebpushFcmOptions fcm_options = 4; +} + +// Options for features provided by the FCM SDK for Web. +message WebpushFcmOptions { + // The link to open when the user clicks on the notification. + // For all URL values, HTTPS is required. + string link = 1; + + // Label associated with the message's analytics data. + string analytics_label = 2; +} + +// [Apple Push Notification Service](https://goo.gl/MXRTPa) specific options. +message ApnsConfig { + // HTTP request headers defined in Apple Push Notification Service. Refer to + // [APNs request + // headers](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns) + // for supported headers such as `apns-expiration` and `apns-priority`. + map headers = 1; + + // APNs payload as a JSON object, including both `aps` dictionary and custom + // payload. See [Payload Key + // Reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification). + // If present, it overrides [google.firebase.fcm.v1.Notification.title] [google.firebase.fcm.v1.Notification.title] + // and [google.firebase.fcm.v1.Notification.body] [google.firebase.fcm.v1.Notification.body]. + // + // The backend sets a default value for `apns-expiration` of 30 days + // and a default value for `apns-priority` of 10 if not explicitly set. + google.protobuf.Struct payload = 2; + + // Options for features provided by the FCM SDK for iOS. + ApnsFcmOptions fcm_options = 3; +} + +// Options for features provided by the FCM SDK for iOS. +message ApnsFcmOptions { + // Label associated with the message's analytics data. + string analytics_label = 1; + + // Contains the URL of an image that is going to be displayed in a + // notification. If present, it will override + // [google.firebase.fcm.v1.Notification.image] [google.firebase.fcm.v1.Notification.image]. + string image = 2; +} + +// Platform independent options for features provided by the FCM SDKs. +message FcmOptions { + // Label associated with the message's analytics data. + string analytics_label = 1; +} + +// Message that may be returned in an error response to add details. +message FcmError { + // Error codes for FCM failure conditions. + enum ErrorCode { + // No more information is available about this error. + UNSPECIFIED_ERROR = 0; + + // (HTTP error code = 400) Request parameters were invalid. An extension of + // type [google.rpc.BadRequest] [] is returned to specify which field was + // invalid. + INVALID_ARGUMENT = 1; + + // (HTTP error code = 404) App instance was unregistered from FCM. This + // usually means that the token used is no longer valid and a new one must + // be used. + UNREGISTERED = 2; + + // (HTTP error code = 403) The authenticated sender ID is different from the + // sender ID for the registration token. + SENDER_ID_MISMATCH = 3; + + // (HTTP error code = 429) Sending limit exceeded for the message target. An + // extension of type [google.rpc.QuotaFailure] [] is returned to specify + // which quota got exceeded. + QUOTA_EXCEEDED = 4; + + // (HTTP error code = 401) APNs certificate or auth key was invalid or + // missing. + // Deprecated. Use THIRD_PARTY_AUTH_ERROR. + APNS_AUTH_ERROR = 5 [deprecated = true]; + + // (HTTP error code = 503) The server is overloaded. + UNAVAILABLE = 6; + + // (HTTP error code = 500) An unknown internal error occurred. + INTERNAL = 7; + + // (HTTP error code = 401) APNs certificate or web push auth key was invalid + // or missing. + THIRD_PARTY_AUTH_ERROR = 8; + } + + // Error code specifying why the message failed. + ErrorCode error_code = 1; +} + +// Error details directly from the +// [Apple Push Notification service (APNs)](https://goo.gl/MXRTPa). +message ApnsError { + // Status code in the response from APNs. See + // [APNs status codes](https://goo.gl/BtPJLj) for explanations of possible + // values. + int32 status_code = 1; + + // Failure reason in the response from APNs. See + // [values](https://goo.gl/oFSRPg) for explanations of possible values. + string reason = 2; +} diff --git a/src/messaging/protos/protos.d.ts b/src/messaging/protos/protos.d.ts new file mode 100644 index 0000000000..4383fc4ccb --- /dev/null +++ b/src/messaging/protos/protos.d.ts @@ -0,0 +1,6592 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from 'long'; +import { protobuf as $protobuf } from 'google-gax'; +/** Namespace google. */ +export namespace google { + + /** Namespace firebase. */ + namespace firebase { + + /** Namespace fcm. */ + namespace fcm { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a FcmService */ + class FcmService extends $protobuf.rpc.Service { + + /** + * Constructs a new FcmService 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 FcmService 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): FcmService; + + /** + * Calls SendMessage. + * @param request SendMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message + */ + public sendMessage(request: google.firebase.fcm.v1.ISendMessageRequest, callback: google.firebase.fcm.v1.FcmService.SendMessageCallback): void; + + /** + * Calls SendMessage. + * @param request SendMessageRequest message or plain object + * @returns Promise + */ + public sendMessage(request: google.firebase.fcm.v1.ISendMessageRequest): Promise; + } + + namespace FcmService { + + /** + * Callback as used by {@link google.firebase.fcm.v1.FcmService#sendMessage}. + * @param error Error, if any + * @param [response] Message + */ + type SendMessageCallback = (error: (Error|null), response?: google.firebase.fcm.v1.Message) => void; + } + + /** Properties of a SendMessageRequest. */ + interface ISendMessageRequest { + + /** SendMessageRequest parent */ + parent?: (string|null); + + /** SendMessageRequest validateOnly */ + validateOnly?: (boolean|null); + + /** SendMessageRequest message */ + message?: (google.firebase.fcm.v1.IMessage|null); + } + + /** Represents a SendMessageRequest. */ + class SendMessageRequest implements ISendMessageRequest { + + /** + * Constructs a new SendMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.ISendMessageRequest); + + /** SendMessageRequest parent. */ + public parent: string; + + /** SendMessageRequest validateOnly. */ + public validateOnly: boolean; + + /** SendMessageRequest message. */ + public message?: (google.firebase.fcm.v1.IMessage|null); + + /** + * Creates a new SendMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SendMessageRequest instance + */ + public static create(properties?: google.firebase.fcm.v1.ISendMessageRequest): google.firebase.fcm.v1.SendMessageRequest; + + /** + * Encodes the specified SendMessageRequest message. Does not implicitly {@link google.firebase.fcm.v1.SendMessageRequest.verify|verify} messages. + * @param message SendMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.ISendMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SendMessageRequest message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.SendMessageRequest.verify|verify} messages. + * @param message SendMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.ISendMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SendMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SendMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.SendMessageRequest; + + /** + * Decodes a SendMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SendMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.SendMessageRequest; + + /** + * Verifies a SendMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SendMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SendMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.SendMessageRequest; + + /** + * Creates a plain object from a SendMessageRequest message. Also converts values to other types if specified. + * @param message SendMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.SendMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SendMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message name */ + name?: (string|null); + + /** Message token */ + token?: (string|null); + + /** Message topic */ + topic?: (string|null); + + /** Message condition */ + condition?: (string|null); + + /** Message data */ + data?: ({ [k: string]: string }|null); + + /** Message notification */ + notification?: (google.firebase.fcm.v1.INotification|null); + + /** Message android */ + android?: (google.firebase.fcm.v1.IAndroidConfig|null); + + /** Message webpush */ + webpush?: (google.firebase.fcm.v1.IWebpushConfig|null); + + /** Message apns */ + apns?: (google.firebase.fcm.v1.IApnsConfig|null); + + /** Message fcmOptions */ + fcmOptions?: (google.firebase.fcm.v1.IFcmOptions|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IMessage); + + /** Message name. */ + public name: string; + + /** Message token. */ + public token?: (string|null); + + /** Message topic. */ + public topic?: (string|null); + + /** Message condition. */ + public condition?: (string|null); + + /** Message data. */ + public data: { [k: string]: string }; + + /** Message notification. */ + public notification?: (google.firebase.fcm.v1.INotification|null); + + /** Message android. */ + public android?: (google.firebase.fcm.v1.IAndroidConfig|null); + + /** Message webpush. */ + public webpush?: (google.firebase.fcm.v1.IWebpushConfig|null); + + /** Message apns. */ + public apns?: (google.firebase.fcm.v1.IApnsConfig|null); + + /** Message fcmOptions. */ + public fcmOptions?: (google.firebase.fcm.v1.IFcmOptions|null); + + /** Message target. */ + public target?: ('token'|'topic'|'condition'); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.firebase.fcm.v1.IMessage): google.firebase.fcm.v1.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.firebase.fcm.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Notification. */ + interface INotification { + + /** Notification title */ + title?: (string|null); + + /** Notification body */ + body?: (string|null); + + /** Notification image */ + image?: (string|null); + } + + /** Represents a Notification. */ + class Notification implements INotification { + + /** + * Constructs a new Notification. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.INotification); + + /** Notification title. */ + public title: string; + + /** Notification body. */ + public body: string; + + /** Notification image. */ + public image: string; + + /** + * Creates a new Notification instance using the specified properties. + * @param [properties] Properties to set + * @returns Notification instance + */ + public static create(properties?: google.firebase.fcm.v1.INotification): google.firebase.fcm.v1.Notification; + + /** + * Encodes the specified Notification message. Does not implicitly {@link google.firebase.fcm.v1.Notification.verify|verify} messages. + * @param message Notification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.INotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.Notification.verify|verify} messages. + * @param message Notification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.INotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Notification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.Notification; + + /** + * Decodes a Notification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.Notification; + + /** + * Verifies a Notification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Notification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Notification + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.Notification; + + /** + * Creates a plain object from a Notification message. Also converts values to other types if specified. + * @param message Notification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.Notification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Notification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AndroidConfig. */ + interface IAndroidConfig { + + /** AndroidConfig collapseKey */ + collapseKey?: (string|null); + + /** AndroidConfig priority */ + priority?: (google.firebase.fcm.v1.AndroidConfig.AndroidMessagePriority|keyof typeof google.firebase.fcm.v1.AndroidConfig.AndroidMessagePriority|null); + + /** AndroidConfig ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** AndroidConfig restrictedPackageName */ + restrictedPackageName?: (string|null); + + /** AndroidConfig data */ + data?: ({ [k: string]: string }|null); + + /** AndroidConfig notification */ + notification?: (google.firebase.fcm.v1.IAndroidNotification|null); + + /** AndroidConfig fcmOptions */ + fcmOptions?: (google.firebase.fcm.v1.IAndroidFcmOptions|null); + + /** AndroidConfig directBootOk */ + directBootOk?: (boolean|null); + } + + /** Represents an AndroidConfig. */ + class AndroidConfig implements IAndroidConfig { + + /** + * Constructs a new AndroidConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IAndroidConfig); + + /** AndroidConfig collapseKey. */ + public collapseKey: string; + + /** AndroidConfig priority. */ + public priority: (google.firebase.fcm.v1.AndroidConfig.AndroidMessagePriority|keyof typeof google.firebase.fcm.v1.AndroidConfig.AndroidMessagePriority); + + /** AndroidConfig ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** AndroidConfig restrictedPackageName. */ + public restrictedPackageName: string; + + /** AndroidConfig data. */ + public data: { [k: string]: string }; + + /** AndroidConfig notification. */ + public notification?: (google.firebase.fcm.v1.IAndroidNotification|null); + + /** AndroidConfig fcmOptions. */ + public fcmOptions?: (google.firebase.fcm.v1.IAndroidFcmOptions|null); + + /** AndroidConfig directBootOk. */ + public directBootOk: boolean; + + /** + * Creates a new AndroidConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AndroidConfig instance + */ + public static create(properties?: google.firebase.fcm.v1.IAndroidConfig): google.firebase.fcm.v1.AndroidConfig; + + /** + * Encodes the specified AndroidConfig message. Does not implicitly {@link google.firebase.fcm.v1.AndroidConfig.verify|verify} messages. + * @param message AndroidConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IAndroidConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AndroidConfig message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.AndroidConfig.verify|verify} messages. + * @param message AndroidConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IAndroidConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AndroidConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AndroidConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.AndroidConfig; + + /** + * Decodes an AndroidConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AndroidConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.AndroidConfig; + + /** + * Verifies an AndroidConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AndroidConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AndroidConfig + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.AndroidConfig; + + /** + * Creates a plain object from an AndroidConfig message. Also converts values to other types if specified. + * @param message AndroidConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.AndroidConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AndroidConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AndroidConfig { + + /** AndroidMessagePriority enum. */ + enum AndroidMessagePriority { + NORMAL = 0, + HIGH = 1 + } + } + + /** Properties of an AndroidNotification. */ + interface IAndroidNotification { + + /** AndroidNotification title */ + title?: (string|null); + + /** AndroidNotification body */ + body?: (string|null); + + /** AndroidNotification icon */ + icon?: (string|null); + + /** AndroidNotification color */ + color?: (string|null); + + /** AndroidNotification sound */ + sound?: (string|null); + + /** AndroidNotification tag */ + tag?: (string|null); + + /** AndroidNotification clickAction */ + clickAction?: (string|null); + + /** AndroidNotification bodyLocKey */ + bodyLocKey?: (string|null); + + /** AndroidNotification bodyLocArgs */ + bodyLocArgs?: (string[]|null); + + /** AndroidNotification titleLocKey */ + titleLocKey?: (string|null); + + /** AndroidNotification titleLocArgs */ + titleLocArgs?: (string[]|null); + + /** AndroidNotification channelId */ + channelId?: (string|null); + + /** AndroidNotification ticker */ + ticker?: (string|null); + + /** AndroidNotification sticky */ + sticky?: (boolean|null); + + /** AndroidNotification eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** AndroidNotification localOnly */ + localOnly?: (boolean|null); + + /** AndroidNotification notificationPriority */ + notificationPriority?: (google.firebase.fcm.v1.AndroidNotification.NotificationPriority|keyof typeof google.firebase.fcm.v1.AndroidNotification.NotificationPriority|null); + + /** AndroidNotification defaultSound */ + defaultSound?: (boolean|null); + + /** AndroidNotification defaultVibrateTimings */ + defaultVibrateTimings?: (boolean|null); + + /** AndroidNotification defaultLightSettings */ + defaultLightSettings?: (boolean|null); + + /** AndroidNotification vibrateTimings */ + vibrateTimings?: (google.protobuf.IDuration[]|null); + + /** AndroidNotification visibility */ + visibility?: (google.firebase.fcm.v1.AndroidNotification.Visibility|keyof typeof google.firebase.fcm.v1.AndroidNotification.Visibility|null); + + /** AndroidNotification notificationCount */ + notificationCount?: (number|null); + + /** AndroidNotification lightSettings */ + lightSettings?: (google.firebase.fcm.v1.AndroidNotification.ILightSettings|null); + + /** AndroidNotification image */ + image?: (string|null); + } + + /** Represents an AndroidNotification. */ + class AndroidNotification implements IAndroidNotification { + + /** + * Constructs a new AndroidNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IAndroidNotification); + + /** AndroidNotification title. */ + public title: string; + + /** AndroidNotification body. */ + public body: string; + + /** AndroidNotification icon. */ + public icon: string; + + /** AndroidNotification color. */ + public color: string; + + /** AndroidNotification sound. */ + public sound: string; + + /** AndroidNotification tag. */ + public tag: string; + + /** AndroidNotification clickAction. */ + public clickAction: string; + + /** AndroidNotification bodyLocKey. */ + public bodyLocKey: string; + + /** AndroidNotification bodyLocArgs. */ + public bodyLocArgs: string[]; + + /** AndroidNotification titleLocKey. */ + public titleLocKey: string; + + /** AndroidNotification titleLocArgs. */ + public titleLocArgs: string[]; + + /** AndroidNotification channelId. */ + public channelId: string; + + /** AndroidNotification ticker. */ + public ticker: string; + + /** AndroidNotification sticky. */ + public sticky: boolean; + + /** AndroidNotification eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** AndroidNotification localOnly. */ + public localOnly: boolean; + + /** AndroidNotification notificationPriority. */ + public notificationPriority: (google.firebase.fcm.v1.AndroidNotification.NotificationPriority|keyof typeof google.firebase.fcm.v1.AndroidNotification.NotificationPriority); + + /** AndroidNotification defaultSound. */ + public defaultSound: boolean; + + /** AndroidNotification defaultVibrateTimings. */ + public defaultVibrateTimings: boolean; + + /** AndroidNotification defaultLightSettings. */ + public defaultLightSettings: boolean; + + /** AndroidNotification vibrateTimings. */ + public vibrateTimings: google.protobuf.IDuration[]; + + /** AndroidNotification visibility. */ + public visibility: (google.firebase.fcm.v1.AndroidNotification.Visibility|keyof typeof google.firebase.fcm.v1.AndroidNotification.Visibility); + + /** AndroidNotification notificationCount. */ + public notificationCount: number; + + /** AndroidNotification lightSettings. */ + public lightSettings?: (google.firebase.fcm.v1.AndroidNotification.ILightSettings|null); + + /** AndroidNotification image. */ + public image: string; + + /** + * Creates a new AndroidNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns AndroidNotification instance + */ + public static create(properties?: google.firebase.fcm.v1.IAndroidNotification): google.firebase.fcm.v1.AndroidNotification; + + /** + * Encodes the specified AndroidNotification message. Does not implicitly {@link google.firebase.fcm.v1.AndroidNotification.verify|verify} messages. + * @param message AndroidNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IAndroidNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AndroidNotification message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.AndroidNotification.verify|verify} messages. + * @param message AndroidNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IAndroidNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AndroidNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AndroidNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.AndroidNotification; + + /** + * Decodes an AndroidNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AndroidNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.AndroidNotification; + + /** + * Verifies an AndroidNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AndroidNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AndroidNotification + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.AndroidNotification; + + /** + * Creates a plain object from an AndroidNotification message. Also converts values to other types if specified. + * @param message AndroidNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.AndroidNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AndroidNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AndroidNotification { + + /** Properties of a LightSettings. */ + interface ILightSettings { + + /** LightSettings color */ + color?: (google.type.IColor|null); + + /** LightSettings lightOnDuration */ + lightOnDuration?: (google.protobuf.IDuration|null); + + /** LightSettings lightOffDuration */ + lightOffDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a LightSettings. */ + class LightSettings implements ILightSettings { + + /** + * Constructs a new LightSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.AndroidNotification.ILightSettings); + + /** LightSettings color. */ + public color?: (google.type.IColor|null); + + /** LightSettings lightOnDuration. */ + public lightOnDuration?: (google.protobuf.IDuration|null); + + /** LightSettings lightOffDuration. */ + public lightOffDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new LightSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LightSettings instance + */ + public static create(properties?: google.firebase.fcm.v1.AndroidNotification.ILightSettings): google.firebase.fcm.v1.AndroidNotification.LightSettings; + + /** + * Encodes the specified LightSettings message. Does not implicitly {@link google.firebase.fcm.v1.AndroidNotification.LightSettings.verify|verify} messages. + * @param message LightSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.AndroidNotification.ILightSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LightSettings message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.AndroidNotification.LightSettings.verify|verify} messages. + * @param message LightSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.AndroidNotification.ILightSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LightSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LightSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.AndroidNotification.LightSettings; + + /** + * Decodes a LightSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LightSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.AndroidNotification.LightSettings; + + /** + * Verifies a LightSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LightSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LightSettings + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.AndroidNotification.LightSettings; + + /** + * Creates a plain object from a LightSettings message. Also converts values to other types if specified. + * @param message LightSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.AndroidNotification.LightSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LightSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** NotificationPriority enum. */ + enum NotificationPriority { + PRIORITY_UNSPECIFIED = 0, + PRIORITY_MIN = 1, + PRIORITY_LOW = 2, + PRIORITY_DEFAULT = 3, + PRIORITY_HIGH = 4, + PRIORITY_MAX = 5 + } + + /** Visibility enum. */ + enum Visibility { + VISIBILITY_UNSPECIFIED = 0, + PRIVATE = 1, + PUBLIC = 2, + SECRET = 3 + } + } + + /** Properties of an AndroidFcmOptions. */ + interface IAndroidFcmOptions { + + /** AndroidFcmOptions analyticsLabel */ + analyticsLabel?: (string|null); + } + + /** Represents an AndroidFcmOptions. */ + class AndroidFcmOptions implements IAndroidFcmOptions { + + /** + * Constructs a new AndroidFcmOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IAndroidFcmOptions); + + /** AndroidFcmOptions analyticsLabel. */ + public analyticsLabel: string; + + /** + * Creates a new AndroidFcmOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns AndroidFcmOptions instance + */ + public static create(properties?: google.firebase.fcm.v1.IAndroidFcmOptions): google.firebase.fcm.v1.AndroidFcmOptions; + + /** + * Encodes the specified AndroidFcmOptions message. Does not implicitly {@link google.firebase.fcm.v1.AndroidFcmOptions.verify|verify} messages. + * @param message AndroidFcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IAndroidFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AndroidFcmOptions message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.AndroidFcmOptions.verify|verify} messages. + * @param message AndroidFcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IAndroidFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AndroidFcmOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AndroidFcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.AndroidFcmOptions; + + /** + * Decodes an AndroidFcmOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AndroidFcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.AndroidFcmOptions; + + /** + * Verifies an AndroidFcmOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AndroidFcmOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AndroidFcmOptions + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.AndroidFcmOptions; + + /** + * Creates a plain object from an AndroidFcmOptions message. Also converts values to other types if specified. + * @param message AndroidFcmOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.AndroidFcmOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AndroidFcmOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebpushConfig. */ + interface IWebpushConfig { + + /** WebpushConfig headers */ + headers?: ({ [k: string]: string }|null); + + /** WebpushConfig data */ + data?: ({ [k: string]: string }|null); + + /** WebpushConfig notification */ + notification?: (google.protobuf.IStruct|null); + + /** WebpushConfig fcmOptions */ + fcmOptions?: (google.firebase.fcm.v1.IWebpushFcmOptions|null); + } + + /** Represents a WebpushConfig. */ + class WebpushConfig implements IWebpushConfig { + + /** + * Constructs a new WebpushConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IWebpushConfig); + + /** WebpushConfig headers. */ + public headers: { [k: string]: string }; + + /** WebpushConfig data. */ + public data: { [k: string]: string }; + + /** WebpushConfig notification. */ + public notification?: (google.protobuf.IStruct|null); + + /** WebpushConfig fcmOptions. */ + public fcmOptions?: (google.firebase.fcm.v1.IWebpushFcmOptions|null); + + /** + * Creates a new WebpushConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebpushConfig instance + */ + public static create(properties?: google.firebase.fcm.v1.IWebpushConfig): google.firebase.fcm.v1.WebpushConfig; + + /** + * Encodes the specified WebpushConfig message. Does not implicitly {@link google.firebase.fcm.v1.WebpushConfig.verify|verify} messages. + * @param message WebpushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IWebpushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebpushConfig message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.WebpushConfig.verify|verify} messages. + * @param message WebpushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IWebpushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebpushConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebpushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.WebpushConfig; + + /** + * Decodes a WebpushConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebpushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.WebpushConfig; + + /** + * Verifies a WebpushConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebpushConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebpushConfig + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.WebpushConfig; + + /** + * Creates a plain object from a WebpushConfig message. Also converts values to other types if specified. + * @param message WebpushConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.WebpushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebpushConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebpushFcmOptions. */ + interface IWebpushFcmOptions { + + /** WebpushFcmOptions link */ + link?: (string|null); + + /** WebpushFcmOptions analyticsLabel */ + analyticsLabel?: (string|null); + } + + /** Represents a WebpushFcmOptions. */ + class WebpushFcmOptions implements IWebpushFcmOptions { + + /** + * Constructs a new WebpushFcmOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IWebpushFcmOptions); + + /** WebpushFcmOptions link. */ + public link: string; + + /** WebpushFcmOptions analyticsLabel. */ + public analyticsLabel: string; + + /** + * Creates a new WebpushFcmOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns WebpushFcmOptions instance + */ + public static create(properties?: google.firebase.fcm.v1.IWebpushFcmOptions): google.firebase.fcm.v1.WebpushFcmOptions; + + /** + * Encodes the specified WebpushFcmOptions message. Does not implicitly {@link google.firebase.fcm.v1.WebpushFcmOptions.verify|verify} messages. + * @param message WebpushFcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IWebpushFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebpushFcmOptions message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.WebpushFcmOptions.verify|verify} messages. + * @param message WebpushFcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IWebpushFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebpushFcmOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebpushFcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.WebpushFcmOptions; + + /** + * Decodes a WebpushFcmOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebpushFcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.WebpushFcmOptions; + + /** + * Verifies a WebpushFcmOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebpushFcmOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebpushFcmOptions + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.WebpushFcmOptions; + + /** + * Creates a plain object from a WebpushFcmOptions message. Also converts values to other types if specified. + * @param message WebpushFcmOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.WebpushFcmOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebpushFcmOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ApnsConfig. */ + interface IApnsConfig { + + /** ApnsConfig headers */ + headers?: ({ [k: string]: string }|null); + + /** ApnsConfig payload */ + payload?: (google.protobuf.IStruct|null); + + /** ApnsConfig fcmOptions */ + fcmOptions?: (google.firebase.fcm.v1.IApnsFcmOptions|null); + } + + /** Represents an ApnsConfig. */ + class ApnsConfig implements IApnsConfig { + + /** + * Constructs a new ApnsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IApnsConfig); + + /** ApnsConfig headers. */ + public headers: { [k: string]: string }; + + /** ApnsConfig payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** ApnsConfig fcmOptions. */ + public fcmOptions?: (google.firebase.fcm.v1.IApnsFcmOptions|null); + + /** + * Creates a new ApnsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApnsConfig instance + */ + public static create(properties?: google.firebase.fcm.v1.IApnsConfig): google.firebase.fcm.v1.ApnsConfig; + + /** + * Encodes the specified ApnsConfig message. Does not implicitly {@link google.firebase.fcm.v1.ApnsConfig.verify|verify} messages. + * @param message ApnsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IApnsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApnsConfig message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.ApnsConfig.verify|verify} messages. + * @param message ApnsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IApnsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApnsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApnsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.ApnsConfig; + + /** + * Decodes an ApnsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApnsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.ApnsConfig; + + /** + * Verifies an ApnsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApnsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApnsConfig + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.ApnsConfig; + + /** + * Creates a plain object from an ApnsConfig message. Also converts values to other types if specified. + * @param message ApnsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.ApnsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApnsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ApnsFcmOptions. */ + interface IApnsFcmOptions { + + /** ApnsFcmOptions analyticsLabel */ + analyticsLabel?: (string|null); + + /** ApnsFcmOptions image */ + image?: (string|null); + } + + /** Represents an ApnsFcmOptions. */ + class ApnsFcmOptions implements IApnsFcmOptions { + + /** + * Constructs a new ApnsFcmOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IApnsFcmOptions); + + /** ApnsFcmOptions analyticsLabel. */ + public analyticsLabel: string; + + /** ApnsFcmOptions image. */ + public image: string; + + /** + * Creates a new ApnsFcmOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ApnsFcmOptions instance + */ + public static create(properties?: google.firebase.fcm.v1.IApnsFcmOptions): google.firebase.fcm.v1.ApnsFcmOptions; + + /** + * Encodes the specified ApnsFcmOptions message. Does not implicitly {@link google.firebase.fcm.v1.ApnsFcmOptions.verify|verify} messages. + * @param message ApnsFcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IApnsFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApnsFcmOptions message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.ApnsFcmOptions.verify|verify} messages. + * @param message ApnsFcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IApnsFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApnsFcmOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApnsFcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.ApnsFcmOptions; + + /** + * Decodes an ApnsFcmOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApnsFcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.ApnsFcmOptions; + + /** + * Verifies an ApnsFcmOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApnsFcmOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApnsFcmOptions + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.ApnsFcmOptions; + + /** + * Creates a plain object from an ApnsFcmOptions message. Also converts values to other types if specified. + * @param message ApnsFcmOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.ApnsFcmOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApnsFcmOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FcmOptions. */ + interface IFcmOptions { + + /** FcmOptions analyticsLabel */ + analyticsLabel?: (string|null); + } + + /** Represents a FcmOptions. */ + class FcmOptions implements IFcmOptions { + + /** + * Constructs a new FcmOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IFcmOptions); + + /** FcmOptions analyticsLabel. */ + public analyticsLabel: string; + + /** + * Creates a new FcmOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FcmOptions instance + */ + public static create(properties?: google.firebase.fcm.v1.IFcmOptions): google.firebase.fcm.v1.FcmOptions; + + /** + * Encodes the specified FcmOptions message. Does not implicitly {@link google.firebase.fcm.v1.FcmOptions.verify|verify} messages. + * @param message FcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FcmOptions message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.FcmOptions.verify|verify} messages. + * @param message FcmOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IFcmOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FcmOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.FcmOptions; + + /** + * Decodes a FcmOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FcmOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.FcmOptions; + + /** + * Verifies a FcmOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FcmOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FcmOptions + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.FcmOptions; + + /** + * Creates a plain object from a FcmOptions message. Also converts values to other types if specified. + * @param message FcmOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.FcmOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FcmOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FcmError. */ + interface IFcmError { + + /** FcmError errorCode */ + errorCode?: (google.firebase.fcm.v1.FcmError.ErrorCode|keyof typeof google.firebase.fcm.v1.FcmError.ErrorCode|null); + } + + /** Represents a FcmError. */ + class FcmError implements IFcmError { + + /** + * Constructs a new FcmError. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IFcmError); + + /** FcmError errorCode. */ + public errorCode: (google.firebase.fcm.v1.FcmError.ErrorCode|keyof typeof google.firebase.fcm.v1.FcmError.ErrorCode); + + /** + * Creates a new FcmError instance using the specified properties. + * @param [properties] Properties to set + * @returns FcmError instance + */ + public static create(properties?: google.firebase.fcm.v1.IFcmError): google.firebase.fcm.v1.FcmError; + + /** + * Encodes the specified FcmError message. Does not implicitly {@link google.firebase.fcm.v1.FcmError.verify|verify} messages. + * @param message FcmError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IFcmError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FcmError message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.FcmError.verify|verify} messages. + * @param message FcmError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IFcmError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FcmError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FcmError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.FcmError; + + /** + * Decodes a FcmError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FcmError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.FcmError; + + /** + * Verifies a FcmError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FcmError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FcmError + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.FcmError; + + /** + * Creates a plain object from a FcmError message. Also converts values to other types if specified. + * @param message FcmError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.FcmError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FcmError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FcmError { + + /** ErrorCode enum. */ + enum ErrorCode { + UNSPECIFIED_ERROR = 0, + INVALID_ARGUMENT = 1, + UNREGISTERED = 2, + SENDER_ID_MISMATCH = 3, + QUOTA_EXCEEDED = 4, + APNS_AUTH_ERROR = 5, + UNAVAILABLE = 6, + INTERNAL = 7, + THIRD_PARTY_AUTH_ERROR = 8 + } + } + + /** Properties of an ApnsError. */ + interface IApnsError { + + /** ApnsError statusCode */ + statusCode?: (number|null); + + /** ApnsError reason */ + reason?: (string|null); + } + + /** Represents an ApnsError. */ + class ApnsError implements IApnsError { + + /** + * Constructs a new ApnsError. + * @param [properties] Properties to set + */ + constructor(properties?: google.firebase.fcm.v1.IApnsError); + + /** ApnsError statusCode. */ + public statusCode: number; + + /** ApnsError reason. */ + public reason: string; + + /** + * Creates a new ApnsError instance using the specified properties. + * @param [properties] Properties to set + * @returns ApnsError instance + */ + public static create(properties?: google.firebase.fcm.v1.IApnsError): google.firebase.fcm.v1.ApnsError; + + /** + * Encodes the specified ApnsError message. Does not implicitly {@link google.firebase.fcm.v1.ApnsError.verify|verify} messages. + * @param message ApnsError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firebase.fcm.v1.IApnsError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApnsError message, length delimited. Does not implicitly {@link google.firebase.fcm.v1.ApnsError.verify|verify} messages. + * @param message ApnsError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firebase.fcm.v1.IApnsError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApnsError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApnsError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firebase.fcm.v1.ApnsError; + + /** + * Decodes an ApnsError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApnsError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firebase.fcm.v1.ApnsError; + + /** + * Verifies an ApnsError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApnsError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApnsError + */ + public static fromObject(object: { [k: string]: any }): google.firebase.fcm.v1.ApnsError; + + /** + * Creates a plain object from an ApnsError message. Also converts values to other types if specified. + * @param message ApnsError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firebase.fcm.v1.ApnsError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApnsError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + 'delete'?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ('get'|'put'|'post'|'delete'|'patch'|'custom'); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + 'package'?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + '.google.api.defaultHost'?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + '.google.api.oauthScopes'?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + '.google.api.http'?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + '.google.api.methodSignature'?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ('nullValue'|'numberValue'|'stringValue'|'boolValue'|'structValue'|'listValue'); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Color. */ + interface IColor { + + /** Color red */ + red?: (number|null); + + /** Color green */ + green?: (number|null); + + /** Color blue */ + blue?: (number|null); + + /** Color alpha */ + alpha?: (google.protobuf.IFloatValue|null); + } + + /** Represents a Color. */ + class Color implements IColor { + + /** + * Constructs a new Color. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IColor); + + /** Color red. */ + public red: number; + + /** Color green. */ + public green: number; + + /** Color blue. */ + public blue: number; + + /** Color alpha. */ + public alpha?: (google.protobuf.IFloatValue|null); + + /** + * Creates a new Color instance using the specified properties. + * @param [properties] Properties to set + * @returns Color instance + */ + public static create(properties?: google.type.IColor): google.type.Color; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Color message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Color; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Color; + + /** + * Verifies a Color message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Color + */ + public static fromObject(object: { [k: string]: any }): google.type.Color; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @param message Color + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Color to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/src/messaging/protos/protos.json b/src/messaging/protos/protos.json new file mode 100644 index 0000000000..98ff1ebf32 --- /dev/null +++ b/src/messaging/protos/protos.json @@ -0,0 +1,1641 @@ +{ + "nested": { + "google": { + "nested": { + "firebase": { + "nested": { + "fcm": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/firebase/fcm/v1;fcm", + "java_multiple_files": true, + "java_outer_classname": "FcmServiceProto", + "java_package": "com.google.firebase.fcm.v1" + }, + "nested": { + "FcmService": { + "options": { + "(google.api.default_host)": "fcm.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "SendMessage": { + "requestType": "SendMessageRequest", + "responseType": "Message", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/messages:send", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/messages:send", + "body": "*" + } + } + ] + } + } + }, + "SendMessageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "message": { + "type": "Message", + "id": 3 + } + } + }, + "Message": { + "oneofs": { + "target": { + "oneof": [ + "token", + "topic", + "condition" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "token": { + "type": "string", + "id": 2 + }, + "topic": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "string", + "id": 4 + }, + "data": { + "keyType": "string", + "type": "string", + "id": 11 + }, + "notification": { + "type": "Notification", + "id": 12 + }, + "android": { + "type": "AndroidConfig", + "id": 13 + }, + "webpush": { + "type": "WebpushConfig", + "id": 14 + }, + "apns": { + "type": "ApnsConfig", + "id": 15 + }, + "fcmOptions": { + "type": "FcmOptions", + "id": 16 + } + } + }, + "Notification": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "body": { + "type": "string", + "id": 2 + }, + "image": { + "type": "string", + "id": 3 + } + } + }, + "AndroidConfig": { + "fields": { + "collapseKey": { + "type": "string", + "id": 1 + }, + "priority": { + "type": "AndroidMessagePriority", + "id": 2 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "restrictedPackageName": { + "type": "string", + "id": 4 + }, + "data": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "notification": { + "type": "AndroidNotification", + "id": 6 + }, + "fcmOptions": { + "type": "AndroidFcmOptions", + "id": 7 + }, + "directBootOk": { + "type": "bool", + "id": 8 + } + }, + "nested": { + "AndroidMessagePriority": { + "values": { + "NORMAL": 0, + "HIGH": 1 + } + } + } + }, + "AndroidNotification": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "body": { + "type": "string", + "id": 2 + }, + "icon": { + "type": "string", + "id": 3 + }, + "color": { + "type": "string", + "id": 4 + }, + "sound": { + "type": "string", + "id": 5 + }, + "tag": { + "type": "string", + "id": 6 + }, + "clickAction": { + "type": "string", + "id": 7 + }, + "bodyLocKey": { + "type": "string", + "id": 8 + }, + "bodyLocArgs": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "titleLocKey": { + "type": "string", + "id": 10 + }, + "titleLocArgs": { + "rule": "repeated", + "type": "string", + "id": 11 + }, + "channelId": { + "type": "string", + "id": 12 + }, + "ticker": { + "type": "string", + "id": 13 + }, + "sticky": { + "type": "bool", + "id": 14 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 15 + }, + "localOnly": { + "type": "bool", + "id": 16 + }, + "notificationPriority": { + "type": "NotificationPriority", + "id": 17 + }, + "defaultSound": { + "type": "bool", + "id": 18 + }, + "defaultVibrateTimings": { + "type": "bool", + "id": 19 + }, + "defaultLightSettings": { + "type": "bool", + "id": 20 + }, + "vibrateTimings": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 21 + }, + "visibility": { + "type": "Visibility", + "id": 22 + }, + "notificationCount": { + "type": "int32", + "id": 23 + }, + "lightSettings": { + "type": "LightSettings", + "id": 24 + }, + "image": { + "type": "string", + "id": 25 + } + }, + "nested": { + "LightSettings": { + "fields": { + "color": { + "type": "google.type.Color", + "id": 1 + }, + "lightOnDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "lightOffDuration": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "NotificationPriority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "PRIORITY_MIN": 1, + "PRIORITY_LOW": 2, + "PRIORITY_DEFAULT": 3, + "PRIORITY_HIGH": 4, + "PRIORITY_MAX": 5 + } + }, + "Visibility": { + "values": { + "VISIBILITY_UNSPECIFIED": 0, + "PRIVATE": 1, + "PUBLIC": 2, + "SECRET": 3 + } + } + } + }, + "AndroidFcmOptions": { + "fields": { + "analyticsLabel": { + "type": "string", + "id": 1 + } + } + }, + "WebpushConfig": { + "fields": { + "headers": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "data": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "notification": { + "type": "google.protobuf.Struct", + "id": 3 + }, + "fcmOptions": { + "type": "WebpushFcmOptions", + "id": 4 + } + } + }, + "WebpushFcmOptions": { + "fields": { + "link": { + "type": "string", + "id": 1 + }, + "analyticsLabel": { + "type": "string", + "id": 2 + } + } + }, + "ApnsConfig": { + "fields": { + "headers": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "fcmOptions": { + "type": "ApnsFcmOptions", + "id": 3 + } + } + }, + "ApnsFcmOptions": { + "fields": { + "analyticsLabel": { + "type": "string", + "id": 1 + }, + "image": { + "type": "string", + "id": 2 + } + } + }, + "FcmOptions": { + "fields": { + "analyticsLabel": { + "type": "string", + "id": 1 + } + } + }, + "FcmError": { + "fields": { + "errorCode": { + "type": "ErrorCode", + "id": 1 + } + }, + "nested": { + "ErrorCode": { + "values": { + "UNSPECIFIED_ERROR": 0, + "INVALID_ARGUMENT": 1, + "UNREGISTERED": 2, + "SENDER_ID_MISMATCH": 3, + "QUOTA_EXCEEDED": 4, + "APNS_AUTH_ERROR": 5, + "UNAVAILABLE": 6, + "INTERNAL": 7, + "THIRD_PARTY_AUTH_ERROR": 8 + } + } + } + }, + "ApnsError": { + "fields": { + "statusCode": { + "type": "int32", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/color;color", + "java_multiple_files": true, + "java_outer_classname": "ColorProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Color": { + "fields": { + "red": { + "type": "float", + "id": 1 + }, + "green": { + "type": "float", + "id": 2 + }, + "blue": { + "type": "float", + "id": 3 + }, + "alpha": { + "type": "google.protobuf.FloatValue", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file From ae3a480f45fc7dff8400247d6e6e35d952926e78 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Tue, 22 Jun 2021 18:11:40 +0000 Subject: [PATCH 2/9] Add GAPIC generated client code --- src/messaging/src/index.ts | 25 ++ src/messaging/src/v1/fcm_service_client.ts | 361 ++++++++++++++++++ .../src/v1/fcm_service_client_config.json | 43 +++ .../src/v1/fcm_service_proto_list.json | 3 + src/messaging/src/v1/gapic_metadata.json | 33 ++ src/messaging/src/v1/index.ts | 19 + 6 files changed, 484 insertions(+) create mode 100644 src/messaging/src/index.ts create mode 100644 src/messaging/src/v1/fcm_service_client.ts create mode 100644 src/messaging/src/v1/fcm_service_client_config.json create mode 100644 src/messaging/src/v1/fcm_service_proto_list.json create mode 100644 src/messaging/src/v1/gapic_metadata.json create mode 100644 src/messaging/src/v1/index.ts diff --git a/src/messaging/src/index.ts b/src/messaging/src/index.ts new file mode 100644 index 0000000000..115bad064b --- /dev/null +++ b/src/messaging/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2021 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 v1 from './v1'; +const FcmServiceClient = v1.FcmServiceClient; +type FcmServiceClient = v1.FcmServiceClient; +export {v1, FcmServiceClient}; +export default {v1, FcmServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/src/messaging/src/v1/fcm_service_client.ts b/src/messaging/src/v1/fcm_service_client.ts new file mode 100644 index 0000000000..6047e41044 --- /dev/null +++ b/src/messaging/src/v1/fcm_service_client.ts @@ -0,0 +1,361 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/fcm_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './fcm_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Firebase Cloud Messaging service (FCM) to target cross-platform messaging. + * @class + * @memberof v1 + */ +export class FcmServiceClient { + 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; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + fcmServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FcmServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://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. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FcmServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // 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}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.firebase.fcm.v1.FcmService', 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.fcmServiceStub) { + return this.fcmServiceStub; + } + + // Put together the "service stub" for + // google.firebase.fcm.v1.FcmService. + this.fcmServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.firebase.fcm.v1.FcmService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.firebase.fcm.v1.FcmService, + 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 fcmServiceStubMethods = + ['sendMessage']; + for (const methodName of fcmServiceStubMethods) { + const callPromise = this.fcmServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.fcmServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'fcm.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'fcm.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + sendMessage( + request: protos.google.firebase.fcm.v1.ISendMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.firebase.fcm.v1.IMessage, + protos.google.firebase.fcm.v1.ISendMessageRequest|undefined, {}|undefined + ]>; + sendMessage( + request: protos.google.firebase.fcm.v1.ISendMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.firebase.fcm.v1.IMessage, + protos.google.firebase.fcm.v1.ISendMessageRequest|null|undefined, + {}|null|undefined>): void; + sendMessage( + request: protos.google.firebase.fcm.v1.ISendMessageRequest, + callback: Callback< + protos.google.firebase.fcm.v1.IMessage, + protos.google.firebase.fcm.v1.ISendMessageRequest|null|undefined, + {}|null|undefined>): void; +/** + * Send a message to specified target (a registration token, topic + * or condition). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. It contains the Firebase project id (i.e. the unique identifier + * for your Firebase project), in the format of `projects/{project_id}`. + * For legacy support, the numeric project number with no padding is also + * supported in the format of `projects/{project_number}`. + * @param {boolean} request.validateOnly + * Flag for testing the request without actually delivering the message. + * @param {google.firebase.fcm.v1.Message} request.message + * Required. Message to send. + * @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 [Message]{@link google.firebase.fcm.v1.Message}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.sendMessage(request); + */ + sendMessage( + request: protos.google.firebase.fcm.v1.ISendMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.firebase.fcm.v1.IMessage, + protos.google.firebase.fcm.v1.ISendMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.firebase.fcm.v1.IMessage, + protos.google.firebase.fcm.v1.ISendMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.firebase.fcm.v1.IMessage, + protos.google.firebase.fcm.v1.ISendMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.sendMessage(request, options, callback); + } + + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.fcmServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/messaging/src/v1/fcm_service_client_config.json b/src/messaging/src/v1/fcm_service_client_config.json new file mode 100644 index 0000000000..6f875dc814 --- /dev/null +++ b/src/messaging/src/v1/fcm_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.firebase.fcm.v1.FcmService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "SendMessage": { + "timeout_millis": 10000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/src/messaging/src/v1/fcm_service_proto_list.json b/src/messaging/src/v1/fcm_service_proto_list.json new file mode 100644 index 0000000000..c684188e11 --- /dev/null +++ b/src/messaging/src/v1/fcm_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/firebase/fcm/v1/fcm_service.proto" +] diff --git a/src/messaging/src/v1/gapic_metadata.json b/src/messaging/src/v1/gapic_metadata.json new file mode 100644 index 0000000000..0d8f95d738 --- /dev/null +++ b/src/messaging/src/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.firebase.fcm.v1", + "libraryPackage": "@google-cloud/fcm", + "services": { + "FcmService": { + "clients": { + "grpc": { + "libraryClient": "FcmServiceClient", + "rpcs": { + "SendMessage": { + "methods": [ + "sendMessage" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FcmServiceClient", + "rpcs": { + "SendMessage": { + "methods": [ + "sendMessage" + ] + } + } + } + } + } + } +} diff --git a/src/messaging/src/v1/index.ts b/src/messaging/src/v1/index.ts new file mode 100644 index 0000000000..e3b65dd395 --- /dev/null +++ b/src/messaging/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 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 {FcmServiceClient} from './fcm_service_client'; From d45746d613eafe4b3a933a7c51269c2202904ab9 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Tue, 22 Jun 2021 18:21:21 +0000 Subject: [PATCH 3/9] Modify tsconfig to properly compile with GAPIC changes Note: adding DOM to lib is necessary to make the compiler happy, but shouldn't be a runtime issue --- tsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 67f91761f3..3383fed667 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "sourceMap": true, "noImplicitAny": true, "noUnusedLocals": true, + "resolveJsonModule": true, // TODO(rsgowman): enable `"strict": true,` and remove explicit setting of: noImplicitAny, noImplicitThis, alwaysStrict, strictBindCallApply, strictNullChecks, strictFunctionTypes, strictPropertyInitialization. "noImplicitThis": true, "alwaysStrict": true, @@ -13,7 +14,9 @@ "strictNullChecks": true, "strictFunctionTypes": true, //"strictPropertyInitialization": true, - "lib": ["es2018"], + "lib": [ + "es2018", + "dom"], "outDir": "lib", "rootDir": "." }, From 87840dcee3be1685c2eb1562cbc1c731f6b16e55 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Wed, 23 Jun 2021 16:59:22 +0000 Subject: [PATCH 4/9] Disable linting for autogenerated files --- src/messaging/protos/protos.d.ts | 1 + src/messaging/src/v1/fcm_service_client.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/messaging/protos/protos.d.ts b/src/messaging/protos/protos.d.ts index 4383fc4ccb..c78562d6e0 100644 --- a/src/messaging/protos/protos.d.ts +++ b/src/messaging/protos/protos.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable */ // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/messaging/src/v1/fcm_service_client.ts b/src/messaging/src/v1/fcm_service_client.ts index 6047e41044..fed18bf06a 100644 --- a/src/messaging/src/v1/fcm_service_client.ts +++ b/src/messaging/src/v1/fcm_service_client.ts @@ -1,3 +1,4 @@ +/* eslint-disable */ // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); From 313ded14ea2e70f33e56e9fd8b2b9f6ad87bb280 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Fri, 25 Jun 2021 15:26:52 +0000 Subject: [PATCH 5/9] Fix style error in tsconfig --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 3383fed667..5d1858fd95 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ //"strictPropertyInitialization": true, "lib": [ "es2018", - "dom"], + "dom" + ], "outDir": "lib", "rootDir": "." }, From 0ab0d725cb2fb827c61a5a35642223f13f46ec91 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Fri, 25 Jun 2021 19:03:39 +0000 Subject: [PATCH 6/9] Refactor file structure of generated files/directories --- .../messaging/protos/google/firebase/fcm/v1/fcm_service.proto | 0 src/{ => generated}/messaging/protos/protos.d.ts | 0 src/{ => generated}/messaging/protos/protos.json | 0 src/{ => generated}/messaging/src/index.ts | 0 src/{ => generated}/messaging/src/v1/fcm_service_client.ts | 0 .../messaging/src/v1/fcm_service_client_config.json | 0 src/{ => generated}/messaging/src/v1/fcm_service_proto_list.json | 0 src/{ => generated}/messaging/src/v1/gapic_metadata.json | 0 src/{ => generated}/messaging/src/v1/index.ts | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => generated}/messaging/protos/google/firebase/fcm/v1/fcm_service.proto (100%) rename src/{ => generated}/messaging/protos/protos.d.ts (100%) rename src/{ => generated}/messaging/protos/protos.json (100%) rename src/{ => generated}/messaging/src/index.ts (100%) rename src/{ => generated}/messaging/src/v1/fcm_service_client.ts (100%) rename src/{ => generated}/messaging/src/v1/fcm_service_client_config.json (100%) rename src/{ => generated}/messaging/src/v1/fcm_service_proto_list.json (100%) rename src/{ => generated}/messaging/src/v1/gapic_metadata.json (100%) rename src/{ => generated}/messaging/src/v1/index.ts (100%) diff --git a/src/messaging/protos/google/firebase/fcm/v1/fcm_service.proto b/src/generated/messaging/protos/google/firebase/fcm/v1/fcm_service.proto similarity index 100% rename from src/messaging/protos/google/firebase/fcm/v1/fcm_service.proto rename to src/generated/messaging/protos/google/firebase/fcm/v1/fcm_service.proto diff --git a/src/messaging/protos/protos.d.ts b/src/generated/messaging/protos/protos.d.ts similarity index 100% rename from src/messaging/protos/protos.d.ts rename to src/generated/messaging/protos/protos.d.ts diff --git a/src/messaging/protos/protos.json b/src/generated/messaging/protos/protos.json similarity index 100% rename from src/messaging/protos/protos.json rename to src/generated/messaging/protos/protos.json diff --git a/src/messaging/src/index.ts b/src/generated/messaging/src/index.ts similarity index 100% rename from src/messaging/src/index.ts rename to src/generated/messaging/src/index.ts diff --git a/src/messaging/src/v1/fcm_service_client.ts b/src/generated/messaging/src/v1/fcm_service_client.ts similarity index 100% rename from src/messaging/src/v1/fcm_service_client.ts rename to src/generated/messaging/src/v1/fcm_service_client.ts diff --git a/src/messaging/src/v1/fcm_service_client_config.json b/src/generated/messaging/src/v1/fcm_service_client_config.json similarity index 100% rename from src/messaging/src/v1/fcm_service_client_config.json rename to src/generated/messaging/src/v1/fcm_service_client_config.json diff --git a/src/messaging/src/v1/fcm_service_proto_list.json b/src/generated/messaging/src/v1/fcm_service_proto_list.json similarity index 100% rename from src/messaging/src/v1/fcm_service_proto_list.json rename to src/generated/messaging/src/v1/fcm_service_proto_list.json diff --git a/src/messaging/src/v1/gapic_metadata.json b/src/generated/messaging/src/v1/gapic_metadata.json similarity index 100% rename from src/messaging/src/v1/gapic_metadata.json rename to src/generated/messaging/src/v1/gapic_metadata.json diff --git a/src/messaging/src/v1/index.ts b/src/generated/messaging/src/v1/index.ts similarity index 100% rename from src/messaging/src/v1/index.ts rename to src/generated/messaging/src/v1/index.ts From c4be9558a781fc6eb183c7b87889d8acaf26eef3 Mon Sep 17 00:00:00 2001 From: Maceo Thompson Date: Fri, 25 Jun 2021 19:05:17 +0000 Subject: [PATCH 7/9] Ignore generated files in linter --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index e44e804d89..7ee92e3834 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,6 +25,7 @@ module.exports = { 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', ], + ignorePatterns: ["src/generated/*"], rules: { // Following checks are temporarily disabled. We shall incrementally enable them in the // future, fixing any violations as we go. From 1ffae1571b7bf089f08360321d0635b70e914652 Mon Sep 17 00:00:00 2001 From: Maceo Thompson <39141964+maceonthompson@users.noreply.github.com> Date: Fri, 2 Jul 2021 18:10:57 +0000 Subject: [PATCH 8/9] Update Gulpfile to copy files required for generated client to properly run (#1353) * Update Gulpfile to copy files required for generated code to run. * Fix introduced typo on 104 * Remove redundant glob from `copyJson()` task --- gulpfile.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9ca1aeb941..ce01e04eec 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -106,13 +106,27 @@ gulp.task('compile_test', function() { }); gulp.task('copyTypings', function() { - return gulp.src(['src/index.d.ts', 'src/firebase-namespace.d.ts']) + return gulp.src([ + 'src/index.d.ts', + 'src/firebase-namespace.d.ts', + 'src/**/protos/*.d.ts', + ]) // Add header .pipe(header(banner)) .pipe(gulp.dest(paths.build)) }); -gulp.task('compile_all', gulp.series('compile', 'copyTypings', 'compile_test')); +gulp.task('copyJSON', function() { + return gulp.src([ + // This isn't ideal, but doing something like + // 'src/generated/**/*.json' results in incorrect paths in the /lib dir + 'src/**/*.json' + ]) + .pipe(gulp.dest(paths.build)) +}); + +gulp.task('compile_all', gulp.series('compile', 'copyTypings', + 'copyJSON', 'compile_test')); // Regenerates js every time a source file changes gulp.task('watch', function() { @@ -120,7 +134,7 @@ gulp.task('watch', function() { }); // Build task -gulp.task('build', gulp.series('cleanup', 'compile', 'copyTypings')); +gulp.task('build', gulp.series('cleanup', 'compile', 'copyTypings', 'copyJSON')); // Default task gulp.task('default', gulp.series('build')); From 3900ea9826a80b18752aa7581bc90e91a2ad60af Mon Sep 17 00:00:00 2001 From: Maceo Thompson <39141964+maceonthompson@users.noreply.github.com> Date: Mon, 9 Aug 2021 19:12:37 +0000 Subject: [PATCH 9/9] Fcm GAPIC type conversion (#1354) This PR serves as a proof of concept to show that GAPIC generated clients can be integrated with Firebase Admin APIs. It also shows that this integration for pre-existing APIs requires a relatively substantial amount of work. --- .../messaging/src/v1/fcm_service_client.ts | 4 +- src/messaging/messaging-errors-internal.ts | 16 ++ src/messaging/messaging.ts | 111 +++++++++- test/unit/messaging/messaging.spec.ts | 199 +++++++----------- 4 files changed, 191 insertions(+), 139 deletions(-) diff --git a/src/generated/messaging/src/v1/fcm_service_client.ts b/src/generated/messaging/src/v1/fcm_service_client.ts index fed18bf06a..fb092b19ca 100644 --- a/src/generated/messaging/src/v1/fcm_service_client.ts +++ b/src/generated/messaging/src/v1/fcm_service_client.ts @@ -30,7 +30,9 @@ import jsonProtos = require('../../protos/protos.json'); */ import * as gapicConfig from './fcm_service_client_config.json'; -const version = require('../../../package.json').version; +//! Temporary change, this modification should be avoidable with the suggested +// directory refactoring. +const version = require('../../../../../package.json').version; /** * Firebase Cloud Messaging service (FCM) to target cross-platform messaging. diff --git a/src/messaging/messaging-errors-internal.ts b/src/messaging/messaging-errors-internal.ts index ecd3155bae..826eae501c 100644 --- a/src/messaging/messaging-errors-internal.ts +++ b/src/messaging/messaging-errors-internal.ts @@ -18,6 +18,22 @@ import { HttpError } from '../utils/api-request'; import { FirebaseMessagingError, MessagingClientErrorCode } from '../utils/error'; import * as validator from '../utils/validator'; +/** + * Creates a new FirebaseMessagingError by extracting the error code, message, and + * other relevant details from an error thrown by the generated GAPIC client. + * + * @param err + * @returns + */ +export function createFirebaseErrorFromGapicError(err: Error): FirebaseMessagingError { + const json = { error: err }; + + const errorCode = getErrorCode(json); + const errorMessage = getErrorMessage(json); + + return FirebaseMessagingError.fromServerError(errorCode, errorMessage, json); +} + /** * Creates a new FirebaseMessagingError by extracting the error code, message and other relevant * details from an HTTP error response. diff --git a/src/messaging/messaging.ts b/src/messaging/messaging.ts index 88e66cf565..d0f4106ad5 100644 --- a/src/messaging/messaging.ts +++ b/src/messaging/messaging.ts @@ -22,8 +22,12 @@ import { validateMessage, BLACKLISTED_DATA_PAYLOAD_KEYS, BLACKLISTED_OPTIONS_KEY import { messaging } from './index'; import { FirebaseMessagingRequestHandler } from './messaging-api-request-internal'; import { ErrorInfo, MessagingClientErrorCode, FirebaseMessagingError } from '../utils/error'; +import { createFirebaseErrorFromGapicError } from './messaging-errors-internal'; +import { ServiceAccountCredential } from '../credential/credential-internal'; import * as utils from '../utils'; import * as validator from '../utils/validator'; +import * as protos from '../generated/messaging/protos/protos'; +import { FcmServiceClient } from '../generated/messaging/src/v1/fcm_service_client' import MessagingInterface = messaging.Messaging; import Message = messaging.Message; @@ -41,6 +45,10 @@ import MessagingConditionResponse = messaging.MessagingConditionResponse; import DataMessagePayload = messaging.DataMessagePayload; import NotificationMessagePayload = messaging.NotificationMessagePayload; +// GAPIC Generated client types +import IMessage = protos.google.firebase.fcm.v1.IMessage; +import ISendRequest = protos.google.firebase.fcm.v1.ISendMessageRequest; + /* eslint-disable @typescript-eslint/camelcase */ // FCM endpoints @@ -193,6 +201,7 @@ export class Messaging implements MessagingInterface { private urlPath: string; private readonly appInternal: FirebaseApp; private readonly messagingRequestHandler: FirebaseMessagingRequestHandler; + private fcmServiceClient: FcmServiceClient; /** * Gets the {@link messaging.Messaging `Messaging`} service for the @@ -228,6 +237,77 @@ export class Messaging implements MessagingInterface { return this.appInternal; } + + /** + * Converts from the public {@link messaging.Message `Message`} type to the + * internal/generated {@link protos.google.firebase.fcm.v1.Message `clientMessage`} + * type. + * + * @param message The {@link messaging.Message `Message`} to be converted + * @returns A {@link protos.google.firebase.fcm.v1.Message `clientMessage`}, + * where like fields are the same as the inptuted message. + */ + private convertToIMessage(message: Message): IMessage { + //TODO: Add conversion for android, webpush, apns + + const convertedMessage: IMessage = { + data: message.data, + notification: message.notification, + fcmOptions: message.fcmOptions + } + + if ('token' in message) { + convertedMessage.token = message.token; + } else if ('topic' in message) { + convertedMessage.topic = message.topic; + } else if ('condition' in message) { + convertedMessage.condition = message.condition; + } + + return convertedMessage; + } + + /** + * Method that returns a fully instantiated service client. + * + * @returns an instantiated service client with either the application's + * service account credentials or the default credentials + */ + private getFcmServiceClient(): Promise { + if (this.fcmServiceClient) { + return Promise.resolve(this.fcmServiceClient); + } + + const credential = this.app.options.credential; + const options: { credentials?: object; fallback: 'rest'; projectId?: string } = { + fallback: 'rest' + }; + + if (credential instanceof ServiceAccountCredential) { + options.credentials = { + private_key: credential.privateKey, + client_email: credential.clientEmail + }; + } + + return utils.findProjectId(this.appInternal).then(projectId => { + if (!validator.isNonEmptyString(projectId)) { + // Assert for an explicit project ID (either via AppOptions or the cert itself). + throw new FirebaseMessagingError( + MessagingClientErrorCode.INVALID_ARGUMENT, + 'Failed to determine project ID for Messaging. Initialize the ' + + 'SDK with service account credentials or set project ID as an app option. ' + + 'Alternatively set the GOOGLE_CLOUD_PROJECT environment variable.', + ); + } + + options.projectId = projectId; + }).then(() => { + this.fcmServiceClient = new FcmServiceClient(options); + return this.fcmServiceClient; + }) + } + /** * Sends the given message via FCM. * @@ -245,16 +325,27 @@ export class Messaging implements MessagingInterface { throw new FirebaseMessagingError( MessagingClientErrorCode.INVALID_ARGUMENT, 'dryRun must be a boolean'); } - return this.getUrlPath() - .then((urlPath) => { - const request: { message: Message; validate_only?: boolean } = { message: copy }; - if (dryRun) { - request.validate_only = true; - } - return this.messagingRequestHandler.invokeRequestHandler(FCM_SEND_HOST, urlPath, request); - }) - .then((response) => { - return (response as any).name; + + const IMessage = this.convertToIMessage(copy); + + return this.getFcmServiceClient() + .then(client => { + return client.getProjectId() + .then((projectId) => { + const parent = `projects/${projectId}`; + + const request: ISendRequest = { + parent: parent, + message: IMessage, + validateOnly: dryRun + }; + return client.sendMessage(request); + }) + .then(([response]) => { + return response.name!; + }).catch(err => { + throw createFirebaseErrorFromGapicError(err); + }); }); } diff --git a/test/unit/messaging/messaging.spec.ts b/test/unit/messaging/messaging.spec.ts index 236c18213a..8da82c168e 100644 --- a/test/unit/messaging/messaging.spec.ts +++ b/test/unit/messaging/messaging.spec.ts @@ -33,6 +33,7 @@ import { Messaging } from '../../../src/messaging/messaging'; import { BLACKLISTED_OPTIONS_KEYS, BLACKLISTED_DATA_PAYLOAD_KEYS } from '../../../src/messaging/messaging-internal'; import { HttpClient } from '../../../src/utils/api-request'; import { getSdkVersion } from '../../../src/utils/index'; +import { FcmServiceClient } from '../../../src/generated/messaging/src/v1/fcm_service_client'; chai.should(); chai.use(sinonChai); @@ -73,6 +74,12 @@ const expectedErrorCodes = { unknownError: 'messaging/unknown-error', }; +const successfulGapicResponse = [ + // An example IMessage that is normally returned by the generated client + // when sendMessage() is ran successfully + { name: 'projects/projec_id/messages/message_id' } +]; + const STATUS_CODE_TO_ERROR_MAP = { 200: 'messaging/unknown-error', 400: 'messaging/invalid-argument', @@ -83,13 +90,6 @@ const STATUS_CODE_TO_ERROR_MAP = { 503: 'messaging/server-unavailable', }; -function mockSendRequest(): nock.Scope { - return nock(`https://${FCM_SEND_HOST}:443`) - .post('/v1/projects/project_id/messages:send') - .reply(200, { - name: 'projects/projec_id/messages/message_id', - }); -} function mockBatchRequest(ids: string[]): nock.Scope { return mockBatchRequestWithErrors(ids); @@ -129,14 +129,6 @@ function createMultipartPayloadWithErrors( return payload; } -function mockSendError( - statusCode: number, - errorFormat: 'json' | 'text', - responseOverride?: any, -): nock.Scope { - return mockErrorResponse( - '/v1/projects/project_id/messages:send', statusCode, errorFormat, responseOverride); -} function mockBatchError( statusCode: number, @@ -324,6 +316,7 @@ describe('Messaging', () => { let mockedRequests: nock.Scope[] = []; let httpsRequestStub: sinon.SinonStub; let getTokenStub: sinon.SinonStub; + let generatedClientStub: sinon.SinonStub | null; let nullAccessTokenMessaging: Messaging; let messagingService: {[key: string]: any}; @@ -357,6 +350,11 @@ describe('Messaging', () => { httpsRequestStub.restore(); } getTokenStub.restore(); + + if (generatedClientStub) { + generatedClientStub.restore(); + } + return mockApp.delete(); }); @@ -466,9 +464,12 @@ describe('Messaging', () => { { token: 'mock-token' }, { topic: 'mock-topic' }, { topic: '/topics/mock-topic' }, { condition: '"foo" in topics' }, ]; + targetMessages.forEach((message) => { it(`should be fulfilled with a message ID given a valid message: ${JSON.stringify(message)}`, () => { - mockedRequests.push(mockSendRequest()); + generatedClientStub = sinon + .stub(FcmServiceClient.prototype, 'sendMessage') + .resolves(successfulGapicResponse); return messaging.send( message, ).should.eventually.equal('projects/projec_id/messages/message_id'); @@ -476,7 +477,9 @@ describe('Messaging', () => { }); targetMessages.forEach((message) => { it(`should be fulfilled with a message ID in dryRun mode: ${JSON.stringify(message)}`, () => { - mockedRequests.push(mockSendRequest()); + generatedClientStub = sinon + .stub(FcmServiceClient.prototype, 'sendMessage') + .resolves(successfulGapicResponse); return messaging.send( message, true, @@ -485,89 +488,24 @@ describe('Messaging', () => { }); it('should fail when the backend server returns a detailed error', () => { - const resp = { - error: { - status: 'INVALID_ARGUMENT', - message: 'test error message', - }, - }; - mockedRequests.push(mockSendError(400, 'json', resp)); - return messaging.send( - { token: 'mock-token' }, - ).should.eventually.be.rejectedWith('test error message') - .and.have.property('code', 'messaging/invalid-argument'); - }); - - it('should fail when the backend server returns a detailed error with FCM error code', () => { - const resp = { - error: { - status: 'INVALID_ARGUMENT', - message: 'test error message', - details: [ - { - '@type': 'type.googleapis.com/google.firebase.fcm.v1.FcmError', - 'errorCode': 'UNREGISTERED', - }, + generatedClientStub = sinon + .stub(FcmServiceClient.prototype, 'sendMessage') + .rejects({ + 'message': 'The registration token is not a valid FCM registration token', + 'code': 400, + 'status':'INVALID_ARGUMENT', + 'details': [ + { '@type':'type.googleapis.com/google.firebase.fcm.v1.FcmError', + 'errorCode':'INVALID_ARGUMENT' + } ], - }, - }; - mockedRequests.push(mockSendError(404, 'json', resp)); - return messaging.send( - { token: 'mock-token' }, - ).should.eventually.be.rejectedWith('test error message') - .and.have.property('code', 'messaging/registration-token-not-registered'); - }); - - ['THIRD_PARTY_AUTH_ERROR', 'APNS_AUTH_ERROR'].forEach((errorCode) => { - it(`should map ${errorCode} to third party auth error`, () => { - const resp = { - error: { - status: 'INVALID_ARGUMENT', - message: 'test error message', - details: [ - { - '@type': 'type.googleapis.com/google.firebase.fcm.v1.FcmError', - 'errorCode': errorCode, - }, - ], - }, - }; - mockedRequests.push(mockSendError(404, 'json', resp)); - return messaging.send( - { token: 'mock-token' }, - ).should.eventually.be.rejectedWith('test error message') - .and.have.property('code', 'messaging/third-party-auth-error'); - }); - }); - - it('should map server error code to client-side error', () => { - const resp = { - error: { - status: 'NOT_FOUND', - message: 'test error message', - }, - }; - mockedRequests.push(mockSendError(404, 'json', resp)); - return messaging.send( - { token: 'mock-token' }, - ).should.eventually.be.rejectedWith('test error message') - .and.have.property('code', 'messaging/registration-token-not-registered'); - }); - - it('should fail when the backend server returns an unknown error', () => { - const resp = { error: 'test error message' }; - mockedRequests.push(mockSendError(400, 'json', resp)); - return messaging.send( - { token: 'mock-token' }, - ).should.eventually.be.rejected.and.have.property('code', 'messaging/unknown-error'); - }); - - it('should fail when the backend server returns a non-json error', () => { - // Error code will be determined based on the status code. - mockedRequests.push(mockSendError(400, 'text', 'foo bar')); + 'note': 'Exception occurred in retry method that was not classified as transient' + }); return messaging.send( { token: 'mock-token' }, - ).should.eventually.be.rejected.and.have.property('code', 'messaging/invalid-argument'); + ).should.eventually.be.rejectedWith('The registration token is not ' + + 'a valid FCM registration token') + .and.have.property('code', 'messaging/invalid-argument'); }); }); @@ -838,9 +776,9 @@ describe('Messaging', () => { const topicMessage: TopicMessage = { topic: 'test' }; const conditionMessage: ConditionMessage = { condition: 'test' }; const messages: Message[] = [tokenMessage, topicMessage, conditionMessage]; - + mockedRequests.push(mockBatchRequest(messageIds)); - + return messaging.sendAll(messages) .then((response: BatchResponse) => { expect(response.successCount).to.equal(3); @@ -851,7 +789,7 @@ describe('Messaging', () => { expect(resp.error).to.be.undefined; }); }); - }); + }); }); describe('sendMulticast()', () => { @@ -3536,40 +3474,45 @@ describe('Messaging', () => { validMessages.forEach((config) => { it(`should serialize well-formed Message: ${config.label}`, () => { - // Wait for the initial getToken() call to complete before stubbing https.request. - return mockApp.INTERNAL.getToken() - .then(() => { - const resp = utils.responseFrom({ message: 'test' }); - httpsRequestStub = sinon.stub(HttpClient.prototype, 'send').resolves(resp); - const req = config.req; - req.token = 'mock-token'; - return messaging.send(req); - }) - .then(() => { - const expectedReq = config.expectedReq || config.req; - expectedReq.token = 'mock-token'; - expect(httpsRequestStub).to.have.been.calledOnce.and.calledWith({ - method: 'POST', - data: { message: expectedReq }, - timeout: 10000, - url: 'https://fcm.googleapis.com/v1/projects/project_id/messages:send', - headers: expectedHeaders, - }); - }); + generatedClientStub = sinon.stub(FcmServiceClient.prototype, 'sendMessage').resolves(successfulGapicResponse); + const req = config.req; + req.token = 'mock-token'; + + return messaging.send(req).then(() => { + const expectedReq = config.expectedReq || config.req; + expectedReq.token = 'mock-token'; + expectedHeaders; + expect(generatedClientStub).to.have.been.calledOnce.and.calledWith( + { + parent: 'projects/project_id', + message: { + data: expectedReq.data, + notification: expectedReq.notification, + fcmOptions: expectedReq.fcmOptions, + token: expectedReq.token, + //TODO: Expand for android, webpush, apns once functionality is added + }, + validateOnly: undefined, + } + ); + }); }); }); it('should not throw when the message is addressed to the prefixed topic name', () => { - return mockApp.INTERNAL.getToken() - .then(() => { - const resp = utils.responseFrom({ message: 'test' }); - httpsRequestStub = sinon.stub(HttpClient.prototype, 'send').resolves(resp); - return messaging.send({ topic: '/topics/mock-topic' }); - }) + + httpsRequestStub = sinon.stub(FcmServiceClient.prototype, 'sendMessage').resolves(successfulGapicResponse); + return messaging.send({ topic: '/topics/mock-topic' }) .then(() => { expect(httpsRequestStub).to.have.been.calledOnce; - const requestData = httpsRequestStub.args[0][0].data; - const expectedReq = { topic: 'mock-topic' }; + console.log(httpsRequestStub.args[0]); + const requestData = httpsRequestStub.args[0][0]; + const expectedReq = { + topic: 'mock-topic', + data: undefined, + fcmOptions: undefined, + notification: undefined, + }; expect(requestData.message).to.deep.equal(expectedReq); }); });