From 334977f9832fe69e645b057f8e5a4dc0a91dd681 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Fri, 3 Oct 2025 18:14:30 +0300 Subject: [PATCH] general: revert #1665 --- WAProto/GenerateStatics.sh | 4 +- WAProto/WAProto.proto | 578 +- WAProto/index.d.ts | 4309 +- WAProto/index.js | 50182 +++++++++++++++- .../Group/sender-key-distribution-message.ts | 12 +- src/Signal/Group/sender-key-message.ts | 9 +- src/Socket/communities.ts | 2 +- src/Socket/groups.ts | 2 +- src/Socket/messages-recv.ts | 20 +- src/Socket/messages-send.ts | 9 +- src/Socket/socket.ts | 5 +- src/Types/Events.ts | 2 +- src/Types/Message.ts | 6 +- src/Types/Socket.ts | 4 +- src/Utils/chat-utils.ts | 17 +- src/Utils/decode-wa-message.ts | 8 +- src/Utils/event-buffer.ts | 32 +- src/Utils/generics.ts | 11 +- src/Utils/history.ts | 13 +- src/Utils/index.ts | 1 - src/Utils/messages-media.ts | 8 +- src/Utils/messages.ts | 20 +- src/Utils/noise-handler.ts | 3 +- src/Utils/process-message.ts | 31 +- src/Utils/proto-utils.ts | 12 - src/Utils/use-multi-file-auth-state.ts | 2 +- src/Utils/validate-connection.ts | 30 +- src/WABinary/generic-utils.ts | 3 +- .../binary/connection-deadlock.test.ts | 6 +- 29 files changed, 51841 insertions(+), 3500 deletions(-) delete mode 100644 src/Utils/proto-utils.ts diff --git a/WAProto/GenerateStatics.sh b/WAProto/GenerateStatics.sh index 10c48934..51316a5e 100755 --- a/WAProto/GenerateStatics.sh +++ b/WAProto/GenerateStatics.sh @@ -1,3 +1,3 @@ -yarn pbjs -t static-module --no-convert --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto; -yarn pbjs -t static-module --no-convert --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -; +yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto; +yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -; node ./fix-imports.js diff --git a/WAProto/WAProto.proto b/WAProto/WAProto.proto index 1760a217..07694216 100644 --- a/WAProto/WAProto.proto +++ b/WAProto/WAProto.proto @@ -59,7 +59,7 @@ message AIRichResponseMessage { optional AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType highlightType = 1; optional string codeContent = 2; } - + enum AIRichResponseCodeHighlightType { AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT = 0; AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD = 1; @@ -69,7 +69,7 @@ message AIRichResponseMessage { AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT = 5; } } - + message AIRichResponseContentItemsMetadata { repeated AIRichResponseContentItemMetadata itemsMetadata = 1; optional ContentType contentType = 2; @@ -78,20 +78,20 @@ message AIRichResponseMessage { AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem reelItem = 1; } } - + message AIRichResponseReelItem { optional string title = 1; optional string profileIconUrl = 2; optional string thumbnailUrl = 3; optional string videoUrl = 4; } - + enum ContentType { DEFAULT = 0; CAROUSEL = 1; } } - + message AIRichResponseDynamicMetadata { optional AIRichResponseDynamicMetadataType type = 1; optional uint64 version = 2; @@ -103,18 +103,18 @@ message AIRichResponseMessage { AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF = 2; } } - + message AIRichResponseGridImageMetadata { optional AIRichResponseMessage.AIRichResponseImageURL gridImageUrl = 1; repeated AIRichResponseMessage.AIRichResponseImageURL imageUrls = 2; } - + message AIRichResponseImageURL { optional string imagePreviewUrl = 1; optional string imageHighResUrl = 2; optional string sourceUrl = 3; } - + message AIRichResponseInlineImageMetadata { optional AIRichResponseMessage.AIRichResponseImageURL imageUrl = 1; optional string imageText = 2; @@ -126,7 +126,7 @@ message AIRichResponseMessage { AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED = 2; } } - + message AIRichResponseLatexMetadata { optional string text = 1; repeated AIRichResponseLatexExpression expressions = 2; @@ -141,9 +141,9 @@ message AIRichResponseMessage { optional double imageBottomPadding = 8; optional double imageTrailingPadding = 9; } - + } - + message AIRichResponseMapMetadata { optional double centerLatitude = 1; optional double centerLongitude = 2; @@ -158,9 +158,9 @@ message AIRichResponseMessage { optional string title = 4; optional string body = 5; } - + } - + enum AIRichResponseMessageType { AI_RICH_RESPONSE_TYPE_UNKNOWN = 0; AI_RICH_RESPONSE_TYPE_STANDARD = 1; @@ -177,7 +177,7 @@ message AIRichResponseMessage { optional AIRichResponseMessage.AIRichResponseMapMetadata mapMetadata = 9; optional AIRichResponseMessage.AIRichResponseContentItemsMetadata contentItemsMetadata = 10; } - + enum AIRichResponseSubMessageType { AI_RICH_RESPONSE_UNKNOWN = 0; AI_RICH_RESPONSE_GRID_IMAGE = 1; @@ -196,13 +196,13 @@ message AIRichResponseMessage { repeated string items = 1; optional bool isHeading = 2; } - + } - + message AIRichResponseUnifiedResponse { optional bytes data = 1; } - + } message Account { @@ -513,7 +513,7 @@ message BotProgressIndicatorMetadata { optional string sourceUrl = 3; optional string favIconUrl = 4; } - + message BotPlanningSearchSourcesMetadata { optional string sourceTitle = 1; optional BotPlanningSearchSourceProvider provider = 2; @@ -525,13 +525,13 @@ message BotProgressIndicatorMetadata { BING = 3; } } - + message BotPlanningStepSectionMetadata { optional string sectionTitle = 1; optional string sectionBody = 2; repeated BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata sourcesMetadata = 3; } - + enum BotSearchSourceProvider { UNKNOWN_PROVIDER = 0; OTHER = 1; @@ -545,7 +545,7 @@ message BotProgressIndicatorMetadata { FINISHED = 3; } } - + } message BotPromotionMessageMetadata { @@ -577,7 +577,7 @@ message BotQuotaMetadata { REASONING_FEATURE = 1; } } - + } message BotReminderMetadata { @@ -607,7 +607,7 @@ message BotRenderingMetadata { optional string value = 1; repeated string associatedPrompts = 2; } - + } message BotSessionMetadata { @@ -640,7 +640,7 @@ message BotSourcesMetadata { SUPPORT = 3; } } - + } message BotSuggestedPromptMetadata { @@ -688,7 +688,7 @@ message CallLogRecord { optional string userJid = 1; optional CallLogRecord.CallResult callResult = 2; } - + enum SilenceReason { NONE = 0; SCHEDULED = 1; @@ -710,9 +710,9 @@ message CertChain { optional uint64 notBefore = 4; optional uint64 notAfter = 5; } - + } - + } message ChatLockSettings { @@ -747,23 +747,23 @@ message ChatRowOpaqueData { VIDEO = 2; } } - + message CtwaContextLinkData { optional string context = 1; optional string sourceUrl = 2; optional string icebreaker = 3; optional string phone = 4; } - + } - + } message Citation { - required string title = 1; - required string subtitle = 2; - required string cmsId = 3; - required string imageUrl = 4; + string title = 1; + string subtitle = 2; + string cmsId = 3; + string imageUrl = 4; } message ClientPairingProps { @@ -844,7 +844,7 @@ message ClientPayload { MNS = 5; } } - + message DevicePairingRegistrationData { optional bytes eRegid = 1; optional bytes eKeytype = 2; @@ -855,7 +855,7 @@ message ClientPayload { optional bytes buildHash = 7; optional bytes deviceProps = 8; } - + enum IOSAppExtension { SHARE_EXTENSION = 0; SERVICE_EXTENSION = 1; @@ -866,7 +866,7 @@ message ClientPayload { optional bytes token = 2; optional bool enableReadReceipts = 3; } - + enum Product { WHATSAPP = 0; MESSENGER = 1; @@ -902,7 +902,7 @@ message ClientPayload { optional uint32 quaternary = 4; optional uint32 quinary = 5; } - + enum DeviceType { PHONE = 0; TABLET = 1; @@ -955,7 +955,7 @@ message ClientPayload { DEBUG = 3; } } - + message WebInfo { optional string refToken = 1; optional string version = 2; @@ -982,9 +982,9 @@ message ClientPayload { optional string documentTypes = 10; optional bytes features = 11; } - + } - + } message CommentMetadata { @@ -1066,11 +1066,11 @@ message ContextInfo { VIDEO = 2; } } - + message BusinessMessageForwardInfo { optional string businessOwnerJid = 1; } - + message DataSharingContext { optional bool showMmDisclosure = 1; optional string encryptedSignalTokenConsented = 2; @@ -1082,9 +1082,9 @@ message ContextInfo { optional float floatData = 4; optional ContextInfo.DataSharingContext.Parameters contents = 5; } - + } - + message ExternalAdReplyInfo { optional string title = 1; optional string body = 2; @@ -1121,20 +1121,20 @@ message ContextInfo { VIDEO = 2; } } - + message FeatureEligibilities { optional bool cannotBeReactedTo = 1; optional bool cannotBeRanked = 2; optional bool canRequestFeedback = 3; optional bool canBeReshared = 4; } - + message ForwardedAIBotMessageInfo { optional string botName = 1; optional string botJid = 2; optional string creatorName = 3; } - + message ForwardedNewsletterMessageInfo { optional string newsletterJid = 1; optional int32 serverMessageId = 2; @@ -1147,7 +1147,7 @@ message ContextInfo { LINK_CARD = 3; } } - + enum PairedMediaType { NOT_PAIRED_MEDIA = 0; SD_VIDEO_PARENT = 1; @@ -1174,11 +1174,11 @@ message ContextInfo { optional string utmSource = 1; optional string utmCampaign = 2; } - + } message Conversation { - required string id = 1; + string id = 1; repeated HistorySyncMsg messages = 2; optional string newJid = 3; optional string oldJid = 4; @@ -1249,7 +1249,7 @@ message DeviceCapabilities { message LIDMigration { optional uint64 chatDbMigrationTimestamp = 1; } - + } message DeviceConsistencyCodeMessage { @@ -1281,7 +1281,7 @@ message DeviceProps { optional uint32 quaternary = 4; optional uint32 quinary = 5; } - + message HistorySyncConfig { optional uint32 fullSyncDaysLimit = 1; optional uint32 fullSyncSizeMbLimit = 2; @@ -1298,7 +1298,7 @@ message DeviceProps { optional bool supportAddOnHistorySyncMigration = 13; optional bool supportMessageAssociation = 14; } - + enum PlatformType { UNKNOWN = 0; CHROME = 1; @@ -1447,7 +1447,7 @@ message GroupMention { } message GroupParticipant { - required string userJid = 1; + string userJid = 1; optional Rank rank = 2; enum Rank { REGULAR = 0; @@ -1464,23 +1464,23 @@ message HandshakeMessage { optional bytes static = 1; optional bytes payload = 2; } - + message ClientHello { optional bytes ephemeral = 1; optional bytes static = 2; optional bytes payload = 3; } - + message ServerHello { optional bytes ephemeral = 1; optional bytes static = 2; optional bytes payload = 3; } - + } message HistorySync { - required HistorySyncType syncType = 1; + HistorySyncType syncType = 1; repeated Conversation conversations = 2; repeated WebMessageInfo statusV3Messages = 3; optional uint32 chunkOrder = 5; @@ -1528,12 +1528,12 @@ message HydratedTemplateButton { optional string displayText = 1; optional string phoneNumber = 2; } - + message HydratedQuickReplyButton { optional string displayText = 1; optional string id = 2; } - + message HydratedURLButton { optional string displayText = 1; optional string url = 2; @@ -1545,7 +1545,7 @@ message HydratedTemplateButton { COMPACT = 3; } } - + } message IdentityKeyPairStructure { @@ -1598,8 +1598,8 @@ message KeyId { } message LIDMigrationMapping { - required uint64 pn = 1; - required uint64 assignedLid = 2; + uint64 pn = 1; + uint64 assignedLid = 2; optional uint64 latestLid = 3; } @@ -1767,41 +1767,41 @@ message Message { optional uint32 expectedVideoCount = 3; optional ContextInfo contextInfo = 17; } - + message AppStateFatalExceptionNotification { repeated string collectionNames = 1; optional int64 timestamp = 2; } - + message AppStateSyncKey { optional Message.AppStateSyncKeyId keyId = 1; optional Message.AppStateSyncKeyData keyData = 2; } - + message AppStateSyncKeyData { optional bytes keyData = 1; optional Message.AppStateSyncKeyFingerprint fingerprint = 2; optional int64 timestamp = 3; } - + message AppStateSyncKeyFingerprint { optional uint32 rawId = 1; optional uint32 currentIndex = 2; repeated uint32 deviceIndexes = 3 [packed=true]; } - + message AppStateSyncKeyId { optional bytes keyId = 1; } - + message AppStateSyncKeyRequest { repeated Message.AppStateSyncKeyId keyIds = 1; } - + message AppStateSyncKeyShare { repeated Message.AppStateSyncKey keys = 1; } - + message AudioMessage { optional string url = 1; optional string mimetype = 2; @@ -1820,7 +1820,7 @@ message Message { optional bool viewOnce = 21; optional string accessibilityLabel = 22; } - + message BCallMessage { optional string sessionId = 1; optional MediaType mediaType = 2; @@ -1832,7 +1832,7 @@ message Message { VIDEO = 2; } } - + message BotFeedbackMessage { optional MessageKey messageKey = 1; optional BotFeedbackKind kind = 2; @@ -1873,7 +1873,7 @@ message Message { GENERIC = 0; } } - + message ButtonsMessage { optional string contentText = 6; optional string footerText = 7; @@ -1895,19 +1895,19 @@ message Message { message ButtonText { optional string displayText = 1; } - + message NativeFlowInfo { optional string name = 1; optional string paramsJson = 2; } - + enum Type { UNKNOWN = 0; RESPONSE = 1; NATIVE_FLOW = 2; } } - + enum HeaderType { UNKNOWN = 0; EMPTY = 1; @@ -1918,7 +1918,7 @@ message Message { LOCATION = 6; } } - + message ButtonsResponseMessage { optional string selectedButtonId = 1; optional ContextInfo contextInfo = 3; @@ -1931,7 +1931,7 @@ message Message { DISPLAY_TEXT = 1; } } - + message Call { optional bytes callKey = 1; optional string conversionSource = 2; @@ -1941,7 +1941,7 @@ message Message { optional bytes ctwaPayload = 6; optional ContextInfo contextInfo = 7; } - + message CallLogMessage { optional bool isVideo = 1; optional CallOutcome callOutcome = 2; @@ -1962,23 +1962,23 @@ message Message { optional string jid = 1; optional Message.CallLogMessage.CallOutcome callOutcome = 2; } - + enum CallType { REGULAR = 0; SCHEDULED_CALL = 1; VOICE_CHAT = 2; } } - + message CancelPaymentRequestMessage { optional MessageKey key = 1; } - + message Chat { optional string displayName = 1; optional string id = 2; } - + message CloudAPIThreadControlNotification { optional CloudAPIThreadControl status = 1; optional int64 senderNotificationTimestampMs = 2; @@ -1994,36 +1994,36 @@ message Message { optional string handoffNotificationText = 1; optional string extraJson = 2; } - + } - + message CommentMessage { optional Message message = 1; optional MessageKey targetMessageKey = 2; } - + message ContactMessage { optional string displayName = 1; optional string vcard = 16; optional ContextInfo contextInfo = 17; } - + message ContactsArrayMessage { optional string displayName = 1; repeated Message.ContactMessage contacts = 2; optional ContextInfo contextInfo = 17; } - + message DeclinePaymentRequestMessage { optional MessageKey key = 1; } - + message DeviceSentMessage { optional string destinationJid = 1; optional Message message = 2; optional string phash = 3; } - + message DocumentMessage { optional string url = 1; optional string mimetype = 2; @@ -2047,25 +2047,25 @@ message Message { optional string caption = 20; optional string accessibilityLabel = 21; } - + message EncCommentMessage { optional MessageKey targetMessageKey = 1; optional bytes encPayload = 2; optional bytes encIv = 3; } - + message EncEventResponseMessage { optional MessageKey eventCreationMessageKey = 1; optional bytes encPayload = 2; optional bytes encIv = 3; } - + message EncReactionMessage { optional MessageKey targetMessageKey = 1; optional bytes encPayload = 2; optional bytes encIv = 3; } - + message EventMessage { optional ContextInfo contextInfo = 1; optional bool isCanceled = 2; @@ -2078,7 +2078,7 @@ message Message { optional bool extraGuestsAllowed = 9; optional bool isScheduleCall = 10; } - + message EventResponseMessage { optional EventResponseType response = 1; optional int64 timestampMs = 2; @@ -2090,7 +2090,7 @@ message Message { MAYBE = 3; } } - + message ExtendedTextMessage { optional string text = 1; optional string matchedText = 2; @@ -2145,15 +2145,15 @@ message Message { PROFILE = 7; } } - + message FullHistorySyncOnDemandRequestMetadata { optional string requestId = 1; } - + message FutureProofMessage { optional Message message = 1; } - + message GroupInviteMessage { optional string groupJid = 1; optional string inviteCode = 2; @@ -2168,7 +2168,7 @@ message Message { PARENT = 1; } } - + message HighlyStructuredMessage { optional string namespace = 1; optional string elementName = 2; @@ -2189,7 +2189,7 @@ message Message { optional string currencyCode = 1; optional int64 amount1000 = 2; } - + message HSMDateTime { oneof datetimeOneof { Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent component = 1; @@ -2217,17 +2217,17 @@ message Message { SUNDAY = 7; } } - + message HSMDateTimeUnixEpoch { optional int64 timestamp = 1; } - + } - + } - + } - + message HistorySyncNotification { optional bytes fileSha256 = 1; optional uint64 fileLength = 2; @@ -2254,7 +2254,7 @@ message Message { NO_HISTORY = 7; } } - + message ImageMessage { optional string url = 1; optional string mimetype = 2; @@ -2292,11 +2292,11 @@ message Message { RASTERIZED_TEXT_STATUS = 3; } } - + message InitialSecurityNotificationSettingSync { optional bool securityNotificationEnabled = 1; } - + message InteractiveMessage { optional Header header = 1; optional Body body = 2; @@ -2312,22 +2312,22 @@ message Message { message Body { optional string text = 1; } - + message CarouselMessage { repeated Message.InteractiveMessage cards = 1; optional int32 messageVersion = 2; } - + message CollectionMessage { optional string bizJid = 1; optional string id = 2; optional int32 messageVersion = 3; } - + message Footer { optional string text = 1; } - + message Header { optional string title = 1; optional string subtitle = 2; @@ -2341,7 +2341,7 @@ message Message { Message.ProductMessage productMessage = 9; } } - + message NativeFlowMessage { repeated NativeFlowButton buttons = 1; optional string messageParamsJson = 2; @@ -2350,9 +2350,9 @@ message Message { optional string name = 1; optional string buttonParamsJson = 2; } - + } - + message ShopMessage { optional string id = 1; optional Surface surface = 2; @@ -2364,9 +2364,9 @@ message Message { WA = 3; } } - + } - + message InteractiveResponseMessage { optional Body body = 1; optional ContextInfo contextInfo = 15; @@ -2381,15 +2381,15 @@ message Message { EXTENSIONS_1 = 1; } } - + message NativeFlowResponseMessage { optional string name = 1; optional string paramsJson = 2; optional int32 version = 3; } - + } - + message InvoiceMessage { optional string note = 1; optional string token = 2; @@ -2406,19 +2406,19 @@ message Message { PDF = 1; } } - + message KeepInChatMessage { optional MessageKey key = 1; optional KeepType keepType = 2; optional int64 timestampMs = 3; } - + message LinkPreviewMetadata { optional Message.PaymentLinkMetadata paymentLinkMetadata = 1; optional Message.URLMetadata urlMetadata = 2; optional uint32 fbExperimentId = 3; } - + message ListMessage { optional string title = 1; optional string description = 2; @@ -2436,36 +2436,36 @@ message Message { message Product { optional string productId = 1; } - + message ProductListHeaderImage { optional string productId = 1; optional bytes jpegThumbnail = 2; } - + message ProductListInfo { repeated Message.ListMessage.ProductSection productSections = 1; optional Message.ListMessage.ProductListHeaderImage headerImage = 2; optional string businessOwnerJid = 3; } - + message ProductSection { optional string title = 1; repeated Message.ListMessage.Product products = 2; } - + message Row { optional string title = 1; optional string description = 2; optional string rowId = 3; } - + message Section { optional string title = 1; repeated Message.ListMessage.Row rows = 2; } - + } - + message ListResponseMessage { optional string title = 1; optional ListType listType = 2; @@ -2479,9 +2479,9 @@ message Message { message SingleSelectReply { optional string selectedRowId = 1; } - + } - + message LiveLocationMessage { optional double degreesLatitude = 1; optional double degreesLongitude = 2; @@ -2494,7 +2494,7 @@ message Message { optional bytes jpegThumbnail = 16; optional ContextInfo contextInfo = 17; } - + message LocationMessage { optional double degreesLatitude = 1; optional double degreesLongitude = 2; @@ -2509,7 +2509,7 @@ message Message { optional bytes jpegThumbnail = 16; optional ContextInfo contextInfo = 17; } - + message MMSThumbnailMetadata { optional string thumbnailDirectPath = 1; optional bytes thumbnailSha256 = 2; @@ -2519,7 +2519,7 @@ message Message { optional uint32 thumbnailHeight = 6; optional uint32 thumbnailWidth = 7; } - + message MessageHistoryBundle { optional string mimetype = 1; optional bytes fileSha256 = 2; @@ -2530,18 +2530,18 @@ message Message { optional ContextInfo contextInfo = 7; optional Message.MessageHistoryMetadata messageHistoryMetadata = 8; } - + message MessageHistoryMetadata { repeated string historyReceivers = 1; optional int64 firstMessageTimestamp = 2; optional int64 messageCount = 3; } - + message MessageHistoryNotice { optional ContextInfo contextInfo = 1; optional Message.MessageHistoryMetadata messageHistoryMetadata = 2; } - + message NewsletterAdminInviteMessage { optional string newsletterJid = 1; optional string newsletterName = 2; @@ -2550,7 +2550,7 @@ message Message { optional int64 inviteExpiration = 5; optional ContextInfo contextInfo = 6; } - + message OrderMessage { optional string orderId = 1; optional bytes thumbnail = 2; @@ -2576,7 +2576,7 @@ message Message { CATALOG = 1; } } - + message PaymentInviteMessage { optional ServiceType serviceType = 1; optional int64 expiryTimestamp = 2; @@ -2587,14 +2587,14 @@ message Message { UPI = 3; } } - + message PaymentLinkMetadata { optional PaymentLinkButton button = 1; optional PaymentLinkHeader header = 2; message PaymentLinkButton { optional string displayText = 1; } - + message PaymentLinkHeader { optional PaymentLinkHeaderType headerType = 1; enum PaymentLinkHeaderType { @@ -2602,9 +2602,9 @@ message Message { ORDER = 1; } } - + } - + message PeerDataOperationRequestMessage { optional Message.PeerDataOperationRequestType peerDataOperationRequestType = 1; repeated RequestStickerReupload requestStickerReupload = 2; @@ -2617,7 +2617,7 @@ message Message { optional Message.FullHistorySyncOnDemandRequestMetadata requestMetadata = 1; optional DeviceProps.HistorySyncConfig historySyncConfig = 2; } - + message HistorySyncOnDemandRequest { optional string chatJid = 1; optional string oldestMsgId = 2; @@ -2626,27 +2626,27 @@ message Message { optional int64 oldestMsgTimestampMs = 5; optional string accountLid = 6; } - + message PlaceholderMessageResendRequest { optional MessageKey messageKey = 1; } - + message RequestStickerReupload { optional string fileSha256 = 1; } - + message RequestUrlPreview { optional string url = 1; optional bool includeHqThumbnail = 2; } - + message SyncDCollectionFatalRecoveryRequest { optional string collectionName = 1; optional int64 timestamp = 2; } - + } - + message PeerDataOperationRequestResponseMessage { optional Message.PeerDataOperationRequestType peerDataOperationRequestType = 1; optional string stanzaId = 2; @@ -2663,12 +2663,12 @@ message Message { message CompanionMetaNonceFetchResponse { optional string nonce = 1; } - + message FullHistorySyncOnDemandRequestResponse { optional Message.FullHistorySyncOnDemandRequestMetadata requestMetadata = 1; optional Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode responseCode = 2; } - + enum FullHistorySyncOnDemandResponseCode { REQUEST_SUCCESS = 0; REQUEST_TIME_EXPIRED = 1; @@ -2695,27 +2695,27 @@ message Message { optional int32 thumbWidth = 6; optional int32 thumbHeight = 7; } - + } - + message PlaceholderMessageResendResponse { optional bytes webMessageInfoBytes = 1; } - + message SyncDSnapshotFatalRecoveryResponse { optional bytes collectionSnapshot = 1; optional bool isCompressed = 2; } - + message WaffleNonceFetchResponse { optional string nonce = 1; optional string waEntFbid = 2; } - + } - + } - + enum PeerDataOperationRequestType { UPLOAD_STICKER = 0; SEND_RECENT_STICKER_BOOTSTRAP = 1; @@ -2737,14 +2737,14 @@ message Message { UNPIN_FOR_ALL = 2; } } - + message PlaceholderMessage { optional PlaceholderType type = 1; enum PlaceholderType { MASK_LINKED_DEVICES = 0; } } - + enum PollContentType { UNKNOWN = 0; TEXT = 1; @@ -2763,18 +2763,18 @@ message Message { optional string optionName = 1; optional string optionHash = 2; } - + enum PollType { POLL = 0; QUIZ = 1; } } - + message PollEncValue { optional bytes encPayload = 1; optional bytes encIv = 2; } - + message PollResultSnapshotMessage { optional string name = 1; repeated PollVote pollVotes = 2; @@ -2783,23 +2783,23 @@ message Message { optional string optionName = 1; optional int64 optionVoteCount = 2; } - + } - + message PollUpdateMessage { optional MessageKey pollCreationMessageKey = 1; optional Message.PollEncValue vote = 2; optional Message.PollUpdateMessageMetadata metadata = 3; optional int64 senderTimestampMs = 4; } - + message PollUpdateMessageMetadata { } - + message PollVoteMessage { repeated bytes selectedOptions = 1; } - + message ProductMessage { optional ProductSnapshot product = 1; optional string businessOwnerJid = 2; @@ -2812,7 +2812,7 @@ message Message { optional string title = 2; optional string description = 3; } - + message ProductSnapshot { optional Message.ImageMessage productImage = 1; optional string productId = 2; @@ -2827,9 +2827,9 @@ message Message { optional int64 salePriceAmount1000 = 12; optional string signedUrl = 13; } - + } - + message ProtocolMessage { optional MessageKey key = 1; optional Type type = 2; @@ -2884,14 +2884,14 @@ message Message { GROUP_MEMBER_LABEL_CHANGE = 30; } } - + message ReactionMessage { optional MessageKey key = 1; optional string text = 2; optional string groupingKey = 3; optional int64 senderTimestampMs = 4; } - + message RequestPaymentMessage { optional Message noteMessage = 4; optional string currencyCodeIso4217 = 1; @@ -2901,11 +2901,11 @@ message Message { optional Money amount = 6; optional PaymentBackground background = 7; } - + message RequestPhoneNumberMessage { optional ContextInfo contextInfo = 1; } - + message RequestWelcomeMessageMetadata { optional LocalChatState localChatState = 1; enum LocalChatState { @@ -2913,7 +2913,7 @@ message Message { NON_EMPTY = 1; } } - + message ScheduledCallCreationMessage { optional int64 scheduledTimestampMs = 1; optional CallType callType = 2; @@ -2924,7 +2924,7 @@ message Message { VIDEO = 2; } } - + message ScheduledCallEditMessage { optional MessageKey key = 1; optional EditType editType = 2; @@ -2933,7 +2933,7 @@ message Message { CANCEL = 1; } } - + message SecretEncryptedMessage { optional MessageKey targetMessageKey = 1; optional bytes encPayload = 2; @@ -2945,18 +2945,18 @@ message Message { MESSAGE_EDIT = 2; } } - + message SendPaymentMessage { optional Message noteMessage = 2; optional MessageKey requestMessageKey = 3; optional PaymentBackground background = 4; } - + message SenderKeyDistributionMessage { optional string groupId = 1; optional bytes axolotlSenderKeyDistributionMessage = 2; } - + message StatusNotificationMessage { optional MessageKey responseMessageKey = 1; optional MessageKey originalMessageKey = 2; @@ -2967,7 +2967,7 @@ message Message { STATUS_RESHARE = 2; } } - + message StickerMessage { optional string url = 1; optional bytes fileSha256 = 2; @@ -2990,7 +2990,7 @@ message Message { optional bool isLottie = 21; optional string accessibilityLabel = 22; } - + message StickerPackMessage { optional string stickerPackId = 1; optional string name = 2; @@ -3022,20 +3022,20 @@ message Message { optional bool isLottie = 5; optional string mimetype = 6; } - + enum StickerPackOrigin { FIRST_PARTY = 0; THIRD_PARTY = 1; USER_CREATED = 2; } } - + message StickerSyncRMRMessage { repeated string filehash = 1; optional string rmrSource = 2; optional int64 requestTimestamp = 3; } - + message TemplateButtonReplyMessage { optional string selectedId = 1; optional string selectedDisplayText = 2; @@ -3043,7 +3043,7 @@ message Message { optional uint32 selectedIndex = 4; optional uint32 selectedCarouselCardIndex = 5; } - + message TemplateMessage { optional ContextInfo contextInfo = 3; optional HydratedFourRowTemplate hydratedTemplate = 4; @@ -3065,7 +3065,7 @@ message Message { Message.LocationMessage locationMessage = 5; } } - + message HydratedFourRowTemplate { optional string hydratedContentText = 6; optional string hydratedFooterText = 7; @@ -3080,13 +3080,13 @@ message Message { Message.LocationMessage locationMessage = 5; } } - + } - + message URLMetadata { optional uint32 fbExperimentId = 1; } - + message VideoMessage { optional string url = 1; optional string mimetype = 2; @@ -3121,7 +3121,7 @@ message Message { TENOR = 2; } } - + } message MessageAddOn { @@ -3258,7 +3258,7 @@ message MsgOpaqueData { optional string url = 5; optional bytes jpegThumbnail = 6; } - + enum PollContentType { UNKNOWN = 0; TEXT = 1; @@ -3268,16 +3268,16 @@ message MsgOpaqueData { optional string name = 1; optional string hash = 2; } - + message PollVoteSnapshot { optional MsgOpaqueData.PollOption option = 1; optional int32 optionVoteCount = 2; } - + message PollVotesSnapshot { repeated MsgOpaqueData.PollVoteSnapshot pollVotes = 1; } - + } message MsgRowOpaqueData { @@ -3295,7 +3295,7 @@ message NoiseCertificate { optional string subject = 4; optional bytes key = 5; } - + } message NotificationMessageInfo { @@ -3378,7 +3378,7 @@ message PaymentBackground { optional bytes fileEncSha256 = 4; optional string directPath = 5; } - + enum Type { UNKNOWN = 0; DEFAULT = 1; @@ -3612,17 +3612,17 @@ message SenderKeyStateStructure { optional uint32 iteration = 1; optional bytes seed = 2; } - + message SenderMessageKey { optional uint32 iteration = 1; optional bytes seed = 2; } - + message SenderSigningKey { optional bytes public = 1; optional bytes private = 2; } - + } message ServerErrorReceipt { @@ -3652,16 +3652,16 @@ message SessionStructure { optional uint32 index = 1; optional bytes key = 2; } - + message MessageKey { optional uint32 index = 1; optional bytes cipherKey = 2; optional bytes macKey = 3; optional bytes iv = 4; } - + } - + message PendingKeyExchange { optional uint32 sequence = 1; optional bytes localBaseKey = 2; @@ -3671,13 +3671,13 @@ message SessionStructure { optional bytes localIdentityKey = 7; optional bytes localIdentityKeyPrivate = 8; } - + message PendingPreKey { optional uint32 preKeyId = 1; optional int32 signedPreKeyId = 3; optional bytes baseKey = 2; } - + } message SignalMessage { @@ -3700,7 +3700,7 @@ message StatusMentionMessage { } message StatusPSA { - required uint64 campaignId = 44; + uint64 campaignId = 44; optional uint64 campaignExpirationTimestamp = 45; } @@ -3789,36 +3789,36 @@ message SyncActionValue { optional int32 deviceID = 2; optional bool isDeleted = 3; } - + message AndroidUnsupportedActions { optional bool allowed = 1; } - + message ArchiveChatAction { optional bool archived = 1; optional SyncActionValue.SyncActionMessageRange messageRange = 2; } - + message BotWelcomeRequestAction { optional bool isSent = 1; } - + message CallLogAction { optional CallLogRecord callLogRecord = 1; } - + message ChatAssignmentAction { optional string deviceAgentID = 1; } - + message ChatAssignmentOpenedStatusAction { optional bool chatOpened = 1; } - + message ClearChatAction { optional SyncActionValue.SyncActionMessageRange messageRange = 1; } - + message ContactAction { optional string fullName = 1; optional string firstName = 2; @@ -3827,61 +3827,61 @@ message SyncActionValue { optional string pnJid = 5; optional string username = 6; } - + message CtwaPerCustomerDataSharingAction { optional bool isCtwaPerCustomerDataSharingEnabled = 1; } - + message CustomPaymentMethod { - required string credentialId = 1; - required string country = 2; - required string type = 3; + string credentialId = 1; + string country = 2; + string type = 3; repeated SyncActionValue.CustomPaymentMethodMetadata metadata = 4; } - + message CustomPaymentMethodMetadata { - required string key = 1; - required string value = 2; + string key = 1; + string value = 2; } - + message CustomPaymentMethodsAction { repeated SyncActionValue.CustomPaymentMethod customPaymentMethods = 1; } - + message DeleteChatAction { optional SyncActionValue.SyncActionMessageRange messageRange = 1; } - + message DeleteIndividualCallLogAction { optional string peerJid = 1; optional bool isIncoming = 2; } - + message DeleteMessageForMeAction { optional bool deleteMedia = 1; optional int64 messageTimestamp = 2; } - + message ExternalWebBetaAction { optional bool isOptIn = 1; } - + message FavoritesAction { repeated Favorite favorites = 1; message Favorite { optional string id = 1; } - + } - + message KeyExpiration { optional int32 expiredKeyEpoch = 1; } - + message LabelAssociationAction { optional bool labeled = 1; } - + message LabelEditAction { optional string name = 1; optional int32 color = 2; @@ -3902,31 +3902,31 @@ message SyncActionValue { SERVER_ASSIGNED = 7; } } - + message LabelReorderingAction { repeated int32 sortedLabelIds = 1; } - + message LidContactAction { optional string fullName = 1; optional string firstName = 2; optional string username = 3; optional bool saveOnPrimaryAddressbook = 4; } - + message LocaleSetting { optional string locale = 1; } - + message LockChatAction { optional bool locked = 1; } - + message MarkChatAsReadAction { optional bool read = 1; optional SyncActionValue.SyncActionMessageRange messageRange = 2; } - + message MarketingMessageAction { optional string name = 1; optional string message = 2; @@ -3939,14 +3939,14 @@ message SyncActionValue { PERSONALIZED = 0; } } - + message MarketingMessageBroadcastAction { optional int32 repliedCount = 1; } - + message MerchantPaymentPartnerAction { - required Status status = 1; - required string country = 2; + Status status = 1; + string country = 2; optional string gatewayName = 3; optional string credentialId = 4; enum Status { @@ -3954,13 +3954,13 @@ message SyncActionValue { INACTIVE = 1; } } - + message MuteAction { optional bool muted = 1; optional int64 muteEndTimestamp = 2; optional bool autoMuted = 3; } - + message NoteEditAction { optional NoteType type = 1; optional string chatJid = 2; @@ -3972,7 +3972,7 @@ message SyncActionValue { STRUCTURED = 2; } } - + message NotificationActivitySettingAction { optional NotificationActivitySetting notificationActivitySetting = 1; enum NotificationActivitySetting { @@ -3982,51 +3982,51 @@ message SyncActionValue { DEFAULT_HIGHLIGHTS = 3; } } - + message NuxAction { optional bool acknowledged = 1; } - + message PaymentInfoAction { optional string cpi = 1; } - + message PaymentTosAction { - required PaymentNotice paymentNotice = 1; - required bool accepted = 2; + PaymentNotice paymentNotice = 1; + bool accepted = 2; enum PaymentNotice { BR_PAY_PRIVACY_POLICY = 0; } } - + message PinAction { optional bool pinned = 1; } - + message PnForLidChatAction { optional string pnJid = 1; } - + message PrimaryFeature { repeated string flags = 1; } - + message PrimaryVersionAction { optional string version = 1; } - + message PrivacySettingDisableLinkPreviewsAction { optional bool isPreviewsDisabled = 1; } - + message PrivacySettingRelayAllCalls { optional bool isEnabled = 1; } - + message PushNameSetting { optional string name = 1; } - + message QuickReplyAction { optional string shortcut = 1; optional string message = 2; @@ -4034,23 +4034,23 @@ message SyncActionValue { optional int32 count = 4; optional bool deleted = 5; } - + message RecentEmojiWeightsAction { repeated RecentEmojiWeight weights = 1; } - + message RemoveRecentStickerAction { optional int64 lastStickerSentTs = 1; } - + message SecurityNotificationSetting { optional bool showNotification = 1; } - + message StarAction { optional bool starred = 1; } - + message StatusPrivacyAction { optional StatusDistributionMode mode = 1; repeated string userJid = 2; @@ -4060,7 +4060,7 @@ message SyncActionValue { CONTACTS = 2; } } - + message StickerAction { optional string url = 1; optional bytes fileEncSha256 = 2; @@ -4074,36 +4074,36 @@ message SyncActionValue { optional uint32 deviceIdHint = 10; optional bool isLottie = 11; } - + message SubscriptionAction { optional bool isDeactivated = 1; optional bool isAutoRenewing = 2; optional int64 expirationDate = 3; } - + message SyncActionMessage { optional MessageKey key = 1; optional int64 timestamp = 2; } - + message SyncActionMessageRange { optional int64 lastMessageTimestamp = 1; optional int64 lastSystemMessageTimestamp = 2; repeated SyncActionValue.SyncActionMessage messages = 3; } - + message TimeFormatAction { optional bool isTwentyFourHourFormatEnabled = 1; } - + message UnarchiveChatsSetting { optional bool unarchiveChats = 1; } - + message UserStatusMuteAction { optional bool muted = 1; } - + message UsernameChatStartModeAction { optional ChatStartMode chatStartMode = 1; enum ChatStartMode { @@ -4111,18 +4111,18 @@ message SyncActionValue { PN = 2; } } - + message WaffleAccountLinkStateAction { optional AccountLinkState linkState = 2; enum AccountLinkState { ACTIVE = 0; } } - + message WamoUserIdentifierAction { optional string identifier = 1; } - + } message SyncdIndex { @@ -4191,17 +4191,17 @@ message TemplateButton { optional Message.HighlyStructuredMessage displayText = 1; optional Message.HighlyStructuredMessage phoneNumber = 2; } - + message QuickReplyButton { optional Message.HighlyStructuredMessage displayText = 1; optional string id = 2; } - + message URLButton { optional Message.HighlyStructuredMessage displayText = 1; optional Message.HighlyStructuredMessage url = 2; } - + } message UrlTrackingMap { @@ -4212,7 +4212,7 @@ message UrlTrackingMap { optional string consentedUsersUrl = 3; optional uint32 cardIndex = 4; } - + } message UserPassword { @@ -4238,13 +4238,13 @@ message UserPassword { uint32 asUnsignedInteger = 2; } } - + } - + } message UserReceipt { - required string userJid = 1; + string userJid = 1; optional int64 receiptTimestamp = 2; optional int64 readTimestamp = 3; optional int64 playedTimestamp = 4; @@ -4263,7 +4263,7 @@ message VerifiedNameCertificate { repeated LocalizedName localizedNames = 8; optional uint64 issueTime = 10; } - + } message WallpaperSettings { @@ -4326,7 +4326,7 @@ message WebFeatures { } message WebMessageInfo { - required MessageKey key = 1; + MessageKey key = 1; optional Message message = 2; optional uint64 messageTimestamp = 3; optional Status status = 4; diff --git a/WAProto/index.d.ts b/WAProto/index.d.ts index d8d7b811..b1e9538c 100644 --- a/WAProto/index.d.ts +++ b/WAProto/index.d.ts @@ -12,14 +12,17 @@ export namespace proto { class ADVDeviceIdentity implements IADVDeviceIdentity { constructor(p?: proto.IADVDeviceIdentity); - public rawId: number; - public timestamp: (number|Long); - public keyIndex: number; - public accountType: proto.ADVEncryptionType; - public deviceType: proto.ADVEncryptionType; + public rawId?: (number|null); + public timestamp?: (number|Long|null); + public keyIndex?: (number|null); + public accountType?: (proto.ADVEncryptionType|null); + public deviceType?: (proto.ADVEncryptionType|null); public static create(properties?: proto.IADVDeviceIdentity): proto.ADVDeviceIdentity; public static encode(m: proto.IADVDeviceIdentity, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ADVDeviceIdentity; + public static fromObject(d: { [k: string]: any }): proto.ADVDeviceIdentity; + public static toObject(m: proto.ADVDeviceIdentity, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -38,14 +41,17 @@ export namespace proto { class ADVKeyIndexList implements IADVKeyIndexList { constructor(p?: proto.IADVKeyIndexList); - public rawId: number; - public timestamp: (number|Long); - public currentIndex: number; + public rawId?: (number|null); + public timestamp?: (number|Long|null); + public currentIndex?: (number|null); public validIndexes: number[]; - public accountType: proto.ADVEncryptionType; + public accountType?: (proto.ADVEncryptionType|null); public static create(properties?: proto.IADVKeyIndexList): proto.ADVKeyIndexList; public static encode(m: proto.IADVKeyIndexList, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ADVKeyIndexList; + public static fromObject(d: { [k: string]: any }): proto.ADVKeyIndexList; + public static toObject(m: proto.ADVKeyIndexList, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -58,13 +64,16 @@ export namespace proto { class ADVSignedDeviceIdentity implements IADVSignedDeviceIdentity { constructor(p?: proto.IADVSignedDeviceIdentity); - public details: Uint8Array; - public accountSignatureKey: Uint8Array; - public accountSignature: Uint8Array; - public deviceSignature: Uint8Array; + public details?: (Uint8Array|null); + public accountSignatureKey?: (Uint8Array|null); + public accountSignature?: (Uint8Array|null); + public deviceSignature?: (Uint8Array|null); public static create(properties?: proto.IADVSignedDeviceIdentity): proto.ADVSignedDeviceIdentity; public static encode(m: proto.IADVSignedDeviceIdentity, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ADVSignedDeviceIdentity; + public static fromObject(d: { [k: string]: any }): proto.ADVSignedDeviceIdentity; + public static toObject(m: proto.ADVSignedDeviceIdentity, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -76,12 +85,15 @@ export namespace proto { class ADVSignedDeviceIdentityHMAC implements IADVSignedDeviceIdentityHMAC { constructor(p?: proto.IADVSignedDeviceIdentityHMAC); - public details: Uint8Array; - public hmac: Uint8Array; - public accountType: proto.ADVEncryptionType; + public details?: (Uint8Array|null); + public hmac?: (Uint8Array|null); + public accountType?: (proto.ADVEncryptionType|null); public static create(properties?: proto.IADVSignedDeviceIdentityHMAC): proto.ADVSignedDeviceIdentityHMAC; public static encode(m: proto.IADVSignedDeviceIdentityHMAC, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ADVSignedDeviceIdentityHMAC; + public static fromObject(d: { [k: string]: any }): proto.ADVSignedDeviceIdentityHMAC; + public static toObject(m: proto.ADVSignedDeviceIdentityHMAC, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -93,12 +105,15 @@ export namespace proto { class ADVSignedKeyIndexList implements IADVSignedKeyIndexList { constructor(p?: proto.IADVSignedKeyIndexList); - public details: Uint8Array; - public accountSignature: Uint8Array; - public accountSignatureKey: Uint8Array; + public details?: (Uint8Array|null); + public accountSignature?: (Uint8Array|null); + public accountSignatureKey?: (Uint8Array|null); public static create(properties?: proto.IADVSignedKeyIndexList): proto.ADVSignedKeyIndexList; public static encode(m: proto.IADVSignedKeyIndexList, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ADVSignedKeyIndexList; + public static fromObject(d: { [k: string]: any }): proto.ADVSignedKeyIndexList; + public static toObject(m: proto.ADVSignedKeyIndexList, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -112,10 +127,13 @@ export namespace proto { constructor(p?: proto.IAIQueryFanout); public messageKey?: (proto.IMessageKey|null); public message?: (proto.IMessage|null); - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public static create(properties?: proto.IAIQueryFanout): proto.AIQueryFanout; public static encode(m: proto.IAIQueryFanout, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIQueryFanout; + public static fromObject(d: { [k: string]: any }): proto.AIQueryFanout; + public static toObject(m: proto.AIQueryFanout, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -127,12 +145,15 @@ export namespace proto { class AIRichResponseMessage implements IAIRichResponseMessage { constructor(p?: proto.IAIRichResponseMessage); - public messageType: proto.AIRichResponseMessage.AIRichResponseMessageType; + public messageType?: (proto.AIRichResponseMessage.AIRichResponseMessageType|null); public submessages: proto.AIRichResponseMessage.IAIRichResponseSubMessage[]; public unifiedResponse?: (proto.AIRichResponseMessage.IAIRichResponseUnifiedResponse|null); public static create(properties?: proto.IAIRichResponseMessage): proto.AIRichResponseMessage; public static encode(m: proto.IAIRichResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage; + public static toObject(m: proto.AIRichResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -145,11 +166,14 @@ export namespace proto { class AIRichResponseCodeMetadata implements IAIRichResponseCodeMetadata { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseCodeMetadata); - public codeLanguage: string; + public codeLanguage?: (string|null); public codeBlocks: proto.AIRichResponseMessage.AIRichResponseCodeMetadata.IAIRichResponseCodeBlock[]; public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseCodeMetadata): proto.AIRichResponseMessage.AIRichResponseCodeMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseCodeMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseCodeMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseCodeMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseCodeMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -162,11 +186,14 @@ export namespace proto { class AIRichResponseCodeBlock implements IAIRichResponseCodeBlock { constructor(p?: proto.AIRichResponseMessage.AIRichResponseCodeMetadata.IAIRichResponseCodeBlock); - public highlightType: proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType; - public codeContent: string; + public highlightType?: (proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType|null); + public codeContent?: (string|null); public static create(properties?: proto.AIRichResponseMessage.AIRichResponseCodeMetadata.IAIRichResponseCodeBlock): proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock; public static encode(m: proto.AIRichResponseMessage.AIRichResponseCodeMetadata.IAIRichResponseCodeBlock, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -188,10 +215,13 @@ export namespace proto { class AIRichResponseContentItemsMetadata implements IAIRichResponseContentItemsMetadata { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseContentItemsMetadata); public itemsMetadata: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.IAIRichResponseContentItemMetadata[]; - public contentType: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.ContentType; + public contentType?: (proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.ContentType|null); public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseContentItemsMetadata): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseContentItemsMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -208,6 +238,9 @@ export namespace proto { public static create(properties?: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.IAIRichResponseContentItemMetadata): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata; public static encode(m: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.IAIRichResponseContentItemMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -220,13 +253,16 @@ export namespace proto { class AIRichResponseReelItem implements IAIRichResponseReelItem { constructor(p?: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.IAIRichResponseReelItem); - public title: string; - public profileIconUrl: string; - public thumbnailUrl: string; - public videoUrl: string; + public title?: (string|null); + public profileIconUrl?: (string|null); + public thumbnailUrl?: (string|null); + public videoUrl?: (string|null); public static create(properties?: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.IAIRichResponseReelItem): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem; public static encode(m: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.IAIRichResponseReelItem, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -245,13 +281,16 @@ export namespace proto { class AIRichResponseDynamicMetadata implements IAIRichResponseDynamicMetadata { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseDynamicMetadata); - public type: proto.AIRichResponseMessage.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType; - public version: (number|Long); - public url: string; - public loopCount: number; + public type?: (proto.AIRichResponseMessage.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType|null); + public version?: (number|Long|null); + public url?: (string|null); + public loopCount?: (number|null); public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseDynamicMetadata): proto.AIRichResponseMessage.AIRichResponseDynamicMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseDynamicMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseDynamicMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseDynamicMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseDynamicMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -276,6 +315,9 @@ export namespace proto { public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseGridImageMetadata): proto.AIRichResponseMessage.AIRichResponseGridImageMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseGridImageMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseGridImageMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseGridImageMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseGridImageMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -287,12 +329,15 @@ export namespace proto { class AIRichResponseImageURL implements IAIRichResponseImageURL { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseImageURL); - public imagePreviewUrl: string; - public imageHighResUrl: string; - public sourceUrl: string; + public imagePreviewUrl?: (string|null); + public imageHighResUrl?: (string|null); + public sourceUrl?: (string|null); public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseImageURL): proto.AIRichResponseMessage.AIRichResponseImageURL; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseImageURL, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseImageURL; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseImageURL; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseImageURL, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -306,12 +351,15 @@ export namespace proto { class AIRichResponseInlineImageMetadata implements IAIRichResponseInlineImageMetadata { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseInlineImageMetadata); public imageUrl?: (proto.AIRichResponseMessage.IAIRichResponseImageURL|null); - public imageText: string; - public alignment: proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment; - public tapLinkUrl: string; + public imageText?: (string|null); + public alignment?: (proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment|null); + public tapLinkUrl?: (string|null); public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseInlineImageMetadata): proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseInlineImageMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -331,11 +379,14 @@ export namespace proto { class AIRichResponseLatexMetadata implements IAIRichResponseLatexMetadata { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseLatexMetadata); - public text: string; + public text?: (string|null); public expressions: proto.AIRichResponseMessage.AIRichResponseLatexMetadata.IAIRichResponseLatexExpression[]; public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseLatexMetadata): proto.AIRichResponseMessage.AIRichResponseLatexMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseLatexMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseLatexMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseLatexMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseLatexMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -355,18 +406,21 @@ export namespace proto { class AIRichResponseLatexExpression implements IAIRichResponseLatexExpression { constructor(p?: proto.AIRichResponseMessage.AIRichResponseLatexMetadata.IAIRichResponseLatexExpression); - public latexExpression: string; - public url: string; - public width: number; - public height: number; - public fontHeight: number; - public imageTopPadding: number; - public imageLeadingPadding: number; - public imageBottomPadding: number; - public imageTrailingPadding: number; + public latexExpression?: (string|null); + public url?: (string|null); + public width?: (number|null); + public height?: (number|null); + public fontHeight?: (number|null); + public imageTopPadding?: (number|null); + public imageLeadingPadding?: (number|null); + public imageBottomPadding?: (number|null); + public imageTrailingPadding?: (number|null); public static create(properties?: proto.AIRichResponseMessage.AIRichResponseLatexMetadata.IAIRichResponseLatexExpression): proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression; public static encode(m: proto.AIRichResponseMessage.AIRichResponseLatexMetadata.IAIRichResponseLatexExpression, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -382,15 +436,18 @@ export namespace proto { class AIRichResponseMapMetadata implements IAIRichResponseMapMetadata { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseMapMetadata); - public centerLatitude: number; - public centerLongitude: number; - public latitudeDelta: number; - public longitudeDelta: number; + public centerLatitude?: (number|null); + public centerLongitude?: (number|null); + public latitudeDelta?: (number|null); + public longitudeDelta?: (number|null); public annotations: proto.AIRichResponseMessage.AIRichResponseMapMetadata.IAIRichResponseMapAnnotation[]; - public showInfoList: boolean; + public showInfoList?: (boolean|null); public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseMapMetadata): proto.AIRichResponseMessage.AIRichResponseMapMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseMapMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseMapMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseMapMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseMapMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -406,14 +463,17 @@ export namespace proto { class AIRichResponseMapAnnotation implements IAIRichResponseMapAnnotation { constructor(p?: proto.AIRichResponseMessage.AIRichResponseMapMetadata.IAIRichResponseMapAnnotation); - public annotationNumber: number; - public latitude: number; - public longitude: number; - public title: string; - public body: string; + public annotationNumber?: (number|null); + public latitude?: (number|null); + public longitude?: (number|null); + public title?: (string|null); + public body?: (string|null); public static create(properties?: proto.AIRichResponseMessage.AIRichResponseMapMetadata.IAIRichResponseMapAnnotation): proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation; public static encode(m: proto.AIRichResponseMessage.AIRichResponseMapMetadata.IAIRichResponseMapAnnotation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -438,9 +498,9 @@ export namespace proto { class AIRichResponseSubMessage implements IAIRichResponseSubMessage { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseSubMessage); - public messageType: proto.AIRichResponseMessage.AIRichResponseSubMessageType; + public messageType?: (proto.AIRichResponseMessage.AIRichResponseSubMessageType|null); public gridImageMetadata?: (proto.AIRichResponseMessage.IAIRichResponseGridImageMetadata|null); - public messageText: string; + public messageText?: (string|null); public imageMetadata?: (proto.AIRichResponseMessage.IAIRichResponseInlineImageMetadata|null); public codeMetadata?: (proto.AIRichResponseMessage.IAIRichResponseCodeMetadata|null); public tableMetadata?: (proto.AIRichResponseMessage.IAIRichResponseTableMetadata|null); @@ -451,6 +511,9 @@ export namespace proto { public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseSubMessage): proto.AIRichResponseMessage.AIRichResponseSubMessage; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseSubMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseSubMessage; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseSubMessage; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseSubMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -477,6 +540,9 @@ export namespace proto { public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseTableMetadata): proto.AIRichResponseMessage.AIRichResponseTableMetadata; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseTableMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseTableMetadata; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseTableMetadata; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseTableMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -490,10 +556,13 @@ export namespace proto { class AIRichResponseTableRow implements IAIRichResponseTableRow { constructor(p?: proto.AIRichResponseMessage.AIRichResponseTableMetadata.IAIRichResponseTableRow); public items: string[]; - public isHeading: boolean; + public isHeading?: (boolean|null); public static create(properties?: proto.AIRichResponseMessage.AIRichResponseTableMetadata.IAIRichResponseTableRow): proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow; public static encode(m: proto.AIRichResponseMessage.AIRichResponseTableMetadata.IAIRichResponseTableRow, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -504,10 +573,13 @@ export namespace proto { class AIRichResponseUnifiedResponse implements IAIRichResponseUnifiedResponse { constructor(p?: proto.AIRichResponseMessage.IAIRichResponseUnifiedResponse); - public data: Uint8Array; + public data?: (Uint8Array|null); public static create(properties?: proto.AIRichResponseMessage.IAIRichResponseUnifiedResponse): proto.AIRichResponseMessage.AIRichResponseUnifiedResponse; public static encode(m: proto.AIRichResponseMessage.IAIRichResponseUnifiedResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AIRichResponseMessage.AIRichResponseUnifiedResponse; + public static fromObject(d: { [k: string]: any }): proto.AIRichResponseMessage.AIRichResponseUnifiedResponse; + public static toObject(m: proto.AIRichResponseMessage.AIRichResponseUnifiedResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -521,13 +593,16 @@ export namespace proto { class Account implements IAccount { constructor(p?: proto.IAccount); - public lid: string; - public username: string; - public countryCode: string; - public isUsernameDeleted: boolean; + public lid?: (string|null); + public username?: (string|null); + public countryCode?: (string|null); + public isUsernameDeleted?: (boolean|null); public static create(properties?: proto.IAccount): proto.Account; public static encode(m: proto.IAccount, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Account; + public static fromObject(d: { [k: string]: any }): proto.Account; + public static toObject(m: proto.Account, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -538,11 +613,14 @@ export namespace proto { class ActionLink implements IActionLink { constructor(p?: proto.IActionLink); - public url: string; - public buttonTitle: string; + public url?: (string|null); + public buttonTitle?: (string|null); public static create(properties?: proto.IActionLink): proto.ActionLink; public static encode(m: proto.IActionLink, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ActionLink; + public static fromObject(d: { [k: string]: any }): proto.ActionLink; + public static toObject(m: proto.ActionLink, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -555,13 +633,16 @@ export namespace proto { class AutoDownloadSettings implements IAutoDownloadSettings { constructor(p?: proto.IAutoDownloadSettings); - public downloadImages: boolean; - public downloadAudio: boolean; - public downloadVideo: boolean; - public downloadDocuments: boolean; + public downloadImages?: (boolean|null); + public downloadAudio?: (boolean|null); + public downloadVideo?: (boolean|null); + public downloadDocuments?: (boolean|null); public static create(properties?: proto.IAutoDownloadSettings): proto.AutoDownloadSettings; public static encode(m: proto.IAutoDownloadSettings, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AutoDownloadSettings; + public static fromObject(d: { [k: string]: any }): proto.AutoDownloadSettings; + public static toObject(m: proto.AutoDownloadSettings, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -572,11 +653,14 @@ export namespace proto { class AvatarUserSettings implements IAvatarUserSettings { constructor(p?: proto.IAvatarUserSettings); - public fbid: string; - public password: string; + public fbid?: (string|null); + public password?: (string|null); public static create(properties?: proto.IAvatarUserSettings): proto.AvatarUserSettings; public static encode(m: proto.IAvatarUserSettings, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AvatarUserSettings; + public static fromObject(d: { [k: string]: any }): proto.AvatarUserSettings; + public static toObject(m: proto.AvatarUserSettings, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -590,14 +674,17 @@ export namespace proto { class BizAccountLinkInfo implements IBizAccountLinkInfo { constructor(p?: proto.IBizAccountLinkInfo); - public whatsappBizAcctFbid: (number|Long); - public whatsappAcctNumber: string; - public issueTime: (number|Long); - public hostStorage: proto.BizAccountLinkInfo.HostStorageType; - public accountType: proto.BizAccountLinkInfo.AccountType; + public whatsappBizAcctFbid?: (number|Long|null); + public whatsappAcctNumber?: (string|null); + public issueTime?: (number|Long|null); + public hostStorage?: (proto.BizAccountLinkInfo.HostStorageType|null); + public accountType?: (proto.BizAccountLinkInfo.AccountType|null); public static create(properties?: proto.IBizAccountLinkInfo): proto.BizAccountLinkInfo; public static encode(m: proto.IBizAccountLinkInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BizAccountLinkInfo; + public static fromObject(d: { [k: string]: any }): proto.BizAccountLinkInfo; + public static toObject(m: proto.BizAccountLinkInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -621,10 +708,13 @@ export namespace proto { class BizAccountPayload implements IBizAccountPayload { constructor(p?: proto.IBizAccountPayload); public vnameCert?: (proto.IVerifiedNameCertificate|null); - public bizAcctLinkInfo: Uint8Array; + public bizAcctLinkInfo?: (Uint8Array|null); public static create(properties?: proto.IBizAccountPayload): proto.BizAccountPayload; public static encode(m: proto.IBizAccountPayload, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BizAccountPayload; + public static fromObject(d: { [k: string]: any }): proto.BizAccountPayload; + public static toObject(m: proto.BizAccountPayload, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -641,17 +731,20 @@ export namespace proto { class BizIdentityInfo implements IBizIdentityInfo { constructor(p?: proto.IBizIdentityInfo); - public vlevel: proto.BizIdentityInfo.VerifiedLevelValue; + public vlevel?: (proto.BizIdentityInfo.VerifiedLevelValue|null); public vnameCert?: (proto.IVerifiedNameCertificate|null); - public signed: boolean; - public revoked: boolean; - public hostStorage: proto.BizIdentityInfo.HostStorageType; - public actualActors: proto.BizIdentityInfo.ActualActorsType; - public privacyModeTs: (number|Long); - public featureControls: (number|Long); + public signed?: (boolean|null); + public revoked?: (boolean|null); + public hostStorage?: (proto.BizIdentityInfo.HostStorageType|null); + public actualActors?: (proto.BizIdentityInfo.ActualActorsType|null); + public privacyModeTs?: (number|Long|null); + public featureControls?: (number|Long|null); public static create(properties?: proto.IBizIdentityInfo): proto.BizIdentityInfo; public static encode(m: proto.IBizIdentityInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BizIdentityInfo; + public static fromObject(d: { [k: string]: any }): proto.BizIdentityInfo; + public static toObject(m: proto.BizIdentityInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -681,11 +774,14 @@ export namespace proto { class BotAgeCollectionMetadata implements IBotAgeCollectionMetadata { constructor(p?: proto.IBotAgeCollectionMetadata); - public ageCollectionEligible: boolean; - public shouldTriggerAgeCollectionOnClient: boolean; + public ageCollectionEligible?: (boolean|null); + public shouldTriggerAgeCollectionOnClient?: (boolean|null); public static create(properties?: proto.IBotAgeCollectionMetadata): proto.BotAgeCollectionMetadata; public static encode(m: proto.IBotAgeCollectionMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotAgeCollectionMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotAgeCollectionMetadata; + public static toObject(m: proto.BotAgeCollectionMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -699,14 +795,17 @@ export namespace proto { class BotAvatarMetadata implements IBotAvatarMetadata { constructor(p?: proto.IBotAvatarMetadata); - public sentiment: number; - public behaviorGraph: string; - public action: number; - public intensity: number; - public wordCount: number; + public sentiment?: (number|null); + public behaviorGraph?: (string|null); + public action?: (number|null); + public intensity?: (number|null); + public wordCount?: (number|null); public static create(properties?: proto.IBotAvatarMetadata): proto.BotAvatarMetadata; public static encode(m: proto.IBotAvatarMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotAvatarMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotAvatarMetadata; + public static toObject(m: proto.BotAvatarMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -720,6 +819,9 @@ export namespace proto { public static create(properties?: proto.IBotCapabilityMetadata): proto.BotCapabilityMetadata; public static encode(m: proto.IBotCapabilityMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotCapabilityMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotCapabilityMetadata; + public static toObject(m: proto.BotCapabilityMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -771,10 +873,13 @@ export namespace proto { class BotImagineMetadata implements IBotImagineMetadata { constructor(p?: proto.IBotImagineMetadata); - public imagineType: proto.BotImagineMetadata.ImagineType; + public imagineType?: (proto.BotImagineMetadata.ImagineType|null); public static create(properties?: proto.IBotImagineMetadata): proto.BotImagineMetadata; public static encode(m: proto.IBotImagineMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotImagineMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotImagineMetadata; + public static toObject(m: proto.BotImagineMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -795,10 +900,13 @@ export namespace proto { class BotLinkedAccount implements IBotLinkedAccount { constructor(p?: proto.IBotLinkedAccount); - public type: proto.BotLinkedAccount.BotLinkedAccountType; + public type?: (proto.BotLinkedAccount.BotLinkedAccountType|null); public static create(properties?: proto.IBotLinkedAccount): proto.BotLinkedAccount; public static encode(m: proto.IBotLinkedAccount, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotLinkedAccount; + public static fromObject(d: { [k: string]: any }): proto.BotLinkedAccount; + public static toObject(m: proto.BotLinkedAccount, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -818,11 +926,14 @@ export namespace proto { class BotLinkedAccountsMetadata implements IBotLinkedAccountsMetadata { constructor(p?: proto.IBotLinkedAccountsMetadata); public accounts: proto.IBotLinkedAccount[]; - public acAuthTokens: Uint8Array; - public acErrorCode: number; + public acAuthTokens?: (Uint8Array|null); + public acErrorCode?: (number|null); public static create(properties?: proto.IBotLinkedAccountsMetadata): proto.BotLinkedAccountsMetadata; public static encode(m: proto.IBotLinkedAccountsMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotLinkedAccountsMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotLinkedAccountsMetadata; + public static toObject(m: proto.BotLinkedAccountsMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -838,16 +949,19 @@ export namespace proto { class BotMediaMetadata implements IBotMediaMetadata { constructor(p?: proto.IBotMediaMetadata); - public fileSha256: string; - public mediaKey: string; - public fileEncSha256: string; - public directPath: string; - public mediaKeyTimestamp: (number|Long); - public mimetype: string; - public orientationType: proto.BotMediaMetadata.OrientationType; + public fileSha256?: (string|null); + public mediaKey?: (string|null); + public fileEncSha256?: (string|null); + public directPath?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); + public mimetype?: (string|null); + public orientationType?: (proto.BotMediaMetadata.OrientationType|null); public static create(properties?: proto.IBotMediaMetadata): proto.BotMediaMetadata; public static encode(m: proto.IBotMediaMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotMediaMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotMediaMetadata; + public static toObject(m: proto.BotMediaMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -867,11 +981,14 @@ export namespace proto { class BotMemoryFact implements IBotMemoryFact { constructor(p?: proto.IBotMemoryFact); - public fact: string; - public factId: string; + public fact?: (string|null); + public factId?: (string|null); public static create(properties?: proto.IBotMemoryFact): proto.BotMemoryFact; public static encode(m: proto.IBotMemoryFact, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotMemoryFact; + public static fromObject(d: { [k: string]: any }): proto.BotMemoryFact; + public static toObject(m: proto.BotMemoryFact, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -885,10 +1002,13 @@ export namespace proto { constructor(p?: proto.IBotMemoryMetadata); public addedFacts: proto.IBotMemoryFact[]; public removedFacts: proto.IBotMemoryFact[]; - public disclaimer: string; + public disclaimer?: (string|null); public static create(properties?: proto.IBotMemoryMetadata): proto.BotMemoryMetadata; public static encode(m: proto.IBotMemoryMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotMemoryMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotMemoryMetadata; + public static toObject(m: proto.BotMemoryMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -902,6 +1022,9 @@ export namespace proto { public static create(properties?: proto.IBotMemuMetadata): proto.BotMemuMetadata; public static encode(m: proto.IBotMemuMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotMemuMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotMemuMetadata; + public static toObject(m: proto.BotMemuMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -935,16 +1058,16 @@ export namespace proto { class BotMetadata implements IBotMetadata { constructor(p?: proto.IBotMetadata); public avatarMetadata?: (proto.IBotAvatarMetadata|null); - public personaId: string; + public personaId?: (string|null); public pluginMetadata?: (proto.IBotPluginMetadata|null); public suggestedPromptMetadata?: (proto.IBotSuggestedPromptMetadata|null); - public invokerJid: string; + public invokerJid?: (string|null); public sessionMetadata?: (proto.IBotSessionMetadata|null); public memuMetadata?: (proto.IBotMemuMetadata|null); - public timezone: string; + public timezone?: (string|null); public reminderMetadata?: (proto.IBotReminderMetadata|null); public modelMetadata?: (proto.IBotModelMetadata|null); - public messageDisclaimerText: string; + public messageDisclaimerText?: (string|null); public progressIndicatorMetadata?: (proto.IBotProgressIndicatorMetadata|null); public capabilityMetadata?: (proto.IBotCapabilityMetadata|null); public imagineMetadata?: (proto.IBotImagineMetadata|null); @@ -953,7 +1076,7 @@ export namespace proto { public botMetricsMetadata?: (proto.IBotMetricsMetadata|null); public botLinkedAccountsMetadata?: (proto.IBotLinkedAccountsMetadata|null); public richResponseSourcesMetadata?: (proto.IBotSourcesMetadata|null); - public aiConversationContext: Uint8Array; + public aiConversationContext?: (Uint8Array|null); public botPromotionMessageMetadata?: (proto.IBotPromotionMessageMetadata|null); public botModeSelectionMetadata?: (proto.IBotModeSelectionMetadata|null); public botQuotaMetadata?: (proto.IBotQuotaMetadata|null); @@ -961,6 +1084,9 @@ export namespace proto { public static create(properties?: proto.IBotMetadata): proto.BotMetadata; public static encode(m: proto.IBotMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotMetadata; + public static toObject(m: proto.BotMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -999,12 +1125,15 @@ export namespace proto { class BotMetricsMetadata implements IBotMetricsMetadata { constructor(p?: proto.IBotMetricsMetadata); - public destinationId: string; - public destinationEntryPoint: proto.BotMetricsEntryPoint; - public threadOrigin: proto.BotMetricsThreadEntryPoint; + public destinationId?: (string|null); + public destinationEntryPoint?: (proto.BotMetricsEntryPoint|null); + public threadOrigin?: (proto.BotMetricsThreadEntryPoint|null); public static create(properties?: proto.IBotMetricsMetadata): proto.BotMetricsMetadata; public static encode(m: proto.IBotMetricsMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotMetricsMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotMetricsMetadata; + public static toObject(m: proto.BotMetricsMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1025,6 +1154,9 @@ export namespace proto { public static create(properties?: proto.IBotModeSelectionMetadata): proto.BotModeSelectionMetadata; public static encode(m: proto.IBotModeSelectionMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotModeSelectionMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotModeSelectionMetadata; + public static toObject(m: proto.BotModeSelectionMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1043,11 +1175,14 @@ export namespace proto { class BotModelMetadata implements IBotModelMetadata { constructor(p?: proto.IBotModelMetadata); - public modelType: proto.BotModelMetadata.ModelType; - public premiumModelStatus: proto.BotModelMetadata.PremiumModelStatus; + public modelType?: (proto.BotModelMetadata.ModelType|null); + public premiumModelStatus?: (proto.BotModelMetadata.PremiumModelStatus|null); public static create(properties?: proto.IBotModelMetadata): proto.BotModelMetadata; public static encode(m: proto.IBotModelMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotModelMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotModelMetadata; + public static toObject(m: proto.BotModelMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1083,21 +1218,24 @@ export namespace proto { class BotPluginMetadata implements IBotPluginMetadata { constructor(p?: proto.IBotPluginMetadata); - public provider: proto.BotPluginMetadata.SearchProvider; - public pluginType: proto.BotPluginMetadata.PluginType; - public thumbnailCdnUrl: string; - public profilePhotoCdnUrl: string; - public searchProviderUrl: string; - public referenceIndex: number; - public expectedLinksCount: number; - public searchQuery: string; + public provider?: (proto.BotPluginMetadata.SearchProvider|null); + public pluginType?: (proto.BotPluginMetadata.PluginType|null); + public thumbnailCdnUrl?: (string|null); + public profilePhotoCdnUrl?: (string|null); + public searchProviderUrl?: (string|null); + public referenceIndex?: (number|null); + public expectedLinksCount?: (number|null); + public searchQuery?: (string|null); public parentPluginMessageKey?: (proto.IMessageKey|null); - public deprecatedField: proto.BotPluginMetadata.PluginType; - public parentPluginType: proto.BotPluginMetadata.PluginType; - public faviconCdnUrl: string; + public deprecatedField?: (proto.BotPluginMetadata.PluginType|null); + public parentPluginType?: (proto.BotPluginMetadata.PluginType|null); + public faviconCdnUrl?: (string|null); public static create(properties?: proto.IBotPluginMetadata): proto.BotPluginMetadata; public static encode(m: proto.IBotPluginMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotPluginMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotPluginMetadata; + public static toObject(m: proto.BotPluginMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1124,11 +1262,14 @@ export namespace proto { class BotProgressIndicatorMetadata implements IBotProgressIndicatorMetadata { constructor(p?: proto.IBotProgressIndicatorMetadata); - public progressDescription: string; + public progressDescription?: (string|null); public stepsMetadata: proto.BotProgressIndicatorMetadata.IBotPlanningStepMetadata[]; public static create(properties?: proto.IBotProgressIndicatorMetadata): proto.BotProgressIndicatorMetadata; public static encode(m: proto.IBotProgressIndicatorMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotProgressIndicatorMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotProgressIndicatorMetadata; + public static toObject(m: proto.BotProgressIndicatorMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1146,16 +1287,19 @@ export namespace proto { class BotPlanningStepMetadata implements IBotPlanningStepMetadata { constructor(p?: proto.BotProgressIndicatorMetadata.IBotPlanningStepMetadata); - public statusTitle: string; - public statusBody: string; + public statusTitle?: (string|null); + public statusBody?: (string|null); public sourcesMetadata: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourcesMetadata[]; - public status: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.PlanningStepStatus; - public isReasoning: boolean; - public isEnhancedSearch: boolean; + public status?: (proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.PlanningStepStatus|null); + public isReasoning?: (boolean|null); + public isEnhancedSearch?: (boolean|null); public sections: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningStepSectionMetadata[]; public static create(properties?: proto.BotProgressIndicatorMetadata.IBotPlanningStepMetadata): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata; public static encode(m: proto.BotProgressIndicatorMetadata.IBotPlanningStepMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata; + public static toObject(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1170,13 +1314,16 @@ export namespace proto { class BotPlanningSearchSourceMetadata implements IBotPlanningSearchSourceMetadata { constructor(p?: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourceMetadata); - public title: string; - public provider: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider; - public sourceUrl: string; - public favIconUrl: string; + public title?: (string|null); + public provider?: (proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider|null); + public sourceUrl?: (string|null); + public favIconUrl?: (string|null); public static create(properties?: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourceMetadata): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata; public static encode(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourceMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata; + public static toObject(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1188,12 +1335,15 @@ export namespace proto { class BotPlanningSearchSourcesMetadata implements IBotPlanningSearchSourcesMetadata { constructor(p?: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourcesMetadata); - public sourceTitle: string; - public provider: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider; - public sourceUrl: string; + public sourceTitle?: (string|null); + public provider?: (proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider|null); + public sourceUrl?: (string|null); public static create(properties?: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourcesMetadata): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata; public static encode(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourcesMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata; + public static toObject(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1215,12 +1365,15 @@ export namespace proto { class BotPlanningStepSectionMetadata implements IBotPlanningStepSectionMetadata { constructor(p?: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningStepSectionMetadata); - public sectionTitle: string; - public sectionBody: string; + public sectionTitle?: (string|null); + public sectionBody?: (string|null); public sourcesMetadata: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningSearchSourceMetadata[]; public static create(properties?: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningStepSectionMetadata): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata; public static encode(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.IBotPlanningStepSectionMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata; + public static toObject(m: proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1247,11 +1400,14 @@ export namespace proto { class BotPromotionMessageMetadata implements IBotPromotionMessageMetadata { constructor(p?: proto.IBotPromotionMessageMetadata); - public promotionType: proto.BotPromotionMessageMetadata.BotPromotionType; - public buttonTitle: string; + public promotionType?: (proto.BotPromotionMessageMetadata.BotPromotionType|null); + public buttonTitle?: (string|null); public static create(properties?: proto.IBotPromotionMessageMetadata): proto.BotPromotionMessageMetadata; public static encode(m: proto.IBotPromotionMessageMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotPromotionMessageMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotPromotionMessageMetadata; + public static toObject(m: proto.BotPromotionMessageMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1270,11 +1426,14 @@ export namespace proto { class BotPromptSuggestion implements IBotPromptSuggestion { constructor(p?: proto.IBotPromptSuggestion); - public prompt: string; - public promptId: string; + public prompt?: (string|null); + public promptId?: (string|null); public static create(properties?: proto.IBotPromptSuggestion): proto.BotPromptSuggestion; public static encode(m: proto.IBotPromptSuggestion, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotPromptSuggestion; + public static fromObject(d: { [k: string]: any }): proto.BotPromptSuggestion; + public static toObject(m: proto.BotPromptSuggestion, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1288,6 +1447,9 @@ export namespace proto { public static create(properties?: proto.IBotPromptSuggestions): proto.BotPromptSuggestions; public static encode(m: proto.IBotPromptSuggestions, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotPromptSuggestions; + public static fromObject(d: { [k: string]: any }): proto.BotPromptSuggestions; + public static toObject(m: proto.BotPromptSuggestions, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1301,6 +1463,9 @@ export namespace proto { public static create(properties?: proto.IBotQuotaMetadata): proto.BotQuotaMetadata; public static encode(m: proto.IBotQuotaMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotQuotaMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotQuotaMetadata; + public static toObject(m: proto.BotQuotaMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1314,12 +1479,15 @@ export namespace proto { class BotFeatureQuotaMetadata implements IBotFeatureQuotaMetadata { constructor(p?: proto.BotQuotaMetadata.IBotFeatureQuotaMetadata); - public featureType: proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType; - public remainingQuota: number; - public expirationTimestamp: (number|Long); + public featureType?: (proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType|null); + public remainingQuota?: (number|null); + public expirationTimestamp?: (number|Long|null); public static create(properties?: proto.BotQuotaMetadata.IBotFeatureQuotaMetadata): proto.BotQuotaMetadata.BotFeatureQuotaMetadata; public static encode(m: proto.BotQuotaMetadata.IBotFeatureQuotaMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotQuotaMetadata.BotFeatureQuotaMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotQuotaMetadata.BotFeatureQuotaMetadata; + public static toObject(m: proto.BotQuotaMetadata.BotFeatureQuotaMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1343,13 +1511,16 @@ export namespace proto { class BotReminderMetadata implements IBotReminderMetadata { constructor(p?: proto.IBotReminderMetadata); public requestMessageKey?: (proto.IMessageKey|null); - public action: proto.BotReminderMetadata.ReminderAction; - public name: string; - public nextTriggerTimestamp: (number|Long); - public frequency: proto.BotReminderMetadata.ReminderFrequency; + public action?: (proto.BotReminderMetadata.ReminderAction|null); + public name?: (string|null); + public nextTriggerTimestamp?: (number|Long|null); + public frequency?: (proto.BotReminderMetadata.ReminderFrequency|null); public static create(properties?: proto.IBotReminderMetadata): proto.BotReminderMetadata; public static encode(m: proto.IBotReminderMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotReminderMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotReminderMetadata; + public static toObject(m: proto.BotReminderMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1381,6 +1552,9 @@ export namespace proto { public static create(properties?: proto.IBotRenderingMetadata): proto.BotRenderingMetadata; public static encode(m: proto.IBotRenderingMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotRenderingMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotRenderingMetadata; + public static toObject(m: proto.BotRenderingMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1393,11 +1567,14 @@ export namespace proto { class Keyword implements IKeyword { constructor(p?: proto.BotRenderingMetadata.IKeyword); - public value: string; + public value?: (string|null); public associatedPrompts: string[]; public static create(properties?: proto.BotRenderingMetadata.IKeyword): proto.BotRenderingMetadata.Keyword; public static encode(m: proto.BotRenderingMetadata.IKeyword, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotRenderingMetadata.Keyword; + public static fromObject(d: { [k: string]: any }): proto.BotRenderingMetadata.Keyword; + public static toObject(m: proto.BotRenderingMetadata.Keyword, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -1409,11 +1586,14 @@ export namespace proto { class BotSessionMetadata implements IBotSessionMetadata { constructor(p?: proto.IBotSessionMetadata); - public sessionId: string; - public sessionSource: proto.BotSessionSource; + public sessionId?: (string|null); + public sessionSource?: (proto.BotSessionSource|null); public static create(properties?: proto.IBotSessionMetadata): proto.BotSessionMetadata; public static encode(m: proto.IBotSessionMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotSessionMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotSessionMetadata; + public static toObject(m: proto.BotSessionMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1437,6 +1617,9 @@ export namespace proto { public static create(properties?: proto.IBotSourcesMetadata): proto.BotSourcesMetadata; public static encode(m: proto.IBotSourcesMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotSourcesMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotSourcesMetadata; + public static toObject(m: proto.BotSourcesMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1453,15 +1636,18 @@ export namespace proto { class BotSourceItem implements IBotSourceItem { constructor(p?: proto.BotSourcesMetadata.IBotSourceItem); - public provider: proto.BotSourcesMetadata.BotSourceItem.SourceProvider; - public thumbnailCdnUrl: string; - public sourceProviderUrl: string; - public sourceQuery: string; - public faviconCdnUrl: string; - public citationNumber: number; + public provider?: (proto.BotSourcesMetadata.BotSourceItem.SourceProvider|null); + public thumbnailCdnUrl?: (string|null); + public sourceProviderUrl?: (string|null); + public sourceQuery?: (string|null); + public faviconCdnUrl?: (string|null); + public citationNumber?: (number|null); public static create(properties?: proto.BotSourcesMetadata.IBotSourceItem): proto.BotSourcesMetadata.BotSourceItem; public static encode(m: proto.BotSourcesMetadata.IBotSourceItem, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotSourcesMetadata.BotSourceItem; + public static fromObject(d: { [k: string]: any }): proto.BotSourcesMetadata.BotSourceItem; + public static toObject(m: proto.BotSourcesMetadata.BotSourceItem, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1486,12 +1672,15 @@ export namespace proto { class BotSuggestedPromptMetadata implements IBotSuggestedPromptMetadata { constructor(p?: proto.IBotSuggestedPromptMetadata); public suggestedPrompts: string[]; - public selectedPromptIndex: number; + public selectedPromptIndex?: (number|null); public promptSuggestions?: (proto.IBotPromptSuggestions|null); - public selectedPromptId: string; + public selectedPromptId?: (string|null); public static create(properties?: proto.IBotSuggestedPromptMetadata): proto.BotSuggestedPromptMetadata; public static encode(m: proto.IBotSuggestedPromptMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BotSuggestedPromptMetadata; + public static fromObject(d: { [k: string]: any }): proto.BotSuggestedPromptMetadata; + public static toObject(m: proto.BotSuggestedPromptMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1515,24 +1704,27 @@ export namespace proto { class CallLogRecord implements ICallLogRecord { constructor(p?: proto.ICallLogRecord); - public callResult: proto.CallLogRecord.CallResult; - public isDndMode: boolean; - public silenceReason: proto.CallLogRecord.SilenceReason; - public duration: (number|Long); - public startTime: (number|Long); - public isIncoming: boolean; - public isVideo: boolean; - public isCallLink: boolean; - public callLinkToken: string; - public scheduledCallId: string; - public callId: string; - public callCreatorJid: string; - public groupJid: string; + public callResult?: (proto.CallLogRecord.CallResult|null); + public isDndMode?: (boolean|null); + public silenceReason?: (proto.CallLogRecord.SilenceReason|null); + public duration?: (number|Long|null); + public startTime?: (number|Long|null); + public isIncoming?: (boolean|null); + public isVideo?: (boolean|null); + public isCallLink?: (boolean|null); + public callLinkToken?: (string|null); + public scheduledCallId?: (string|null); + public callId?: (string|null); + public callCreatorJid?: (string|null); + public groupJid?: (string|null); public participants: proto.CallLogRecord.IParticipantInfo[]; - public callType: proto.CallLogRecord.CallType; + public callType?: (proto.CallLogRecord.CallType|null); public static create(properties?: proto.ICallLogRecord): proto.CallLogRecord; public static encode(m: proto.ICallLogRecord, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CallLogRecord; + public static fromObject(d: { [k: string]: any }): proto.CallLogRecord; + public static toObject(m: proto.CallLogRecord, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1565,11 +1757,14 @@ export namespace proto { class ParticipantInfo implements IParticipantInfo { constructor(p?: proto.CallLogRecord.IParticipantInfo); - public userJid: string; - public callResult: proto.CallLogRecord.CallResult; + public userJid?: (string|null); + public callResult?: (proto.CallLogRecord.CallResult|null); public static create(properties?: proto.CallLogRecord.IParticipantInfo): proto.CallLogRecord.ParticipantInfo; public static encode(m: proto.CallLogRecord.IParticipantInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CallLogRecord.ParticipantInfo; + public static fromObject(d: { [k: string]: any }): proto.CallLogRecord.ParticipantInfo; + public static toObject(m: proto.CallLogRecord.ParticipantInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1593,6 +1788,9 @@ export namespace proto { public static create(properties?: proto.ICertChain): proto.CertChain; public static encode(m: proto.ICertChain, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CertChain; + public static fromObject(d: { [k: string]: any }): proto.CertChain; + public static toObject(m: proto.CertChain, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1605,11 +1803,14 @@ export namespace proto { class NoiseCertificate implements INoiseCertificate { constructor(p?: proto.CertChain.INoiseCertificate); - public details: Uint8Array; - public signature: Uint8Array; + public details?: (Uint8Array|null); + public signature?: (Uint8Array|null); public static create(properties?: proto.CertChain.INoiseCertificate): proto.CertChain.NoiseCertificate; public static encode(m: proto.CertChain.INoiseCertificate, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CertChain.NoiseCertificate; + public static fromObject(d: { [k: string]: any }): proto.CertChain.NoiseCertificate; + public static toObject(m: proto.CertChain.NoiseCertificate, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1625,14 +1826,17 @@ export namespace proto { class Details implements IDetails { constructor(p?: proto.CertChain.NoiseCertificate.IDetails); - public serial: number; - public issuerSerial: number; - public key: Uint8Array; - public notBefore: (number|Long); - public notAfter: (number|Long); + public serial?: (number|null); + public issuerSerial?: (number|null); + public key?: (Uint8Array|null); + public notBefore?: (number|Long|null); + public notAfter?: (number|Long|null); public static create(properties?: proto.CertChain.NoiseCertificate.IDetails): proto.CertChain.NoiseCertificate.Details; public static encode(m: proto.CertChain.NoiseCertificate.IDetails, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CertChain.NoiseCertificate.Details; + public static fromObject(d: { [k: string]: any }): proto.CertChain.NoiseCertificate.Details; + public static toObject(m: proto.CertChain.NoiseCertificate.Details, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -1645,11 +1849,14 @@ export namespace proto { class ChatLockSettings implements IChatLockSettings { constructor(p?: proto.IChatLockSettings); - public hideLockedChats: boolean; + public hideLockedChats?: (boolean|null); public secretCode?: (proto.IUserPassword|null); public static create(properties?: proto.IChatLockSettings): proto.ChatLockSettings; public static encode(m: proto.IChatLockSettings, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ChatLockSettings; + public static fromObject(d: { [k: string]: any }): proto.ChatLockSettings; + public static toObject(m: proto.ChatLockSettings, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1663,6 +1870,9 @@ export namespace proto { public static create(properties?: proto.IChatRowOpaqueData): proto.ChatRowOpaqueData; public static encode(m: proto.IChatRowOpaqueData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ChatRowOpaqueData; + public static fromObject(d: { [k: string]: any }): proto.ChatRowOpaqueData; + public static toObject(m: proto.ChatRowOpaqueData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1678,14 +1888,17 @@ export namespace proto { class DraftMessage implements IDraftMessage { constructor(p?: proto.ChatRowOpaqueData.IDraftMessage); - public text: string; - public omittedUrl: string; + public text?: (string|null); + public omittedUrl?: (string|null); public ctwaContextLinkData?: (proto.ChatRowOpaqueData.DraftMessage.ICtwaContextLinkData|null); public ctwaContext?: (proto.ChatRowOpaqueData.DraftMessage.ICtwaContextData|null); - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public static create(properties?: proto.ChatRowOpaqueData.IDraftMessage): proto.ChatRowOpaqueData.DraftMessage; public static encode(m: proto.ChatRowOpaqueData.IDraftMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ChatRowOpaqueData.DraftMessage; + public static fromObject(d: { [k: string]: any }): proto.ChatRowOpaqueData.DraftMessage; + public static toObject(m: proto.ChatRowOpaqueData.DraftMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1708,21 +1921,24 @@ export namespace proto { class CtwaContextData implements ICtwaContextData { constructor(p?: proto.ChatRowOpaqueData.DraftMessage.ICtwaContextData); - public conversionSource: string; - public conversionData: Uint8Array; - public sourceUrl: string; - public sourceId: string; - public sourceType: string; - public title: string; - public description: string; - public thumbnail: string; - public thumbnailUrl: string; - public mediaType: proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType; - public mediaUrl: string; - public isSuspiciousLink: boolean; + public conversionSource?: (string|null); + public conversionData?: (Uint8Array|null); + public sourceUrl?: (string|null); + public sourceId?: (string|null); + public sourceType?: (string|null); + public title?: (string|null); + public description?: (string|null); + public thumbnail?: (string|null); + public thumbnailUrl?: (string|null); + public mediaType?: (proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType|null); + public mediaUrl?: (string|null); + public isSuspiciousLink?: (boolean|null); public static create(properties?: proto.ChatRowOpaqueData.DraftMessage.ICtwaContextData): proto.ChatRowOpaqueData.DraftMessage.CtwaContextData; public static encode(m: proto.ChatRowOpaqueData.DraftMessage.ICtwaContextData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ChatRowOpaqueData.DraftMessage.CtwaContextData; + public static fromObject(d: { [k: string]: any }): proto.ChatRowOpaqueData.DraftMessage.CtwaContextData; + public static toObject(m: proto.ChatRowOpaqueData.DraftMessage.CtwaContextData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1744,23 +1960,26 @@ export namespace proto { class CtwaContextLinkData implements ICtwaContextLinkData { constructor(p?: proto.ChatRowOpaqueData.DraftMessage.ICtwaContextLinkData); - public context: string; - public sourceUrl: string; - public icebreaker: string; - public phone: string; + public context?: (string|null); + public sourceUrl?: (string|null); + public icebreaker?: (string|null); + public phone?: (string|null); public static create(properties?: proto.ChatRowOpaqueData.DraftMessage.ICtwaContextLinkData): proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData; public static encode(m: proto.ChatRowOpaqueData.DraftMessage.ICtwaContextLinkData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData; + public static fromObject(d: { [k: string]: any }): proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData; + public static toObject(m: proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } } interface ICitation { - title: string; - subtitle: string; - cmsId: string; - imageUrl: string; + title?: (string|null); + subtitle?: (string|null); + cmsId?: (string|null); + imageUrl?: (string|null); } class Citation implements ICitation { @@ -1772,6 +1991,9 @@ export namespace proto { public static create(properties?: proto.ICitation): proto.Citation; public static encode(m: proto.ICitation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Citation; + public static fromObject(d: { [k: string]: any }): proto.Citation; + public static toObject(m: proto.Citation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1782,11 +2004,14 @@ export namespace proto { class ClientPairingProps implements IClientPairingProps { constructor(p?: proto.IClientPairingProps); - public isChatDbLidMigrated: boolean; - public isSyncdPureLidSession: boolean; + public isChatDbLidMigrated?: (boolean|null); + public isSyncdPureLidSession?: (boolean|null); public static create(properties?: proto.IClientPairingProps): proto.ClientPairingProps; public static encode(m: proto.IClientPairingProps, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPairingProps; + public static fromObject(d: { [k: string]: any }): proto.ClientPairingProps; + public static toObject(m: proto.ClientPairingProps, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1825,39 +2050,42 @@ export namespace proto { class ClientPayload implements IClientPayload { constructor(p?: proto.IClientPayload); - public username: (number|Long); - public passive: boolean; + public username?: (number|Long|null); + public passive?: (boolean|null); public userAgent?: (proto.ClientPayload.IUserAgent|null); public webInfo?: (proto.ClientPayload.IWebInfo|null); - public pushName: string; - public sessionId: number; - public shortConnect: boolean; - public connectType: proto.ClientPayload.ConnectType; - public connectReason: proto.ClientPayload.ConnectReason; + public pushName?: (string|null); + public sessionId?: (number|null); + public shortConnect?: (boolean|null); + public connectType?: (proto.ClientPayload.ConnectType|null); + public connectReason?: (proto.ClientPayload.ConnectReason|null); public shards: number[]; public dnsSource?: (proto.ClientPayload.IDNSSource|null); - public connectAttemptCount: number; - public device: number; + public connectAttemptCount?: (number|null); + public device?: (number|null); public devicePairingData?: (proto.ClientPayload.IDevicePairingRegistrationData|null); - public product: proto.ClientPayload.Product; - public fbCat: Uint8Array; - public fbUserAgent: Uint8Array; - public oc: boolean; - public lc: number; - public iosAppExtension: proto.ClientPayload.IOSAppExtension; - public fbAppId: (number|Long); - public fbDeviceId: Uint8Array; - public pull: boolean; - public paddingBytes: Uint8Array; - public yearClass: number; - public memClass: number; + public product?: (proto.ClientPayload.Product|null); + public fbCat?: (Uint8Array|null); + public fbUserAgent?: (Uint8Array|null); + public oc?: (boolean|null); + public lc?: (number|null); + public iosAppExtension?: (proto.ClientPayload.IOSAppExtension|null); + public fbAppId?: (number|Long|null); + public fbDeviceId?: (Uint8Array|null); + public pull?: (boolean|null); + public paddingBytes?: (Uint8Array|null); + public yearClass?: (number|null); + public memClass?: (number|null); public interopData?: (proto.ClientPayload.IInteropData|null); - public trafficAnonymization: proto.ClientPayload.TrafficAnonymization; - public lidDbMigrated: boolean; - public accountType: proto.ClientPayload.AccountType; + public trafficAnonymization?: (proto.ClientPayload.TrafficAnonymization|null); + public lidDbMigrated?: (boolean|null); + public accountType?: (proto.ClientPayload.AccountType|null); public static create(properties?: proto.IClientPayload): proto.ClientPayload; public static encode(m: proto.IClientPayload, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload; + public static toObject(m: proto.ClientPayload, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1903,11 +2131,14 @@ export namespace proto { class DNSSource implements IDNSSource { constructor(p?: proto.ClientPayload.IDNSSource); - public dnsMethod: proto.ClientPayload.DNSSource.DNSResolutionMethod; - public appCached: boolean; + public dnsMethod?: (proto.ClientPayload.DNSSource.DNSResolutionMethod|null); + public appCached?: (boolean|null); public static create(properties?: proto.ClientPayload.IDNSSource): proto.ClientPayload.DNSSource; public static encode(m: proto.ClientPayload.IDNSSource, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.DNSSource; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.DNSSource; + public static toObject(m: proto.ClientPayload.DNSSource, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1936,17 +2167,20 @@ export namespace proto { class DevicePairingRegistrationData implements IDevicePairingRegistrationData { constructor(p?: proto.ClientPayload.IDevicePairingRegistrationData); - public eRegid: Uint8Array; - public eKeytype: Uint8Array; - public eIdent: Uint8Array; - public eSkeyId: Uint8Array; - public eSkeyVal: Uint8Array; - public eSkeySig: Uint8Array; - public buildHash: Uint8Array; - public deviceProps: Uint8Array; + public eRegid?: (Uint8Array|null); + public eKeytype?: (Uint8Array|null); + public eIdent?: (Uint8Array|null); + public eSkeyId?: (Uint8Array|null); + public eSkeyVal?: (Uint8Array|null); + public eSkeySig?: (Uint8Array|null); + public buildHash?: (Uint8Array|null); + public deviceProps?: (Uint8Array|null); public static create(properties?: proto.ClientPayload.IDevicePairingRegistrationData): proto.ClientPayload.DevicePairingRegistrationData; public static encode(m: proto.ClientPayload.IDevicePairingRegistrationData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.DevicePairingRegistrationData; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.DevicePairingRegistrationData; + public static toObject(m: proto.ClientPayload.DevicePairingRegistrationData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -1964,12 +2198,15 @@ export namespace proto { class InteropData implements IInteropData { constructor(p?: proto.ClientPayload.IInteropData); - public accountId: (number|Long); - public token: Uint8Array; - public enableReadReceipts: boolean; + public accountId?: (number|Long|null); + public token?: (Uint8Array|null); + public enableReadReceipts?: (boolean|null); public static create(properties?: proto.ClientPayload.IInteropData): proto.ClientPayload.InteropData; public static encode(m: proto.ClientPayload.IInteropData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.InteropData; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.InteropData; + public static toObject(m: proto.ClientPayload.InteropData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2007,25 +2244,28 @@ export namespace proto { class UserAgent implements IUserAgent { constructor(p?: proto.ClientPayload.IUserAgent); - public platform: proto.ClientPayload.UserAgent.Platform; + public platform?: (proto.ClientPayload.UserAgent.Platform|null); public appVersion?: (proto.ClientPayload.UserAgent.IAppVersion|null); - public mcc: string; - public mnc: string; - public osVersion: string; - public manufacturer: string; - public device: string; - public osBuildNumber: string; - public phoneId: string; - public releaseChannel: proto.ClientPayload.UserAgent.ReleaseChannel; - public localeLanguageIso6391: string; - public localeCountryIso31661Alpha2: string; - public deviceBoard: string; - public deviceExpId: string; - public deviceType: proto.ClientPayload.UserAgent.DeviceType; - public deviceModelType: string; + public mcc?: (string|null); + public mnc?: (string|null); + public osVersion?: (string|null); + public manufacturer?: (string|null); + public device?: (string|null); + public osBuildNumber?: (string|null); + public phoneId?: (string|null); + public releaseChannel?: (proto.ClientPayload.UserAgent.ReleaseChannel|null); + public localeLanguageIso6391?: (string|null); + public localeCountryIso31661Alpha2?: (string|null); + public deviceBoard?: (string|null); + public deviceExpId?: (string|null); + public deviceType?: (proto.ClientPayload.UserAgent.DeviceType|null); + public deviceModelType?: (string|null); public static create(properties?: proto.ClientPayload.IUserAgent): proto.ClientPayload.UserAgent; public static encode(m: proto.ClientPayload.IUserAgent, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.UserAgent; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.UserAgent; + public static toObject(m: proto.ClientPayload.UserAgent, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2041,14 +2281,17 @@ export namespace proto { class AppVersion implements IAppVersion { constructor(p?: proto.ClientPayload.UserAgent.IAppVersion); - public primary: number; - public secondary: number; - public tertiary: number; - public quaternary: number; - public quinary: number; + public primary?: (number|null); + public secondary?: (number|null); + public tertiary?: (number|null); + public quaternary?: (number|null); + public quinary?: (number|null); public static create(properties?: proto.ClientPayload.UserAgent.IAppVersion): proto.ClientPayload.UserAgent.AppVersion; public static encode(m: proto.ClientPayload.UserAgent.IAppVersion, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.UserAgent.AppVersion; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.UserAgent.AppVersion; + public static toObject(m: proto.ClientPayload.UserAgent.AppVersion, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2116,13 +2359,16 @@ export namespace proto { class WebInfo implements IWebInfo { constructor(p?: proto.ClientPayload.IWebInfo); - public refToken: string; - public version: string; + public refToken?: (string|null); + public version?: (string|null); public webdPayload?: (proto.ClientPayload.WebInfo.IWebdPayload|null); - public webSubPlatform: proto.ClientPayload.WebInfo.WebSubPlatform; + public webSubPlatform?: (proto.ClientPayload.WebInfo.WebSubPlatform|null); public static create(properties?: proto.ClientPayload.IWebInfo): proto.ClientPayload.WebInfo; public static encode(m: proto.ClientPayload.IWebInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.WebInfo; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.WebInfo; + public static toObject(m: proto.ClientPayload.WebInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2153,20 +2399,23 @@ export namespace proto { class WebdPayload implements IWebdPayload { constructor(p?: proto.ClientPayload.WebInfo.IWebdPayload); - public usesParticipantInKey: boolean; - public supportsStarredMessages: boolean; - public supportsDocumentMessages: boolean; - public supportsUrlMessages: boolean; - public supportsMediaRetry: boolean; - public supportsE2EImage: boolean; - public supportsE2EVideo: boolean; - public supportsE2EAudio: boolean; - public supportsE2EDocument: boolean; - public documentTypes: string; - public features: Uint8Array; + public usesParticipantInKey?: (boolean|null); + public supportsStarredMessages?: (boolean|null); + public supportsDocumentMessages?: (boolean|null); + public supportsUrlMessages?: (boolean|null); + public supportsMediaRetry?: (boolean|null); + public supportsE2EImage?: (boolean|null); + public supportsE2EVideo?: (boolean|null); + public supportsE2EAudio?: (boolean|null); + public supportsE2EDocument?: (boolean|null); + public documentTypes?: (string|null); + public features?: (Uint8Array|null); public static create(properties?: proto.ClientPayload.WebInfo.IWebdPayload): proto.ClientPayload.WebInfo.WebdPayload; public static encode(m: proto.ClientPayload.WebInfo.IWebdPayload, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ClientPayload.WebInfo.WebdPayload; + public static fromObject(d: { [k: string]: any }): proto.ClientPayload.WebInfo.WebdPayload; + public static toObject(m: proto.ClientPayload.WebInfo.WebdPayload, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2180,10 +2429,13 @@ export namespace proto { class CommentMetadata implements ICommentMetadata { constructor(p?: proto.ICommentMetadata); public commentParentKey?: (proto.IMessageKey|null); - public replyCount: number; + public replyCount?: (number|null); public static create(properties?: proto.ICommentMetadata): proto.CommentMetadata; public static encode(m: proto.ICommentMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CommentMetadata; + public static fromObject(d: { [k: string]: any }): proto.CommentMetadata; + public static toObject(m: proto.CommentMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2193,10 +2445,13 @@ export namespace proto { class CompanionCommitment implements ICompanionCommitment { constructor(p?: proto.ICompanionCommitment); - public hash: Uint8Array; + public hash?: (Uint8Array|null); public static create(properties?: proto.ICompanionCommitment): proto.CompanionCommitment; public static encode(m: proto.ICompanionCommitment, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CompanionCommitment; + public static fromObject(d: { [k: string]: any }): proto.CompanionCommitment; + public static toObject(m: proto.CompanionCommitment, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2208,12 +2463,15 @@ export namespace proto { class CompanionEphemeralIdentity implements ICompanionEphemeralIdentity { constructor(p?: proto.ICompanionEphemeralIdentity); - public publicKey: Uint8Array; - public deviceType: proto.DeviceProps.PlatformType; - public ref: string; + public publicKey?: (Uint8Array|null); + public deviceType?: (proto.DeviceProps.PlatformType|null); + public ref?: (string|null); public static create(properties?: proto.ICompanionEphemeralIdentity): proto.CompanionEphemeralIdentity; public static encode(m: proto.ICompanionEphemeralIdentity, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CompanionEphemeralIdentity; + public static fromObject(d: { [k: string]: any }): proto.CompanionEphemeralIdentity; + public static toObject(m: proto.CompanionEphemeralIdentity, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2225,10 +2483,13 @@ export namespace proto { class Config implements IConfig { constructor(p?: proto.IConfig); public field: { [k: string]: proto.IField }; - public version: number; + public version?: (number|null); public static create(properties?: proto.IConfig): proto.Config; public static encode(m: proto.IConfig, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Config; + public static fromObject(d: { [k: string]: any }): proto.Config; + public static toObject(m: proto.Config, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2284,56 +2545,59 @@ export namespace proto { class ContextInfo implements IContextInfo { constructor(p?: proto.IContextInfo); - public stanzaId: string; - public participant: string; + public stanzaId?: (string|null); + public participant?: (string|null); public quotedMessage?: (proto.IMessage|null); - public remoteJid: string; + public remoteJid?: (string|null); public mentionedJid: string[]; - public conversionSource: string; - public conversionData: Uint8Array; - public conversionDelaySeconds: number; - public forwardingScore: number; - public isForwarded: boolean; + public conversionSource?: (string|null); + public conversionData?: (Uint8Array|null); + public conversionDelaySeconds?: (number|null); + public forwardingScore?: (number|null); + public isForwarded?: (boolean|null); public quotedAd?: (proto.ContextInfo.IAdReplyInfo|null); public placeholderKey?: (proto.IMessageKey|null); - public expiration: number; - public ephemeralSettingTimestamp: (number|Long); - public ephemeralSharedSecret: Uint8Array; + public expiration?: (number|null); + public ephemeralSettingTimestamp?: (number|Long|null); + public ephemeralSharedSecret?: (Uint8Array|null); public externalAdReply?: (proto.ContextInfo.IExternalAdReplyInfo|null); - public entryPointConversionSource: string; - public entryPointConversionApp: string; - public entryPointConversionDelaySeconds: number; + public entryPointConversionSource?: (string|null); + public entryPointConversionApp?: (string|null); + public entryPointConversionDelaySeconds?: (number|null); public disappearingMode?: (proto.IDisappearingMode|null); public actionLink?: (proto.IActionLink|null); - public groupSubject: string; - public parentGroupJid: string; - public trustBannerType: string; - public trustBannerAction: number; - public isSampled: boolean; + public groupSubject?: (string|null); + public parentGroupJid?: (string|null); + public trustBannerType?: (string|null); + public trustBannerAction?: (number|null); + public isSampled?: (boolean|null); public groupMentions: proto.IGroupMention[]; public utm?: (proto.ContextInfo.IUTMInfo|null); public forwardedNewsletterMessageInfo?: (proto.ContextInfo.IForwardedNewsletterMessageInfo|null); public businessMessageForwardInfo?: (proto.ContextInfo.IBusinessMessageForwardInfo|null); - public smbClientCampaignId: string; - public smbServerCampaignId: string; + public smbClientCampaignId?: (string|null); + public smbServerCampaignId?: (string|null); public dataSharingContext?: (proto.ContextInfo.IDataSharingContext|null); - public alwaysShowAdAttribution: boolean; + public alwaysShowAdAttribution?: (boolean|null); public featureEligibilities?: (proto.ContextInfo.IFeatureEligibilities|null); - public entryPointConversionExternalSource: string; - public entryPointConversionExternalMedium: string; - public ctwaSignals: string; - public ctwaPayload: Uint8Array; + public entryPointConversionExternalSource?: (string|null); + public entryPointConversionExternalMedium?: (string|null); + public ctwaSignals?: (string|null); + public ctwaPayload?: (Uint8Array|null); public forwardedAiBotMessageInfo?: (proto.ContextInfo.IForwardedAIBotMessageInfo|null); - public statusAttributionType: proto.ContextInfo.StatusAttributionType; + public statusAttributionType?: (proto.ContextInfo.StatusAttributionType|null); public urlTrackingMap?: (proto.IUrlTrackingMap|null); - public pairedMediaType: proto.ContextInfo.PairedMediaType; - public rankingVersion: number; + public pairedMediaType?: (proto.ContextInfo.PairedMediaType|null); + public rankingVersion?: (number|null); public memberLabel?: (proto.IMemberLabel|null); - public isQuestion: boolean; - public statusSourceType: proto.ContextInfo.StatusSourceType; + public isQuestion?: (boolean|null); + public statusSourceType?: (proto.ContextInfo.StatusSourceType|null); public static create(properties?: proto.IContextInfo): proto.ContextInfo; public static encode(m: proto.IContextInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo; + public static toObject(m: proto.ContextInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2348,13 +2612,16 @@ export namespace proto { class AdReplyInfo implements IAdReplyInfo { constructor(p?: proto.ContextInfo.IAdReplyInfo); - public advertiserName: string; - public mediaType: proto.ContextInfo.AdReplyInfo.MediaType; - public jpegThumbnail: Uint8Array; - public caption: string; + public advertiserName?: (string|null); + public mediaType?: (proto.ContextInfo.AdReplyInfo.MediaType|null); + public jpegThumbnail?: (Uint8Array|null); + public caption?: (string|null); public static create(properties?: proto.ContextInfo.IAdReplyInfo): proto.ContextInfo.AdReplyInfo; public static encode(m: proto.ContextInfo.IAdReplyInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.AdReplyInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.AdReplyInfo; + public static toObject(m: proto.ContextInfo.AdReplyInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2373,10 +2640,13 @@ export namespace proto { class BusinessMessageForwardInfo implements IBusinessMessageForwardInfo { constructor(p?: proto.ContextInfo.IBusinessMessageForwardInfo); - public businessOwnerJid: string; + public businessOwnerJid?: (string|null); public static create(properties?: proto.ContextInfo.IBusinessMessageForwardInfo): proto.ContextInfo.BusinessMessageForwardInfo; public static encode(m: proto.ContextInfo.IBusinessMessageForwardInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.BusinessMessageForwardInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.BusinessMessageForwardInfo; + public static toObject(m: proto.ContextInfo.BusinessMessageForwardInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2388,12 +2658,15 @@ export namespace proto { class DataSharingContext implements IDataSharingContext { constructor(p?: proto.ContextInfo.IDataSharingContext); - public showMmDisclosure: boolean; - public encryptedSignalTokenConsented: string; + public showMmDisclosure?: (boolean|null); + public encryptedSignalTokenConsented?: (string|null); public parameters: proto.ContextInfo.DataSharingContext.IParameters[]; public static create(properties?: proto.ContextInfo.IDataSharingContext): proto.ContextInfo.DataSharingContext; public static encode(m: proto.ContextInfo.IDataSharingContext, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.DataSharingContext; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.DataSharingContext; + public static toObject(m: proto.ContextInfo.DataSharingContext, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2409,14 +2682,17 @@ export namespace proto { class Parameters implements IParameters { constructor(p?: proto.ContextInfo.DataSharingContext.IParameters); - public key: string; - public stringData: string; - public intData: (number|Long); - public floatData: number; + public key?: (string|null); + public stringData?: (string|null); + public intData?: (number|Long|null); + public floatData?: (number|null); public contents?: (proto.ContextInfo.DataSharingContext.IParameters|null); public static create(properties?: proto.ContextInfo.DataSharingContext.IParameters): proto.ContextInfo.DataSharingContext.Parameters; public static encode(m: proto.ContextInfo.DataSharingContext.IParameters, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.DataSharingContext.Parameters; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.DataSharingContext.Parameters; + public static toObject(m: proto.ContextInfo.DataSharingContext.Parameters, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2451,34 +2727,37 @@ export namespace proto { class ExternalAdReplyInfo implements IExternalAdReplyInfo { constructor(p?: proto.ContextInfo.IExternalAdReplyInfo); - public title: string; - public body: string; - public mediaType: proto.ContextInfo.ExternalAdReplyInfo.MediaType; - public thumbnailUrl: string; - public mediaUrl: string; - public thumbnail: Uint8Array; - public sourceType: string; - public sourceId: string; - public sourceUrl: string; - public containsAutoReply: boolean; - public renderLargerThumbnail: boolean; - public showAdAttribution: boolean; - public ctwaClid: string; - public ref: string; - public clickToWhatsappCall: boolean; - public adContextPreviewDismissed: boolean; - public sourceApp: string; - public automatedGreetingMessageShown: boolean; - public greetingMessageBody: string; - public ctaPayload: string; - public disableNudge: boolean; - public originalImageUrl: string; - public automatedGreetingMessageCtaType: string; - public wtwaAdFormat: boolean; - public adType: proto.ContextInfo.ExternalAdReplyInfo.AdType; + public title?: (string|null); + public body?: (string|null); + public mediaType?: (proto.ContextInfo.ExternalAdReplyInfo.MediaType|null); + public thumbnailUrl?: (string|null); + public mediaUrl?: (string|null); + public thumbnail?: (Uint8Array|null); + public sourceType?: (string|null); + public sourceId?: (string|null); + public sourceUrl?: (string|null); + public containsAutoReply?: (boolean|null); + public renderLargerThumbnail?: (boolean|null); + public showAdAttribution?: (boolean|null); + public ctwaClid?: (string|null); + public ref?: (string|null); + public clickToWhatsappCall?: (boolean|null); + public adContextPreviewDismissed?: (boolean|null); + public sourceApp?: (string|null); + public automatedGreetingMessageShown?: (boolean|null); + public greetingMessageBody?: (string|null); + public ctaPayload?: (string|null); + public disableNudge?: (boolean|null); + public originalImageUrl?: (string|null); + public automatedGreetingMessageCtaType?: (string|null); + public wtwaAdFormat?: (boolean|null); + public adType?: (proto.ContextInfo.ExternalAdReplyInfo.AdType|null); public static create(properties?: proto.ContextInfo.IExternalAdReplyInfo): proto.ContextInfo.ExternalAdReplyInfo; public static encode(m: proto.ContextInfo.IExternalAdReplyInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.ExternalAdReplyInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.ExternalAdReplyInfo; + public static toObject(m: proto.ContextInfo.ExternalAdReplyInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2505,13 +2784,16 @@ export namespace proto { class FeatureEligibilities implements IFeatureEligibilities { constructor(p?: proto.ContextInfo.IFeatureEligibilities); - public cannotBeReactedTo: boolean; - public cannotBeRanked: boolean; - public canRequestFeedback: boolean; - public canBeReshared: boolean; + public cannotBeReactedTo?: (boolean|null); + public cannotBeRanked?: (boolean|null); + public canRequestFeedback?: (boolean|null); + public canBeReshared?: (boolean|null); public static create(properties?: proto.ContextInfo.IFeatureEligibilities): proto.ContextInfo.FeatureEligibilities; public static encode(m: proto.ContextInfo.IFeatureEligibilities, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.FeatureEligibilities; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.FeatureEligibilities; + public static toObject(m: proto.ContextInfo.FeatureEligibilities, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2523,12 +2805,15 @@ export namespace proto { class ForwardedAIBotMessageInfo implements IForwardedAIBotMessageInfo { constructor(p?: proto.ContextInfo.IForwardedAIBotMessageInfo); - public botName: string; - public botJid: string; - public creatorName: string; + public botName?: (string|null); + public botJid?: (string|null); + public creatorName?: (string|null); public static create(properties?: proto.ContextInfo.IForwardedAIBotMessageInfo): proto.ContextInfo.ForwardedAIBotMessageInfo; public static encode(m: proto.ContextInfo.IForwardedAIBotMessageInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.ForwardedAIBotMessageInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.ForwardedAIBotMessageInfo; + public static toObject(m: proto.ContextInfo.ForwardedAIBotMessageInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2542,14 +2827,17 @@ export namespace proto { class ForwardedNewsletterMessageInfo implements IForwardedNewsletterMessageInfo { constructor(p?: proto.ContextInfo.IForwardedNewsletterMessageInfo); - public newsletterJid: string; - public serverMessageId: number; - public newsletterName: string; - public contentType: proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType; - public accessibilityText: string; + public newsletterJid?: (string|null); + public serverMessageId?: (number|null); + public newsletterName?: (string|null); + public contentType?: (proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType|null); + public accessibilityText?: (string|null); public static create(properties?: proto.ContextInfo.IForwardedNewsletterMessageInfo): proto.ContextInfo.ForwardedNewsletterMessageInfo; public static encode(m: proto.ContextInfo.IForwardedNewsletterMessageInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.ForwardedNewsletterMessageInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.ForwardedNewsletterMessageInfo; + public static toObject(m: proto.ContextInfo.ForwardedNewsletterMessageInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2594,17 +2882,20 @@ export namespace proto { class UTMInfo implements IUTMInfo { constructor(p?: proto.ContextInfo.IUTMInfo); - public utmSource: string; - public utmCampaign: string; + public utmSource?: (string|null); + public utmCampaign?: (string|null); public static create(properties?: proto.ContextInfo.IUTMInfo): proto.ContextInfo.UTMInfo; public static encode(m: proto.ContextInfo.IUTMInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContextInfo.UTMInfo; + public static fromObject(d: { [k: string]: any }): proto.ContextInfo.UTMInfo; + public static toObject(m: proto.ContextInfo.UTMInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } interface IConversation { - id: string; + id?: (string|null); messages?: (proto.IHistorySyncMsg[]|null); newJid?: (string|null); oldJid?: (string|null); @@ -2663,60 +2954,63 @@ export namespace proto { constructor(p?: proto.IConversation); public id: string; public messages: proto.IHistorySyncMsg[]; - public newJid: string; - public oldJid: string; - public lastMsgTimestamp: (number|Long); - public unreadCount: number; - public readOnly: boolean; - public endOfHistoryTransfer: boolean; - public ephemeralExpiration: number; - public ephemeralSettingTimestamp: (number|Long); - public endOfHistoryTransferType: proto.Conversation.EndOfHistoryTransferType; - public conversationTimestamp: (number|Long); - public name: string; - public pHash: string; - public notSpam: boolean; - public archived: boolean; + public newJid?: (string|null); + public oldJid?: (string|null); + public lastMsgTimestamp?: (number|Long|null); + public unreadCount?: (number|null); + public readOnly?: (boolean|null); + public endOfHistoryTransfer?: (boolean|null); + public ephemeralExpiration?: (number|null); + public ephemeralSettingTimestamp?: (number|Long|null); + public endOfHistoryTransferType?: (proto.Conversation.EndOfHistoryTransferType|null); + public conversationTimestamp?: (number|Long|null); + public name?: (string|null); + public pHash?: (string|null); + public notSpam?: (boolean|null); + public archived?: (boolean|null); public disappearingMode?: (proto.IDisappearingMode|null); - public unreadMentionCount: number; - public markedAsUnread: boolean; + public unreadMentionCount?: (number|null); + public markedAsUnread?: (boolean|null); public participant: proto.IGroupParticipant[]; - public tcToken: Uint8Array; - public tcTokenTimestamp: (number|Long); - public contactPrimaryIdentityKey: Uint8Array; - public pinned: number; - public muteEndTime: (number|Long); + public tcToken?: (Uint8Array|null); + public tcTokenTimestamp?: (number|Long|null); + public contactPrimaryIdentityKey?: (Uint8Array|null); + public pinned?: (number|null); + public muteEndTime?: (number|Long|null); public wallpaper?: (proto.IWallpaperSettings|null); - public mediaVisibility: proto.MediaVisibility; - public tcTokenSenderTimestamp: (number|Long); - public suspended: boolean; - public terminated: boolean; - public createdAt: (number|Long); - public createdBy: string; - public description: string; - public support: boolean; - public isParentGroup: boolean; - public parentGroupId: string; - public isDefaultSubgroup: boolean; - public displayName: string; - public pnJid: string; - public shareOwnPn: boolean; - public pnhDuplicateLidThread: boolean; - public lidJid: string; - public username: string; - public lidOriginType: string; - public commentsCount: number; - public locked: boolean; - public systemMessageToInsert: proto.PrivacySystemMessage; - public capiCreatedGroup: boolean; - public accountLid: string; - public limitSharing: boolean; - public limitSharingSettingTimestamp: (number|Long); - public limitSharingTrigger: proto.LimitSharing.TriggerType; - public limitSharingInitiatedByMe: boolean; + public mediaVisibility?: (proto.MediaVisibility|null); + public tcTokenSenderTimestamp?: (number|Long|null); + public suspended?: (boolean|null); + public terminated?: (boolean|null); + public createdAt?: (number|Long|null); + public createdBy?: (string|null); + public description?: (string|null); + public support?: (boolean|null); + public isParentGroup?: (boolean|null); + public parentGroupId?: (string|null); + public isDefaultSubgroup?: (boolean|null); + public displayName?: (string|null); + public pnJid?: (string|null); + public shareOwnPn?: (boolean|null); + public pnhDuplicateLidThread?: (boolean|null); + public lidJid?: (string|null); + public username?: (string|null); + public lidOriginType?: (string|null); + public commentsCount?: (number|null); + public locked?: (boolean|null); + public systemMessageToInsert?: (proto.PrivacySystemMessage|null); + public capiCreatedGroup?: (boolean|null); + public accountLid?: (string|null); + public limitSharing?: (boolean|null); + public limitSharingSettingTimestamp?: (number|Long|null); + public limitSharingTrigger?: (proto.LimitSharing.TriggerType|null); + public limitSharingInitiatedByMe?: (boolean|null); public static create(properties?: proto.IConversation): proto.Conversation; public static encode(m: proto.IConversation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Conversation; + public static fromObject(d: { [k: string]: any }): proto.Conversation; + public static toObject(m: proto.Conversation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2736,11 +3030,14 @@ export namespace proto { class DeviceCapabilities implements IDeviceCapabilities { constructor(p?: proto.IDeviceCapabilities); - public chatLockSupportLevel: proto.DeviceCapabilities.ChatLockSupportLevel; + public chatLockSupportLevel?: (proto.DeviceCapabilities.ChatLockSupportLevel|null); public lidMigration?: (proto.DeviceCapabilities.ILIDMigration|null); public static create(properties?: proto.IDeviceCapabilities): proto.DeviceCapabilities; public static encode(m: proto.IDeviceCapabilities, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceCapabilities; + public static fromObject(d: { [k: string]: any }): proto.DeviceCapabilities; + public static toObject(m: proto.DeviceCapabilities, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2758,10 +3055,13 @@ export namespace proto { class LIDMigration implements ILIDMigration { constructor(p?: proto.DeviceCapabilities.ILIDMigration); - public chatDbMigrationTimestamp: (number|Long); + public chatDbMigrationTimestamp?: (number|Long|null); public static create(properties?: proto.DeviceCapabilities.ILIDMigration): proto.DeviceCapabilities.LIDMigration; public static encode(m: proto.DeviceCapabilities.ILIDMigration, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceCapabilities.LIDMigration; + public static fromObject(d: { [k: string]: any }): proto.DeviceCapabilities.LIDMigration; + public static toObject(m: proto.DeviceCapabilities.LIDMigration, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2773,11 +3073,14 @@ export namespace proto { class DeviceConsistencyCodeMessage implements IDeviceConsistencyCodeMessage { constructor(p?: proto.IDeviceConsistencyCodeMessage); - public generation: number; - public signature: Uint8Array; + public generation?: (number|null); + public signature?: (Uint8Array|null); public static create(properties?: proto.IDeviceConsistencyCodeMessage): proto.DeviceConsistencyCodeMessage; public static encode(m: proto.IDeviceConsistencyCodeMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceConsistencyCodeMessage; + public static fromObject(d: { [k: string]: any }): proto.DeviceConsistencyCodeMessage; + public static toObject(m: proto.DeviceConsistencyCodeMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2794,17 +3097,20 @@ export namespace proto { class DeviceListMetadata implements IDeviceListMetadata { constructor(p?: proto.IDeviceListMetadata); - public senderKeyHash: Uint8Array; - public senderTimestamp: (number|Long); + public senderKeyHash?: (Uint8Array|null); + public senderTimestamp?: (number|Long|null); public senderKeyIndexes: number[]; - public senderAccountType: proto.ADVEncryptionType; - public receiverAccountType: proto.ADVEncryptionType; - public recipientKeyHash: Uint8Array; - public recipientTimestamp: (number|Long); + public senderAccountType?: (proto.ADVEncryptionType|null); + public receiverAccountType?: (proto.ADVEncryptionType|null); + public recipientKeyHash?: (Uint8Array|null); + public recipientTimestamp?: (number|Long|null); public recipientKeyIndexes: number[]; public static create(properties?: proto.IDeviceListMetadata): proto.DeviceListMetadata; public static encode(m: proto.IDeviceListMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceListMetadata; + public static fromObject(d: { [k: string]: any }): proto.DeviceListMetadata; + public static toObject(m: proto.DeviceListMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2818,14 +3124,17 @@ export namespace proto { class DeviceProps implements IDeviceProps { constructor(p?: proto.IDeviceProps); - public os: string; + public os?: (string|null); public version?: (proto.DeviceProps.IAppVersion|null); - public platformType: proto.DeviceProps.PlatformType; - public requireFullSync: boolean; + public platformType?: (proto.DeviceProps.PlatformType|null); + public requireFullSync?: (boolean|null); public historySyncConfig?: (proto.DeviceProps.IHistorySyncConfig|null); public static create(properties?: proto.IDeviceProps): proto.DeviceProps; public static encode(m: proto.IDeviceProps, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceProps; + public static fromObject(d: { [k: string]: any }): proto.DeviceProps; + public static toObject(m: proto.DeviceProps, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2841,14 +3150,17 @@ export namespace proto { class AppVersion implements IAppVersion { constructor(p?: proto.DeviceProps.IAppVersion); - public primary: number; - public secondary: number; - public tertiary: number; - public quaternary: number; - public quinary: number; + public primary?: (number|null); + public secondary?: (number|null); + public tertiary?: (number|null); + public quaternary?: (number|null); + public quinary?: (number|null); public static create(properties?: proto.DeviceProps.IAppVersion): proto.DeviceProps.AppVersion; public static encode(m: proto.DeviceProps.IAppVersion, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceProps.AppVersion; + public static fromObject(d: { [k: string]: any }): proto.DeviceProps.AppVersion; + public static toObject(m: proto.DeviceProps.AppVersion, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2871,23 +3183,26 @@ export namespace proto { class HistorySyncConfig implements IHistorySyncConfig { constructor(p?: proto.DeviceProps.IHistorySyncConfig); - public fullSyncDaysLimit: number; - public fullSyncSizeMbLimit: number; - public storageQuotaMb: number; - public inlineInitialPayloadInE2EeMsg: boolean; - public recentSyncDaysLimit: number; - public supportCallLogHistory: boolean; - public supportBotUserAgentChatHistory: boolean; - public supportCagReactionsAndPolls: boolean; - public supportBizHostedMsg: boolean; - public supportRecentSyncChunkMessageCountTuning: boolean; - public supportHostedGroupMsg: boolean; - public supportFbidBotChatHistory: boolean; - public supportAddOnHistorySyncMigration: boolean; - public supportMessageAssociation: boolean; + public fullSyncDaysLimit?: (number|null); + public fullSyncSizeMbLimit?: (number|null); + public storageQuotaMb?: (number|null); + public inlineInitialPayloadInE2EeMsg?: (boolean|null); + public recentSyncDaysLimit?: (number|null); + public supportCallLogHistory?: (boolean|null); + public supportBotUserAgentChatHistory?: (boolean|null); + public supportCagReactionsAndPolls?: (boolean|null); + public supportBizHostedMsg?: (boolean|null); + public supportRecentSyncChunkMessageCountTuning?: (boolean|null); + public supportHostedGroupMsg?: (boolean|null); + public supportFbidBotChatHistory?: (boolean|null); + public supportAddOnHistorySyncMigration?: (boolean|null); + public supportMessageAssociation?: (boolean|null); public static create(properties?: proto.DeviceProps.IHistorySyncConfig): proto.DeviceProps.HistorySyncConfig; public static encode(m: proto.DeviceProps.IHistorySyncConfig, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DeviceProps.HistorySyncConfig; + public static fromObject(d: { [k: string]: any }): proto.DeviceProps.HistorySyncConfig; + public static toObject(m: proto.DeviceProps.HistorySyncConfig, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2929,13 +3244,16 @@ export namespace proto { class DisappearingMode implements IDisappearingMode { constructor(p?: proto.IDisappearingMode); - public initiator: proto.DisappearingMode.Initiator; - public trigger: proto.DisappearingMode.Trigger; - public initiatorDeviceJid: string; - public initiatedByMe: boolean; + public initiator?: (proto.DisappearingMode.Initiator|null); + public trigger?: (proto.DisappearingMode.Trigger|null); + public initiatorDeviceJid?: (string|null); + public initiatedByMe?: (boolean|null); public static create(properties?: proto.IDisappearingMode): proto.DisappearingMode; public static encode(m: proto.IDisappearingMode, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.DisappearingMode; + public static fromObject(d: { [k: string]: any }): proto.DisappearingMode; + public static toObject(m: proto.DisappearingMode, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2971,6 +3289,9 @@ export namespace proto { public static create(properties?: proto.IEmbeddedContent): proto.EmbeddedContent; public static encode(m: proto.IEmbeddedContent, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EmbeddedContent; + public static fromObject(d: { [k: string]: any }): proto.EmbeddedContent; + public static toObject(m: proto.EmbeddedContent, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2981,11 +3302,14 @@ export namespace proto { class EmbeddedMessage implements IEmbeddedMessage { constructor(p?: proto.IEmbeddedMessage); - public stanzaId: string; + public stanzaId?: (string|null); public message?: (proto.IMessage|null); public static create(properties?: proto.IEmbeddedMessage): proto.EmbeddedMessage; public static encode(m: proto.IEmbeddedMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EmbeddedMessage; + public static fromObject(d: { [k: string]: any }): proto.EmbeddedMessage; + public static toObject(m: proto.EmbeddedMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3005,20 +3329,23 @@ export namespace proto { class EmbeddedMusic implements IEmbeddedMusic { constructor(p?: proto.IEmbeddedMusic); - public musicContentMediaId: string; - public songId: string; - public author: string; - public title: string; - public artworkDirectPath: string; - public artworkSha256: Uint8Array; - public artworkEncSha256: Uint8Array; - public artworkMediaKey: Uint8Array; - public artistAttribution: string; - public countryBlocklist: Uint8Array; - public isExplicit: boolean; + public musicContentMediaId?: (string|null); + public songId?: (string|null); + public author?: (string|null); + public title?: (string|null); + public artworkDirectPath?: (string|null); + public artworkSha256?: (Uint8Array|null); + public artworkEncSha256?: (Uint8Array|null); + public artworkMediaKey?: (Uint8Array|null); + public artistAttribution?: (string|null); + public countryBlocklist?: (Uint8Array|null); + public isExplicit?: (boolean|null); public static create(properties?: proto.IEmbeddedMusic): proto.EmbeddedMusic; public static encode(m: proto.IEmbeddedMusic, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EmbeddedMusic; + public static fromObject(d: { [k: string]: any }): proto.EmbeddedMusic; + public static toObject(m: proto.EmbeddedMusic, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3029,11 +3356,14 @@ export namespace proto { class EncryptedPairingRequest implements IEncryptedPairingRequest { constructor(p?: proto.IEncryptedPairingRequest); - public encryptedPayload: Uint8Array; - public iv: Uint8Array; + public encryptedPayload?: (Uint8Array|null); + public iv?: (Uint8Array|null); public static create(properties?: proto.IEncryptedPairingRequest): proto.EncryptedPairingRequest; public static encode(m: proto.IEncryptedPairingRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EncryptedPairingRequest; + public static fromObject(d: { [k: string]: any }): proto.EncryptedPairingRequest; + public static toObject(m: proto.EncryptedPairingRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3044,11 +3374,14 @@ export namespace proto { class EphemeralSetting implements IEphemeralSetting { constructor(p?: proto.IEphemeralSetting); - public duration: number; - public timestamp: (number|Long); + public duration?: (number|null); + public timestamp?: (number|Long|null); public static create(properties?: proto.IEphemeralSetting): proto.EphemeralSetting; public static encode(m: proto.IEphemeralSetting, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EphemeralSetting; + public static fromObject(d: { [k: string]: any }): proto.EphemeralSetting; + public static toObject(m: proto.EphemeralSetting, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3058,10 +3391,13 @@ export namespace proto { class EventAdditionalMetadata implements IEventAdditionalMetadata { constructor(p?: proto.IEventAdditionalMetadata); - public isStale: boolean; + public isStale?: (boolean|null); public static create(properties?: proto.IEventAdditionalMetadata): proto.EventAdditionalMetadata; public static encode(m: proto.IEventAdditionalMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EventAdditionalMetadata; + public static fromObject(d: { [k: string]: any }): proto.EventAdditionalMetadata; + public static toObject(m: proto.EventAdditionalMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3075,12 +3411,15 @@ export namespace proto { class EventResponse implements IEventResponse { constructor(p?: proto.IEventResponse); public eventResponseMessageKey?: (proto.IMessageKey|null); - public timestampMs: (number|Long); + public timestampMs?: (number|Long|null); public eventResponseMessage?: (proto.Message.IEventResponseMessage|null); - public unread: boolean; + public unread?: (boolean|null); public static create(properties?: proto.IEventResponse): proto.EventResponse; public static encode(m: proto.IEventResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EventResponse; + public static fromObject(d: { [k: string]: any }): proto.EventResponse; + public static toObject(m: proto.EventResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3091,11 +3430,14 @@ export namespace proto { class ExitCode implements IExitCode { constructor(p?: proto.IExitCode); - public code: (number|Long); - public text: string; + public code?: (number|Long|null); + public text?: (string|null); public static create(properties?: proto.IExitCode): proto.ExitCode; public static encode(m: proto.IExitCode, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ExitCode; + public static fromObject(d: { [k: string]: any }): proto.ExitCode; + public static toObject(m: proto.ExitCode, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3110,15 +3452,18 @@ export namespace proto { class ExternalBlobReference implements IExternalBlobReference { constructor(p?: proto.IExternalBlobReference); - public mediaKey: Uint8Array; - public directPath: string; - public handle: string; - public fileSizeBytes: (number|Long); - public fileSha256: Uint8Array; - public fileEncSha256: Uint8Array; + public mediaKey?: (Uint8Array|null); + public directPath?: (string|null); + public handle?: (string|null); + public fileSizeBytes?: (number|Long|null); + public fileSha256?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); public static create(properties?: proto.IExternalBlobReference): proto.ExternalBlobReference; public static encode(m: proto.IExternalBlobReference, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ExternalBlobReference; + public static fromObject(d: { [k: string]: any }): proto.ExternalBlobReference; + public static toObject(m: proto.ExternalBlobReference, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3132,14 +3477,17 @@ export namespace proto { class Field implements IField { constructor(p?: proto.IField); - public minVersion: number; - public maxVersion: number; - public notReportableMinVersion: number; - public isMessage: boolean; + public minVersion?: (number|null); + public maxVersion?: (number|null); + public notReportableMinVersion?: (number|null); + public isMessage?: (boolean|null); public subfield: { [k: string]: proto.IField }; public static create(properties?: proto.IField): proto.Field; public static encode(m: proto.IField, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Field; + public static fromObject(d: { [k: string]: any }): proto.Field; + public static toObject(m: proto.Field, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3169,28 +3517,31 @@ export namespace proto { class GlobalSettings implements IGlobalSettings { constructor(p?: proto.IGlobalSettings); public lightThemeWallpaper?: (proto.IWallpaperSettings|null); - public mediaVisibility: proto.MediaVisibility; + public mediaVisibility?: (proto.MediaVisibility|null); public darkThemeWallpaper?: (proto.IWallpaperSettings|null); public autoDownloadWiFi?: (proto.IAutoDownloadSettings|null); public autoDownloadCellular?: (proto.IAutoDownloadSettings|null); public autoDownloadRoaming?: (proto.IAutoDownloadSettings|null); - public showIndividualNotificationsPreview: boolean; - public showGroupNotificationsPreview: boolean; - public disappearingModeDuration: number; - public disappearingModeTimestamp: (number|Long); + public showIndividualNotificationsPreview?: (boolean|null); + public showGroupNotificationsPreview?: (boolean|null); + public disappearingModeDuration?: (number|null); + public disappearingModeTimestamp?: (number|Long|null); public avatarUserSettings?: (proto.IAvatarUserSettings|null); - public fontSize: number; - public securityNotifications: boolean; - public autoUnarchiveChats: boolean; - public videoQualityMode: number; - public photoQualityMode: number; + public fontSize?: (number|null); + public securityNotifications?: (boolean|null); + public autoUnarchiveChats?: (boolean|null); + public videoQualityMode?: (number|null); + public photoQualityMode?: (number|null); public individualNotificationSettings?: (proto.INotificationSettings|null); public groupNotificationSettings?: (proto.INotificationSettings|null); public chatLockSettings?: (proto.IChatLockSettings|null); - public chatDbLidMigrationTimestamp: (number|Long); + public chatDbLidMigrationTimestamp?: (number|Long|null); public static create(properties?: proto.IGlobalSettings): proto.GlobalSettings; public static encode(m: proto.IGlobalSettings, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.GlobalSettings; + public static fromObject(d: { [k: string]: any }): proto.GlobalSettings; + public static toObject(m: proto.GlobalSettings, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3201,26 +3552,32 @@ export namespace proto { class GroupMention implements IGroupMention { constructor(p?: proto.IGroupMention); - public groupJid: string; - public groupSubject: string; + public groupJid?: (string|null); + public groupSubject?: (string|null); public static create(properties?: proto.IGroupMention): proto.GroupMention; public static encode(m: proto.IGroupMention, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.GroupMention; + public static fromObject(d: { [k: string]: any }): proto.GroupMention; + public static toObject(m: proto.GroupMention, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface IGroupParticipant { - userJid: string; + userJid?: (string|null); rank?: (proto.GroupParticipant.Rank|null); } class GroupParticipant implements IGroupParticipant { constructor(p?: proto.IGroupParticipant); public userJid: string; - public rank: proto.GroupParticipant.Rank; + public rank?: (proto.GroupParticipant.Rank|null); public static create(properties?: proto.IGroupParticipant): proto.GroupParticipant; public static encode(m: proto.IGroupParticipant, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.GroupParticipant; + public static fromObject(d: { [k: string]: any }): proto.GroupParticipant; + public static toObject(m: proto.GroupParticipant, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3247,6 +3604,9 @@ export namespace proto { public static create(properties?: proto.IHandshakeMessage): proto.HandshakeMessage; public static encode(m: proto.IHandshakeMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HandshakeMessage; + public static fromObject(d: { [k: string]: any }): proto.HandshakeMessage; + public static toObject(m: proto.HandshakeMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3259,11 +3619,14 @@ export namespace proto { class ClientFinish implements IClientFinish { constructor(p?: proto.HandshakeMessage.IClientFinish); - public static: Uint8Array; - public payload: Uint8Array; + public static?: (Uint8Array|null); + public payload?: (Uint8Array|null); public static create(properties?: proto.HandshakeMessage.IClientFinish): proto.HandshakeMessage.ClientFinish; public static encode(m: proto.HandshakeMessage.IClientFinish, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HandshakeMessage.ClientFinish; + public static fromObject(d: { [k: string]: any }): proto.HandshakeMessage.ClientFinish; + public static toObject(m: proto.HandshakeMessage.ClientFinish, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3275,12 +3638,15 @@ export namespace proto { class ClientHello implements IClientHello { constructor(p?: proto.HandshakeMessage.IClientHello); - public ephemeral: Uint8Array; - public static: Uint8Array; - public payload: Uint8Array; + public ephemeral?: (Uint8Array|null); + public static?: (Uint8Array|null); + public payload?: (Uint8Array|null); public static create(properties?: proto.HandshakeMessage.IClientHello): proto.HandshakeMessage.ClientHello; public static encode(m: proto.HandshakeMessage.IClientHello, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HandshakeMessage.ClientHello; + public static fromObject(d: { [k: string]: any }): proto.HandshakeMessage.ClientHello; + public static toObject(m: proto.HandshakeMessage.ClientHello, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3292,18 +3658,21 @@ export namespace proto { class ServerHello implements IServerHello { constructor(p?: proto.HandshakeMessage.IServerHello); - public ephemeral: Uint8Array; - public static: Uint8Array; - public payload: Uint8Array; + public ephemeral?: (Uint8Array|null); + public static?: (Uint8Array|null); + public payload?: (Uint8Array|null); public static create(properties?: proto.HandshakeMessage.IServerHello): proto.HandshakeMessage.ServerHello; public static encode(m: proto.HandshakeMessage.IServerHello, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HandshakeMessage.ServerHello; + public static fromObject(d: { [k: string]: any }): proto.HandshakeMessage.ServerHello; + public static toObject(m: proto.HandshakeMessage.ServerHello, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } interface IHistorySync { - syncType: proto.HistorySync.HistorySyncType; + syncType?: (proto.HistorySync.HistorySyncType|null); conversations?: (proto.IConversation[]|null); statusV3Messages?: (proto.IWebMessageInfo[]|null); chunkOrder?: (number|null); @@ -3327,23 +3696,26 @@ export namespace proto { public syncType: proto.HistorySync.HistorySyncType; public conversations: proto.IConversation[]; public statusV3Messages: proto.IWebMessageInfo[]; - public chunkOrder: number; - public progress: number; + public chunkOrder?: (number|null); + public progress?: (number|null); public pushnames: proto.IPushname[]; public globalSettings?: (proto.IGlobalSettings|null); - public threadIdUserSecret: Uint8Array; - public threadDsTimeframeOffset: number; + public threadIdUserSecret?: (Uint8Array|null); + public threadDsTimeframeOffset?: (number|null); public recentStickers: proto.IStickerMetadata[]; public pastParticipants: proto.IPastParticipants[]; public callLogRecords: proto.ICallLogRecord[]; - public aiWaitListState: proto.HistorySync.BotAIWaitListState; + public aiWaitListState?: (proto.HistorySync.BotAIWaitListState|null); public phoneNumberToLidMappings: proto.IPhoneNumberToLIDMapping[]; - public companionMetaNonce: string; - public shareableChatIdentifierEncryptionKey: Uint8Array; + public companionMetaNonce?: (string|null); + public shareableChatIdentifierEncryptionKey?: (Uint8Array|null); public accounts: proto.IAccount[]; public static create(properties?: proto.IHistorySync): proto.HistorySync; public static encode(m: proto.IHistorySync, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HistorySync; + public static fromObject(d: { [k: string]: any }): proto.HistorySync; + public static toObject(m: proto.HistorySync, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3373,10 +3745,13 @@ export namespace proto { class HistorySyncMsg implements IHistorySyncMsg { constructor(p?: proto.IHistorySyncMsg); public message?: (proto.IWebMessageInfo|null); - public msgOrderId: (number|Long); + public msgOrderId?: (number|Long|null); public static create(properties?: proto.IHistorySyncMsg): proto.HistorySyncMsg; public static encode(m: proto.IHistorySyncMsg, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HistorySyncMsg; + public static fromObject(d: { [k: string]: any }): proto.HistorySyncMsg; + public static toObject(m: proto.HistorySyncMsg, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3389,7 +3764,7 @@ export namespace proto { class HydratedTemplateButton implements IHydratedTemplateButton { constructor(p?: proto.IHydratedTemplateButton); - public index: number; + public index?: (number|null); public quickReplyButton?: (proto.HydratedTemplateButton.IHydratedQuickReplyButton|null); public urlButton?: (proto.HydratedTemplateButton.IHydratedURLButton|null); public callButton?: (proto.HydratedTemplateButton.IHydratedCallButton|null); @@ -3397,6 +3772,9 @@ export namespace proto { public static create(properties?: proto.IHydratedTemplateButton): proto.HydratedTemplateButton; public static encode(m: proto.IHydratedTemplateButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HydratedTemplateButton; + public static fromObject(d: { [k: string]: any }): proto.HydratedTemplateButton; + public static toObject(m: proto.HydratedTemplateButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3409,11 +3787,14 @@ export namespace proto { class HydratedCallButton implements IHydratedCallButton { constructor(p?: proto.HydratedTemplateButton.IHydratedCallButton); - public displayText: string; - public phoneNumber: string; + public displayText?: (string|null); + public phoneNumber?: (string|null); public static create(properties?: proto.HydratedTemplateButton.IHydratedCallButton): proto.HydratedTemplateButton.HydratedCallButton; public static encode(m: proto.HydratedTemplateButton.IHydratedCallButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HydratedTemplateButton.HydratedCallButton; + public static fromObject(d: { [k: string]: any }): proto.HydratedTemplateButton.HydratedCallButton; + public static toObject(m: proto.HydratedTemplateButton.HydratedCallButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3424,11 +3805,14 @@ export namespace proto { class HydratedQuickReplyButton implements IHydratedQuickReplyButton { constructor(p?: proto.HydratedTemplateButton.IHydratedQuickReplyButton); - public displayText: string; - public id: string; + public displayText?: (string|null); + public id?: (string|null); public static create(properties?: proto.HydratedTemplateButton.IHydratedQuickReplyButton): proto.HydratedTemplateButton.HydratedQuickReplyButton; public static encode(m: proto.HydratedTemplateButton.IHydratedQuickReplyButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HydratedTemplateButton.HydratedQuickReplyButton; + public static fromObject(d: { [k: string]: any }): proto.HydratedTemplateButton.HydratedQuickReplyButton; + public static toObject(m: proto.HydratedTemplateButton.HydratedQuickReplyButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3441,13 +3825,16 @@ export namespace proto { class HydratedURLButton implements IHydratedURLButton { constructor(p?: proto.HydratedTemplateButton.IHydratedURLButton); - public displayText: string; - public url: string; - public consentedUsersUrl: string; - public webviewPresentation: proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType; + public displayText?: (string|null); + public url?: (string|null); + public consentedUsersUrl?: (string|null); + public webviewPresentation?: (proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType|null); public static create(properties?: proto.HydratedTemplateButton.IHydratedURLButton): proto.HydratedTemplateButton.HydratedURLButton; public static encode(m: proto.HydratedTemplateButton.IHydratedURLButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.HydratedTemplateButton.HydratedURLButton; + public static fromObject(d: { [k: string]: any }): proto.HydratedTemplateButton.HydratedURLButton; + public static toObject(m: proto.HydratedTemplateButton.HydratedURLButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3468,11 +3855,14 @@ export namespace proto { class IdentityKeyPairStructure implements IIdentityKeyPairStructure { constructor(p?: proto.IIdentityKeyPairStructure); - public publicKey: Uint8Array; - public privateKey: Uint8Array; + public publicKey?: (Uint8Array|null); + public privateKey?: (Uint8Array|null); public static create(properties?: proto.IIdentityKeyPairStructure): proto.IdentityKeyPairStructure; public static encode(m: proto.IIdentityKeyPairStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.IdentityKeyPairStructure; + public static fromObject(d: { [k: string]: any }): proto.IdentityKeyPairStructure; + public static toObject(m: proto.IdentityKeyPairStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3490,9 +3880,9 @@ export namespace proto { class InteractiveAnnotation implements IInteractiveAnnotation { constructor(p?: proto.IInteractiveAnnotation); public polygonVertices: proto.IPoint[]; - public shouldSkipConfirmation: boolean; + public shouldSkipConfirmation?: (boolean|null); public embeddedContent?: (proto.IEmbeddedContent|null); - public statusLinkType: proto.InteractiveAnnotation.StatusLinkType; + public statusLinkType?: (proto.InteractiveAnnotation.StatusLinkType|null); public location?: (proto.ILocation|null); public newsletter?: (proto.ContextInfo.IForwardedNewsletterMessageInfo|null); public embeddedAction?: (boolean|null); @@ -3501,6 +3891,9 @@ export namespace proto { public static create(properties?: proto.IInteractiveAnnotation): proto.InteractiveAnnotation; public static encode(m: proto.IInteractiveAnnotation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.InteractiveAnnotation; + public static fromObject(d: { [k: string]: any }): proto.InteractiveAnnotation; + public static toObject(m: proto.InteractiveAnnotation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3524,15 +3917,18 @@ export namespace proto { class KeepInChat implements IKeepInChat { constructor(p?: proto.IKeepInChat); - public keepType: proto.KeepType; - public serverTimestamp: (number|Long); + public keepType?: (proto.KeepType|null); + public serverTimestamp?: (number|Long|null); public key?: (proto.IMessageKey|null); - public deviceJid: string; - public clientTimestampMs: (number|Long); - public serverTimestampMs: (number|Long); + public deviceJid?: (string|null); + public clientTimestampMs?: (number|Long|null); + public serverTimestampMs?: (number|Long|null); public static create(properties?: proto.IKeepInChat): proto.KeepInChat; public static encode(m: proto.IKeepInChat, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeepInChat; + public static fromObject(d: { [k: string]: any }): proto.KeepInChat; + public static toObject(m: proto.KeepInChat, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3552,14 +3948,17 @@ export namespace proto { class KeyExchangeMessage implements IKeyExchangeMessage { constructor(p?: proto.IKeyExchangeMessage); - public id: number; - public baseKey: Uint8Array; - public ratchetKey: Uint8Array; - public identityKey: Uint8Array; - public baseKeySignature: Uint8Array; + public id?: (number|null); + public baseKey?: (Uint8Array|null); + public ratchetKey?: (Uint8Array|null); + public identityKey?: (Uint8Array|null); + public baseKeySignature?: (Uint8Array|null); public static create(properties?: proto.IKeyExchangeMessage): proto.KeyExchangeMessage; public static encode(m: proto.IKeyExchangeMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyExchangeMessage; + public static fromObject(d: { [k: string]: any }): proto.KeyExchangeMessage; + public static toObject(m: proto.KeyExchangeMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3569,16 +3968,19 @@ export namespace proto { class KeyId implements IKeyId { constructor(p?: proto.IKeyId); - public id: Uint8Array; + public id?: (Uint8Array|null); public static create(properties?: proto.IKeyId): proto.KeyId; public static encode(m: proto.IKeyId, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyId; + public static fromObject(d: { [k: string]: any }): proto.KeyId; + public static toObject(m: proto.KeyId, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface ILIDMigrationMapping { - pn: (number|Long); - assignedLid: (number|Long); + pn?: (number|Long|null); + assignedLid?: (number|Long|null); latestLid?: (number|Long|null); } @@ -3586,10 +3988,13 @@ export namespace proto { constructor(p?: proto.ILIDMigrationMapping); public pn: (number|Long); public assignedLid: (number|Long); - public latestLid: (number|Long); + public latestLid?: (number|Long|null); public static create(properties?: proto.ILIDMigrationMapping): proto.LIDMigrationMapping; public static encode(m: proto.ILIDMigrationMapping, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.LIDMigrationMapping; + public static fromObject(d: { [k: string]: any }): proto.LIDMigrationMapping; + public static toObject(m: proto.LIDMigrationMapping, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3599,10 +4004,13 @@ export namespace proto { class LIDMigrationMappingSyncMessage implements ILIDMigrationMappingSyncMessage { constructor(p?: proto.ILIDMigrationMappingSyncMessage); - public encodedMappingPayload: Uint8Array; + public encodedMappingPayload?: (Uint8Array|null); public static create(properties?: proto.ILIDMigrationMappingSyncMessage): proto.LIDMigrationMappingSyncMessage; public static encode(m: proto.ILIDMigrationMappingSyncMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.LIDMigrationMappingSyncMessage; + public static fromObject(d: { [k: string]: any }): proto.LIDMigrationMappingSyncMessage; + public static toObject(m: proto.LIDMigrationMappingSyncMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3614,10 +4022,13 @@ export namespace proto { class LIDMigrationMappingSyncPayload implements ILIDMigrationMappingSyncPayload { constructor(p?: proto.ILIDMigrationMappingSyncPayload); public pnToLidMappings: proto.ILIDMigrationMapping[]; - public chatDbMigrationTimestamp: (number|Long); + public chatDbMigrationTimestamp?: (number|Long|null); public static create(properties?: proto.ILIDMigrationMappingSyncPayload): proto.LIDMigrationMappingSyncPayload; public static encode(m: proto.ILIDMigrationMappingSyncPayload, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.LIDMigrationMappingSyncPayload; + public static fromObject(d: { [k: string]: any }): proto.LIDMigrationMappingSyncPayload; + public static toObject(m: proto.LIDMigrationMappingSyncPayload, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3633,6 +4044,9 @@ export namespace proto { public static create(properties?: proto.ILegacyMessage): proto.LegacyMessage; public static encode(m: proto.ILegacyMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.LegacyMessage; + public static fromObject(d: { [k: string]: any }): proto.LegacyMessage; + public static toObject(m: proto.LegacyMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3645,13 +4059,16 @@ export namespace proto { class LimitSharing implements ILimitSharing { constructor(p?: proto.ILimitSharing); - public sharingLimited: boolean; - public trigger: proto.LimitSharing.TriggerType; - public limitSharingSettingTimestamp: (number|Long); - public initiatedByMe: boolean; + public sharingLimited?: (boolean|null); + public trigger?: (proto.LimitSharing.TriggerType|null); + public limitSharingSettingTimestamp?: (number|Long|null); + public initiatedByMe?: (boolean|null); public static create(properties?: proto.ILimitSharing): proto.LimitSharing; public static encode(m: proto.ILimitSharing, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.LimitSharing; + public static fromObject(d: { [k: string]: any }): proto.LimitSharing; + public static toObject(m: proto.LimitSharing, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3673,12 +4090,15 @@ export namespace proto { class LocalizedName implements ILocalizedName { constructor(p?: proto.ILocalizedName); - public lg: string; - public lc: string; - public verifiedName: string; + public lg?: (string|null); + public lc?: (string|null); + public verifiedName?: (string|null); public static create(properties?: proto.ILocalizedName): proto.LocalizedName; public static encode(m: proto.ILocalizedName, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.LocalizedName; + public static fromObject(d: { [k: string]: any }): proto.LocalizedName; + public static toObject(m: proto.LocalizedName, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3690,12 +4110,15 @@ export namespace proto { class Location implements ILocation { constructor(p?: proto.ILocation); - public degreesLatitude: number; - public degreesLongitude: number; - public name: string; + public degreesLatitude?: (number|null); + public degreesLongitude?: (number|null); + public name?: (string|null); public static create(properties?: proto.ILocation): proto.Location; public static encode(m: proto.ILocation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Location; + public static fromObject(d: { [k: string]: any }): proto.Location; + public static toObject(m: proto.Location, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3705,10 +4128,13 @@ export namespace proto { class MediaData implements IMediaData { constructor(p?: proto.IMediaData); - public localPath: string; + public localPath?: (string|null); public static create(properties?: proto.IMediaData): proto.MediaData; public static encode(m: proto.IMediaData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MediaData; + public static fromObject(d: { [k: string]: any }): proto.MediaData; + public static toObject(m: proto.MediaData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3720,12 +4146,15 @@ export namespace proto { class MediaNotifyMessage implements IMediaNotifyMessage { constructor(p?: proto.IMediaNotifyMessage); - public expressPathUrl: string; - public fileEncSha256: Uint8Array; - public fileLength: (number|Long); + public expressPathUrl?: (string|null); + public fileEncSha256?: (Uint8Array|null); + public fileLength?: (number|Long|null); public static create(properties?: proto.IMediaNotifyMessage): proto.MediaNotifyMessage; public static encode(m: proto.IMediaNotifyMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MediaNotifyMessage; + public static fromObject(d: { [k: string]: any }): proto.MediaNotifyMessage; + public static toObject(m: proto.MediaNotifyMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3738,13 +4167,16 @@ export namespace proto { class MediaRetryNotification implements IMediaRetryNotification { constructor(p?: proto.IMediaRetryNotification); - public stanzaId: string; - public directPath: string; - public result: proto.MediaRetryNotification.ResultType; - public messageSecret: Uint8Array; + public stanzaId?: (string|null); + public directPath?: (string|null); + public result?: (proto.MediaRetryNotification.ResultType|null); + public messageSecret?: (Uint8Array|null); public static create(properties?: proto.IMediaRetryNotification): proto.MediaRetryNotification; public static encode(m: proto.IMediaRetryNotification, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MediaRetryNotification; + public static fromObject(d: { [k: string]: any }): proto.MediaRetryNotification; + public static toObject(m: proto.MediaRetryNotification, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3771,11 +4203,14 @@ export namespace proto { class MemberLabel implements IMemberLabel { constructor(p?: proto.IMemberLabel); - public label: string; - public labelTimestamp: (number|Long); + public label?: (string|null); + public labelTimestamp?: (number|Long|null); public static create(properties?: proto.IMemberLabel): proto.MemberLabel; public static encode(m: proto.IMemberLabel, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MemberLabel; + public static fromObject(d: { [k: string]: any }): proto.MemberLabel; + public static toObject(m: proto.MemberLabel, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3870,7 +4305,7 @@ export namespace proto { class Message implements IMessage { constructor(p?: proto.IMessage); - public conversation: string; + public conversation?: (string|null); public senderKeyDistributionMessage?: (proto.Message.ISenderKeyDistributionMessage|null); public imageMessage?: (proto.Message.IImageMessage|null); public contactMessage?: (proto.Message.IContactMessage|null); @@ -3959,6 +4394,9 @@ export namespace proto { public static create(properties?: proto.IMessage): proto.Message; public static encode(m: proto.IMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message; + public static fromObject(d: { [k: string]: any }): proto.Message; + public static toObject(m: proto.Message, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3972,12 +4410,15 @@ export namespace proto { class AlbumMessage implements IAlbumMessage { constructor(p?: proto.Message.IAlbumMessage); - public expectedImageCount: number; - public expectedVideoCount: number; + public expectedImageCount?: (number|null); + public expectedVideoCount?: (number|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.IAlbumMessage): proto.Message.AlbumMessage; public static encode(m: proto.Message.IAlbumMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AlbumMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.AlbumMessage; + public static toObject(m: proto.Message.AlbumMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -3989,10 +4430,13 @@ export namespace proto { class AppStateFatalExceptionNotification implements IAppStateFatalExceptionNotification { constructor(p?: proto.Message.IAppStateFatalExceptionNotification); public collectionNames: string[]; - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public static create(properties?: proto.Message.IAppStateFatalExceptionNotification): proto.Message.AppStateFatalExceptionNotification; public static encode(m: proto.Message.IAppStateFatalExceptionNotification, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateFatalExceptionNotification; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateFatalExceptionNotification; + public static toObject(m: proto.Message.AppStateFatalExceptionNotification, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4008,6 +4452,9 @@ export namespace proto { public static create(properties?: proto.Message.IAppStateSyncKey): proto.Message.AppStateSyncKey; public static encode(m: proto.Message.IAppStateSyncKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateSyncKey; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateSyncKey; + public static toObject(m: proto.Message.AppStateSyncKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4019,12 +4466,15 @@ export namespace proto { class AppStateSyncKeyData implements IAppStateSyncKeyData { constructor(p?: proto.Message.IAppStateSyncKeyData); - public keyData: Uint8Array; + public keyData?: (Uint8Array|null); public fingerprint?: (proto.Message.IAppStateSyncKeyFingerprint|null); - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public static create(properties?: proto.Message.IAppStateSyncKeyData): proto.Message.AppStateSyncKeyData; public static encode(m: proto.Message.IAppStateSyncKeyData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateSyncKeyData; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateSyncKeyData; + public static toObject(m: proto.Message.AppStateSyncKeyData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4036,12 +4486,15 @@ export namespace proto { class AppStateSyncKeyFingerprint implements IAppStateSyncKeyFingerprint { constructor(p?: proto.Message.IAppStateSyncKeyFingerprint); - public rawId: number; - public currentIndex: number; + public rawId?: (number|null); + public currentIndex?: (number|null); public deviceIndexes: number[]; public static create(properties?: proto.Message.IAppStateSyncKeyFingerprint): proto.Message.AppStateSyncKeyFingerprint; public static encode(m: proto.Message.IAppStateSyncKeyFingerprint, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateSyncKeyFingerprint; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateSyncKeyFingerprint; + public static toObject(m: proto.Message.AppStateSyncKeyFingerprint, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4051,10 +4504,13 @@ export namespace proto { class AppStateSyncKeyId implements IAppStateSyncKeyId { constructor(p?: proto.Message.IAppStateSyncKeyId); - public keyId: Uint8Array; + public keyId?: (Uint8Array|null); public static create(properties?: proto.Message.IAppStateSyncKeyId): proto.Message.AppStateSyncKeyId; public static encode(m: proto.Message.IAppStateSyncKeyId, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateSyncKeyId; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateSyncKeyId; + public static toObject(m: proto.Message.AppStateSyncKeyId, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4068,6 +4524,9 @@ export namespace proto { public static create(properties?: proto.Message.IAppStateSyncKeyRequest): proto.Message.AppStateSyncKeyRequest; public static encode(m: proto.Message.IAppStateSyncKeyRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateSyncKeyRequest; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateSyncKeyRequest; + public static toObject(m: proto.Message.AppStateSyncKeyRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4081,6 +4540,9 @@ export namespace proto { public static create(properties?: proto.Message.IAppStateSyncKeyShare): proto.Message.AppStateSyncKeyShare; public static encode(m: proto.Message.IAppStateSyncKeyShare, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AppStateSyncKeyShare; + public static fromObject(d: { [k: string]: any }): proto.Message.AppStateSyncKeyShare; + public static toObject(m: proto.Message.AppStateSyncKeyShare, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4105,25 +4567,28 @@ export namespace proto { class AudioMessage implements IAudioMessage { constructor(p?: proto.Message.IAudioMessage); - public url: string; - public mimetype: string; - public fileSha256: Uint8Array; - public fileLength: (number|Long); - public seconds: number; - public ptt: boolean; - public mediaKey: Uint8Array; - public fileEncSha256: Uint8Array; - public directPath: string; - public mediaKeyTimestamp: (number|Long); + public url?: (string|null); + public mimetype?: (string|null); + public fileSha256?: (Uint8Array|null); + public fileLength?: (number|Long|null); + public seconds?: (number|null); + public ptt?: (boolean|null); + public mediaKey?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public directPath?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); public contextInfo?: (proto.IContextInfo|null); - public streamingSidecar: Uint8Array; - public waveform: Uint8Array; - public backgroundArgb: number; - public viewOnce: boolean; - public accessibilityLabel: string; + public streamingSidecar?: (Uint8Array|null); + public waveform?: (Uint8Array|null); + public backgroundArgb?: (number|null); + public viewOnce?: (boolean|null); + public accessibilityLabel?: (string|null); public static create(properties?: proto.Message.IAudioMessage): proto.Message.AudioMessage; public static encode(m: proto.Message.IAudioMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.AudioMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.AudioMessage; + public static toObject(m: proto.Message.AudioMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4136,13 +4601,16 @@ export namespace proto { class BCallMessage implements IBCallMessage { constructor(p?: proto.Message.IBCallMessage); - public sessionId: string; - public mediaType: proto.Message.BCallMessage.MediaType; - public masterKey: Uint8Array; - public caption: string; + public sessionId?: (string|null); + public mediaType?: (proto.Message.BCallMessage.MediaType|null); + public masterKey?: (Uint8Array|null); + public caption?: (string|null); public static create(properties?: proto.Message.IBCallMessage): proto.Message.BCallMessage; public static encode(m: proto.Message.IBCallMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.BCallMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.BCallMessage; + public static toObject(m: proto.Message.BCallMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4167,14 +4635,17 @@ export namespace proto { class BotFeedbackMessage implements IBotFeedbackMessage { constructor(p?: proto.Message.IBotFeedbackMessage); public messageKey?: (proto.IMessageKey|null); - public kind: proto.Message.BotFeedbackMessage.BotFeedbackKind; - public text: string; - public kindNegative: (number|Long); - public kindPositive: (number|Long); - public kindReport: proto.Message.BotFeedbackMessage.ReportKind; + public kind?: (proto.Message.BotFeedbackMessage.BotFeedbackKind|null); + public text?: (string|null); + public kindNegative?: (number|Long|null); + public kindPositive?: (number|Long|null); + public kindReport?: (proto.Message.BotFeedbackMessage.ReportKind|null); public static create(properties?: proto.Message.IBotFeedbackMessage): proto.Message.BotFeedbackMessage; public static encode(m: proto.Message.IBotFeedbackMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.BotFeedbackMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.BotFeedbackMessage; + public static toObject(m: proto.Message.BotFeedbackMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4232,11 +4703,11 @@ export namespace proto { class ButtonsMessage implements IButtonsMessage { constructor(p?: proto.Message.IButtonsMessage); - public contentText: string; - public footerText: string; + public contentText?: (string|null); + public footerText?: (string|null); public contextInfo?: (proto.IContextInfo|null); public buttons: proto.Message.ButtonsMessage.IButton[]; - public headerType: proto.Message.ButtonsMessage.HeaderType; + public headerType?: (proto.Message.ButtonsMessage.HeaderType|null); public text?: (string|null); public documentMessage?: (proto.Message.IDocumentMessage|null); public imageMessage?: (proto.Message.IImageMessage|null); @@ -4246,6 +4717,9 @@ export namespace proto { public static create(properties?: proto.Message.IButtonsMessage): proto.Message.ButtonsMessage; public static encode(m: proto.Message.IButtonsMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ButtonsMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ButtonsMessage; + public static toObject(m: proto.Message.ButtonsMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4260,13 +4734,16 @@ export namespace proto { class Button implements IButton { constructor(p?: proto.Message.ButtonsMessage.IButton); - public buttonId: string; + public buttonId?: (string|null); public buttonText?: (proto.Message.ButtonsMessage.Button.IButtonText|null); - public type: proto.Message.ButtonsMessage.Button.Type; + public type?: (proto.Message.ButtonsMessage.Button.Type|null); public nativeFlowInfo?: (proto.Message.ButtonsMessage.Button.INativeFlowInfo|null); public static create(properties?: proto.Message.ButtonsMessage.IButton): proto.Message.ButtonsMessage.Button; public static encode(m: proto.Message.ButtonsMessage.IButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ButtonsMessage.Button; + public static fromObject(d: { [k: string]: any }): proto.Message.ButtonsMessage.Button; + public static toObject(m: proto.Message.ButtonsMessage.Button, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4278,10 +4755,13 @@ export namespace proto { class ButtonText implements IButtonText { constructor(p?: proto.Message.ButtonsMessage.Button.IButtonText); - public displayText: string; + public displayText?: (string|null); public static create(properties?: proto.Message.ButtonsMessage.Button.IButtonText): proto.Message.ButtonsMessage.Button.ButtonText; public static encode(m: proto.Message.ButtonsMessage.Button.IButtonText, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ButtonsMessage.Button.ButtonText; + public static fromObject(d: { [k: string]: any }): proto.Message.ButtonsMessage.Button.ButtonText; + public static toObject(m: proto.Message.ButtonsMessage.Button.ButtonText, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4292,11 +4772,14 @@ export namespace proto { class NativeFlowInfo implements INativeFlowInfo { constructor(p?: proto.Message.ButtonsMessage.Button.INativeFlowInfo); - public name: string; - public paramsJson: string; + public name?: (string|null); + public paramsJson?: (string|null); public static create(properties?: proto.Message.ButtonsMessage.Button.INativeFlowInfo): proto.Message.ButtonsMessage.Button.NativeFlowInfo; public static encode(m: proto.Message.ButtonsMessage.Button.INativeFlowInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ButtonsMessage.Button.NativeFlowInfo; + public static fromObject(d: { [k: string]: any }): proto.Message.ButtonsMessage.Button.NativeFlowInfo; + public static toObject(m: proto.Message.ButtonsMessage.Button.NativeFlowInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4327,14 +4810,17 @@ export namespace proto { class ButtonsResponseMessage implements IButtonsResponseMessage { constructor(p?: proto.Message.IButtonsResponseMessage); - public selectedButtonId: string; + public selectedButtonId?: (string|null); public contextInfo?: (proto.IContextInfo|null); - public type: proto.Message.ButtonsResponseMessage.Type; + public type?: (proto.Message.ButtonsResponseMessage.Type|null); public selectedDisplayText?: (string|null); public response?: "selectedDisplayText"; public static create(properties?: proto.Message.IButtonsResponseMessage): proto.Message.ButtonsResponseMessage; public static encode(m: proto.Message.IButtonsResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ButtonsResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ButtonsResponseMessage; + public static toObject(m: proto.Message.ButtonsResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4358,16 +4844,19 @@ export namespace proto { class Call implements ICall { constructor(p?: proto.Message.ICall); - public callKey: Uint8Array; - public conversionSource: string; - public conversionData: Uint8Array; - public conversionDelaySeconds: number; - public ctwaSignals: string; - public ctwaPayload: Uint8Array; + public callKey?: (Uint8Array|null); + public conversionSource?: (string|null); + public conversionData?: (Uint8Array|null); + public conversionDelaySeconds?: (number|null); + public ctwaSignals?: (string|null); + public ctwaPayload?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.ICall): proto.Message.Call; public static encode(m: proto.Message.ICall, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.Call; + public static fromObject(d: { [k: string]: any }): proto.Message.Call; + public static toObject(m: proto.Message.Call, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4381,14 +4870,17 @@ export namespace proto { class CallLogMessage implements ICallLogMessage { constructor(p?: proto.Message.ICallLogMessage); - public isVideo: boolean; - public callOutcome: proto.Message.CallLogMessage.CallOutcome; - public durationSecs: (number|Long); - public callType: proto.Message.CallLogMessage.CallType; + public isVideo?: (boolean|null); + public callOutcome?: (proto.Message.CallLogMessage.CallOutcome|null); + public durationSecs?: (number|Long|null); + public callType?: (proto.Message.CallLogMessage.CallType|null); public participants: proto.Message.CallLogMessage.ICallParticipant[]; public static create(properties?: proto.Message.ICallLogMessage): proto.Message.CallLogMessage; public static encode(m: proto.Message.ICallLogMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.CallLogMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.CallLogMessage; + public static toObject(m: proto.Message.CallLogMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4412,11 +4904,14 @@ export namespace proto { class CallParticipant implements ICallParticipant { constructor(p?: proto.Message.CallLogMessage.ICallParticipant); - public jid: string; - public callOutcome: proto.Message.CallLogMessage.CallOutcome; + public jid?: (string|null); + public callOutcome?: (proto.Message.CallLogMessage.CallOutcome|null); public static create(properties?: proto.Message.CallLogMessage.ICallParticipant): proto.Message.CallLogMessage.CallParticipant; public static encode(m: proto.Message.CallLogMessage.ICallParticipant, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.CallLogMessage.CallParticipant; + public static fromObject(d: { [k: string]: any }): proto.Message.CallLogMessage.CallParticipant; + public static toObject(m: proto.Message.CallLogMessage.CallParticipant, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4437,6 +4932,9 @@ export namespace proto { public static create(properties?: proto.Message.ICancelPaymentRequestMessage): proto.Message.CancelPaymentRequestMessage; public static encode(m: proto.Message.ICancelPaymentRequestMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.CancelPaymentRequestMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.CancelPaymentRequestMessage; + public static toObject(m: proto.Message.CancelPaymentRequestMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4447,11 +4945,14 @@ export namespace proto { class Chat implements IChat { constructor(p?: proto.Message.IChat); - public displayName: string; - public id: string; + public displayName?: (string|null); + public id?: (string|null); public static create(properties?: proto.Message.IChat): proto.Message.Chat; public static encode(m: proto.Message.IChat, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.Chat; + public static fromObject(d: { [k: string]: any }): proto.Message.Chat; + public static toObject(m: proto.Message.Chat, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4465,14 +4966,17 @@ export namespace proto { class CloudAPIThreadControlNotification implements ICloudAPIThreadControlNotification { constructor(p?: proto.Message.ICloudAPIThreadControlNotification); - public status: proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl; - public senderNotificationTimestampMs: (number|Long); - public consumerLid: string; - public consumerPhoneNumber: string; + public status?: (proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl|null); + public senderNotificationTimestampMs?: (number|Long|null); + public consumerLid?: (string|null); + public consumerPhoneNumber?: (string|null); public notificationContent?: (proto.Message.CloudAPIThreadControlNotification.ICloudAPIThreadControlNotificationContent|null); public static create(properties?: proto.Message.ICloudAPIThreadControlNotification): proto.Message.CloudAPIThreadControlNotification; public static encode(m: proto.Message.ICloudAPIThreadControlNotification, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.CloudAPIThreadControlNotification; + public static fromObject(d: { [k: string]: any }): proto.Message.CloudAPIThreadControlNotification; + public static toObject(m: proto.Message.CloudAPIThreadControlNotification, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4491,11 +4995,14 @@ export namespace proto { class CloudAPIThreadControlNotificationContent implements ICloudAPIThreadControlNotificationContent { constructor(p?: proto.Message.CloudAPIThreadControlNotification.ICloudAPIThreadControlNotificationContent); - public handoffNotificationText: string; - public extraJson: string; + public handoffNotificationText?: (string|null); + public extraJson?: (string|null); public static create(properties?: proto.Message.CloudAPIThreadControlNotification.ICloudAPIThreadControlNotificationContent): proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent; public static encode(m: proto.Message.CloudAPIThreadControlNotification.ICloudAPIThreadControlNotificationContent, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent; + public static fromObject(d: { [k: string]: any }): proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent; + public static toObject(m: proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -4512,6 +5019,9 @@ export namespace proto { public static create(properties?: proto.Message.ICommentMessage): proto.Message.CommentMessage; public static encode(m: proto.Message.ICommentMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.CommentMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.CommentMessage; + public static toObject(m: proto.Message.CommentMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4523,12 +5033,15 @@ export namespace proto { class ContactMessage implements IContactMessage { constructor(p?: proto.Message.IContactMessage); - public displayName: string; - public vcard: string; + public displayName?: (string|null); + public vcard?: (string|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.IContactMessage): proto.Message.ContactMessage; public static encode(m: proto.Message.IContactMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ContactMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ContactMessage; + public static toObject(m: proto.Message.ContactMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4540,12 +5053,15 @@ export namespace proto { class ContactsArrayMessage implements IContactsArrayMessage { constructor(p?: proto.Message.IContactsArrayMessage); - public displayName: string; + public displayName?: (string|null); public contacts: proto.Message.IContactMessage[]; public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.IContactsArrayMessage): proto.Message.ContactsArrayMessage; public static encode(m: proto.Message.IContactsArrayMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ContactsArrayMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ContactsArrayMessage; + public static toObject(m: proto.Message.ContactsArrayMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4559,6 +5075,9 @@ export namespace proto { public static create(properties?: proto.Message.IDeclinePaymentRequestMessage): proto.Message.DeclinePaymentRequestMessage; public static encode(m: proto.Message.IDeclinePaymentRequestMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.DeclinePaymentRequestMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.DeclinePaymentRequestMessage; + public static toObject(m: proto.Message.DeclinePaymentRequestMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4570,12 +5089,15 @@ export namespace proto { class DeviceSentMessage implements IDeviceSentMessage { constructor(p?: proto.Message.IDeviceSentMessage); - public destinationJid: string; + public destinationJid?: (string|null); public message?: (proto.IMessage|null); - public phash: string; + public phash?: (string|null); public static create(properties?: proto.Message.IDeviceSentMessage): proto.Message.DeviceSentMessage; public static encode(m: proto.Message.IDeviceSentMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.DeviceSentMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.DeviceSentMessage; + public static toObject(m: proto.Message.DeviceSentMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4605,30 +5127,33 @@ export namespace proto { class DocumentMessage implements IDocumentMessage { constructor(p?: proto.Message.IDocumentMessage); - public url: string; - public mimetype: string; - public title: string; - public fileSha256: Uint8Array; - public fileLength: (number|Long); - public pageCount: number; - public mediaKey: Uint8Array; - public fileName: string; - public fileEncSha256: Uint8Array; - public directPath: string; - public mediaKeyTimestamp: (number|Long); - public contactVcard: boolean; - public thumbnailDirectPath: string; - public thumbnailSha256: Uint8Array; - public thumbnailEncSha256: Uint8Array; - public jpegThumbnail: Uint8Array; + public url?: (string|null); + public mimetype?: (string|null); + public title?: (string|null); + public fileSha256?: (Uint8Array|null); + public fileLength?: (number|Long|null); + public pageCount?: (number|null); + public mediaKey?: (Uint8Array|null); + public fileName?: (string|null); + public fileEncSha256?: (Uint8Array|null); + public directPath?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); + public contactVcard?: (boolean|null); + public thumbnailDirectPath?: (string|null); + public thumbnailSha256?: (Uint8Array|null); + public thumbnailEncSha256?: (Uint8Array|null); + public jpegThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); - public thumbnailHeight: number; - public thumbnailWidth: number; - public caption: string; - public accessibilityLabel: string; + public thumbnailHeight?: (number|null); + public thumbnailWidth?: (number|null); + public caption?: (string|null); + public accessibilityLabel?: (string|null); public static create(properties?: proto.Message.IDocumentMessage): proto.Message.DocumentMessage; public static encode(m: proto.Message.IDocumentMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.DocumentMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.DocumentMessage; + public static toObject(m: proto.Message.DocumentMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4641,11 +5166,14 @@ export namespace proto { class EncCommentMessage implements IEncCommentMessage { constructor(p?: proto.Message.IEncCommentMessage); public targetMessageKey?: (proto.IMessageKey|null); - public encPayload: Uint8Array; - public encIv: Uint8Array; + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); public static create(properties?: proto.Message.IEncCommentMessage): proto.Message.EncCommentMessage; public static encode(m: proto.Message.IEncCommentMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.EncCommentMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.EncCommentMessage; + public static toObject(m: proto.Message.EncCommentMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4658,11 +5186,14 @@ export namespace proto { class EncEventResponseMessage implements IEncEventResponseMessage { constructor(p?: proto.Message.IEncEventResponseMessage); public eventCreationMessageKey?: (proto.IMessageKey|null); - public encPayload: Uint8Array; - public encIv: Uint8Array; + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); public static create(properties?: proto.Message.IEncEventResponseMessage): proto.Message.EncEventResponseMessage; public static encode(m: proto.Message.IEncEventResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.EncEventResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.EncEventResponseMessage; + public static toObject(m: proto.Message.EncEventResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4675,11 +5206,14 @@ export namespace proto { class EncReactionMessage implements IEncReactionMessage { constructor(p?: proto.Message.IEncReactionMessage); public targetMessageKey?: (proto.IMessageKey|null); - public encPayload: Uint8Array; - public encIv: Uint8Array; + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); public static create(properties?: proto.Message.IEncReactionMessage): proto.Message.EncReactionMessage; public static encode(m: proto.Message.IEncReactionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.EncReactionMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.EncReactionMessage; + public static toObject(m: proto.Message.EncReactionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4699,18 +5233,21 @@ export namespace proto { class EventMessage implements IEventMessage { constructor(p?: proto.Message.IEventMessage); public contextInfo?: (proto.IContextInfo|null); - public isCanceled: boolean; - public name: string; - public description: string; + public isCanceled?: (boolean|null); + public name?: (string|null); + public description?: (string|null); public location?: (proto.Message.ILocationMessage|null); - public joinLink: string; - public startTime: (number|Long); - public endTime: (number|Long); - public extraGuestsAllowed: boolean; - public isScheduleCall: boolean; + public joinLink?: (string|null); + public startTime?: (number|Long|null); + public endTime?: (number|Long|null); + public extraGuestsAllowed?: (boolean|null); + public isScheduleCall?: (boolean|null); public static create(properties?: proto.Message.IEventMessage): proto.Message.EventMessage; public static encode(m: proto.Message.IEventMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.EventMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.EventMessage; + public static toObject(m: proto.Message.EventMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4722,12 +5259,15 @@ export namespace proto { class EventResponseMessage implements IEventResponseMessage { constructor(p?: proto.Message.IEventResponseMessage); - public response: proto.Message.EventResponseMessage.EventResponseType; - public timestampMs: (number|Long); - public extraGuestCount: number; + public response?: (proto.Message.EventResponseMessage.EventResponseType|null); + public timestampMs?: (number|Long|null); + public extraGuestCount?: (number|null); public static create(properties?: proto.Message.IEventResponseMessage): proto.Message.EventResponseMessage; public static encode(m: proto.Message.IEventResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.EventResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.EventResponseMessage; + public static toObject(m: proto.Message.EventResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4774,37 +5314,40 @@ export namespace proto { class ExtendedTextMessage implements IExtendedTextMessage { constructor(p?: proto.Message.IExtendedTextMessage); - public text: string; - public matchedText: string; - public description: string; - public title: string; - public textArgb: number; - public backgroundArgb: number; - public font: proto.Message.ExtendedTextMessage.FontType; - public previewType: proto.Message.ExtendedTextMessage.PreviewType; - public jpegThumbnail: Uint8Array; + public text?: (string|null); + public matchedText?: (string|null); + public description?: (string|null); + public title?: (string|null); + public textArgb?: (number|null); + public backgroundArgb?: (number|null); + public font?: (proto.Message.ExtendedTextMessage.FontType|null); + public previewType?: (proto.Message.ExtendedTextMessage.PreviewType|null); + public jpegThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); - public doNotPlayInline: boolean; - public thumbnailDirectPath: string; - public thumbnailSha256: Uint8Array; - public thumbnailEncSha256: Uint8Array; - public mediaKey: Uint8Array; - public mediaKeyTimestamp: (number|Long); - public thumbnailHeight: number; - public thumbnailWidth: number; - public inviteLinkGroupType: proto.Message.ExtendedTextMessage.InviteLinkGroupType; - public inviteLinkParentGroupSubjectV2: string; - public inviteLinkParentGroupThumbnailV2: Uint8Array; - public inviteLinkGroupTypeV2: proto.Message.ExtendedTextMessage.InviteLinkGroupType; - public viewOnce: boolean; - public videoHeight: number; - public videoWidth: number; + public doNotPlayInline?: (boolean|null); + public thumbnailDirectPath?: (string|null); + public thumbnailSha256?: (Uint8Array|null); + public thumbnailEncSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public mediaKeyTimestamp?: (number|Long|null); + public thumbnailHeight?: (number|null); + public thumbnailWidth?: (number|null); + public inviteLinkGroupType?: (proto.Message.ExtendedTextMessage.InviteLinkGroupType|null); + public inviteLinkParentGroupSubjectV2?: (string|null); + public inviteLinkParentGroupThumbnailV2?: (Uint8Array|null); + public inviteLinkGroupTypeV2?: (proto.Message.ExtendedTextMessage.InviteLinkGroupType|null); + public viewOnce?: (boolean|null); + public videoHeight?: (number|null); + public videoWidth?: (number|null); public faviconMMSMetadata?: (proto.Message.IMMSThumbnailMetadata|null); public linkPreviewMetadata?: (proto.Message.ILinkPreviewMetadata|null); public paymentLinkMetadata?: (proto.Message.IPaymentLinkMetadata|null); public static create(properties?: proto.Message.IExtendedTextMessage): proto.Message.ExtendedTextMessage; public static encode(m: proto.Message.IExtendedTextMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ExtendedTextMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ExtendedTextMessage; + public static toObject(m: proto.Message.ExtendedTextMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4844,10 +5387,13 @@ export namespace proto { class FullHistorySyncOnDemandRequestMetadata implements IFullHistorySyncOnDemandRequestMetadata { constructor(p?: proto.Message.IFullHistorySyncOnDemandRequestMetadata); - public requestId: string; + public requestId?: (string|null); public static create(properties?: proto.Message.IFullHistorySyncOnDemandRequestMetadata): proto.Message.FullHistorySyncOnDemandRequestMetadata; public static encode(m: proto.Message.IFullHistorySyncOnDemandRequestMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.FullHistorySyncOnDemandRequestMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.FullHistorySyncOnDemandRequestMetadata; + public static toObject(m: proto.Message.FullHistorySyncOnDemandRequestMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4861,6 +5407,9 @@ export namespace proto { public static create(properties?: proto.Message.IFutureProofMessage): proto.Message.FutureProofMessage; public static encode(m: proto.Message.IFutureProofMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.FutureProofMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.FutureProofMessage; + public static toObject(m: proto.Message.FutureProofMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4877,17 +5426,20 @@ export namespace proto { class GroupInviteMessage implements IGroupInviteMessage { constructor(p?: proto.Message.IGroupInviteMessage); - public groupJid: string; - public inviteCode: string; - public inviteExpiration: (number|Long); - public groupName: string; - public jpegThumbnail: Uint8Array; - public caption: string; + public groupJid?: (string|null); + public inviteCode?: (string|null); + public inviteExpiration?: (number|Long|null); + public groupName?: (string|null); + public jpegThumbnail?: (Uint8Array|null); + public caption?: (string|null); public contextInfo?: (proto.IContextInfo|null); - public groupType: proto.Message.GroupInviteMessage.GroupType; + public groupType?: (proto.Message.GroupInviteMessage.GroupType|null); public static create(properties?: proto.Message.IGroupInviteMessage): proto.Message.GroupInviteMessage; public static encode(m: proto.Message.IGroupInviteMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.GroupInviteMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.GroupInviteMessage; + public static toObject(m: proto.Message.GroupInviteMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4913,18 +5465,21 @@ export namespace proto { class HighlyStructuredMessage implements IHighlyStructuredMessage { constructor(p?: proto.Message.IHighlyStructuredMessage); - public namespace: string; - public elementName: string; + public namespace?: (string|null); + public elementName?: (string|null); public params: string[]; - public fallbackLg: string; - public fallbackLc: string; + public fallbackLg?: (string|null); + public fallbackLc?: (string|null); public localizableParams: proto.Message.HighlyStructuredMessage.IHSMLocalizableParameter[]; - public deterministicLg: string; - public deterministicLc: string; + public deterministicLg?: (string|null); + public deterministicLc?: (string|null); public hydratedHsm?: (proto.Message.ITemplateMessage|null); public static create(properties?: proto.Message.IHighlyStructuredMessage): proto.Message.HighlyStructuredMessage; public static encode(m: proto.Message.IHighlyStructuredMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HighlyStructuredMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.HighlyStructuredMessage; + public static toObject(m: proto.Message.HighlyStructuredMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4938,13 +5493,16 @@ export namespace proto { class HSMLocalizableParameter implements IHSMLocalizableParameter { constructor(p?: proto.Message.HighlyStructuredMessage.IHSMLocalizableParameter); - public default: string; + public default?: (string|null); public currency?: (proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMCurrency|null); public dateTime?: (proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMDateTime|null); public paramOneof?: ("currency"|"dateTime"); public static create(properties?: proto.Message.HighlyStructuredMessage.IHSMLocalizableParameter): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter; public static encode(m: proto.Message.HighlyStructuredMessage.IHSMLocalizableParameter, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter; + public static fromObject(d: { [k: string]: any }): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter; + public static toObject(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4957,11 +5515,14 @@ export namespace proto { class HSMCurrency implements IHSMCurrency { constructor(p?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMCurrency); - public currencyCode: string; - public amount1000: (number|Long); + public currencyCode?: (string|null); + public amount1000?: (number|Long|null); public static create(properties?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMCurrency): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency; public static encode(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMCurrency, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency; + public static fromObject(d: { [k: string]: any }): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency; + public static toObject(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4978,6 +5539,9 @@ export namespace proto { public static create(properties?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMDateTime): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime; public static encode(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.IHSMDateTime, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime; + public static fromObject(d: { [k: string]: any }): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime; + public static toObject(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -4995,16 +5559,19 @@ export namespace proto { class HSMDateTimeComponent implements IHSMDateTimeComponent { constructor(p?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.IHSMDateTimeComponent); - public dayOfWeek: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType; - public year: number; - public month: number; - public dayOfMonth: number; - public hour: number; - public minute: number; - public calendar: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType; + public dayOfWeek?: (proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType|null); + public year?: (number|null); + public month?: (number|null); + public dayOfMonth?: (number|null); + public hour?: (number|null); + public minute?: (number|null); + public calendar?: (proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType|null); public static create(properties?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.IHSMDateTimeComponent): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent; public static encode(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.IHSMDateTimeComponent, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent; + public static fromObject(d: { [k: string]: any }): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent; + public static toObject(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5032,10 +5599,13 @@ export namespace proto { class HSMDateTimeUnixEpoch implements IHSMDateTimeUnixEpoch { constructor(p?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.IHSMDateTimeUnixEpoch); - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public static create(properties?: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.IHSMDateTimeUnixEpoch): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch; public static encode(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.IHSMDateTimeUnixEpoch, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch; + public static fromObject(d: { [k: string]: any }): proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch; + public static toObject(m: proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5061,23 +5631,26 @@ export namespace proto { class HistorySyncNotification implements IHistorySyncNotification { constructor(p?: proto.Message.IHistorySyncNotification); - public fileSha256: Uint8Array; - public fileLength: (number|Long); - public mediaKey: Uint8Array; - public fileEncSha256: Uint8Array; - public directPath: string; - public syncType: proto.Message.HistorySyncNotification.HistorySyncType; - public chunkOrder: number; - public originalMessageId: string; - public progress: number; - public oldestMsgInChunkTimestampSec: (number|Long); - public initialHistBootstrapInlinePayload: Uint8Array; - public peerDataRequestSessionId: string; + public fileSha256?: (Uint8Array|null); + public fileLength?: (number|Long|null); + public mediaKey?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public directPath?: (string|null); + public syncType?: (proto.Message.HistorySyncNotification.HistorySyncType|null); + public chunkOrder?: (number|null); + public originalMessageId?: (string|null); + public progress?: (number|null); + public oldestMsgInChunkTimestampSec?: (number|Long|null); + public initialHistBootstrapInlinePayload?: (Uint8Array|null); + public peerDataRequestSessionId?: (string|null); public fullHistorySyncOnDemandRequestMetadata?: (proto.Message.IFullHistorySyncOnDemandRequestMetadata|null); - public encHandle: string; + public encHandle?: (string|null); public static create(properties?: proto.Message.IHistorySyncNotification): proto.Message.HistorySyncNotification; public static encode(m: proto.Message.IHistorySyncNotification, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.HistorySyncNotification; + public static fromObject(d: { [k: string]: any }): proto.Message.HistorySyncNotification; + public static toObject(m: proto.Message.HistorySyncNotification, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5129,38 +5702,41 @@ export namespace proto { class ImageMessage implements IImageMessage { constructor(p?: proto.Message.IImageMessage); - public url: string; - public mimetype: string; - public caption: string; - public fileSha256: Uint8Array; - public fileLength: (number|Long); - public height: number; - public width: number; - public mediaKey: Uint8Array; - public fileEncSha256: Uint8Array; + public url?: (string|null); + public mimetype?: (string|null); + public caption?: (string|null); + public fileSha256?: (Uint8Array|null); + public fileLength?: (number|Long|null); + public height?: (number|null); + public width?: (number|null); + public mediaKey?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); public interactiveAnnotations: proto.IInteractiveAnnotation[]; - public directPath: string; - public mediaKeyTimestamp: (number|Long); - public jpegThumbnail: Uint8Array; + public directPath?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); + public jpegThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); - public firstScanSidecar: Uint8Array; - public firstScanLength: number; - public experimentGroupId: number; - public scansSidecar: Uint8Array; + public firstScanSidecar?: (Uint8Array|null); + public firstScanLength?: (number|null); + public experimentGroupId?: (number|null); + public scansSidecar?: (Uint8Array|null); public scanLengths: number[]; - public midQualityFileSha256: Uint8Array; - public midQualityFileEncSha256: Uint8Array; - public viewOnce: boolean; - public thumbnailDirectPath: string; - public thumbnailSha256: Uint8Array; - public thumbnailEncSha256: Uint8Array; - public staticUrl: string; + public midQualityFileSha256?: (Uint8Array|null); + public midQualityFileEncSha256?: (Uint8Array|null); + public viewOnce?: (boolean|null); + public thumbnailDirectPath?: (string|null); + public thumbnailSha256?: (Uint8Array|null); + public thumbnailEncSha256?: (Uint8Array|null); + public staticUrl?: (string|null); public annotations: proto.IInteractiveAnnotation[]; - public imageSourceType: proto.Message.ImageMessage.ImageSourceType; - public accessibilityLabel: string; + public imageSourceType?: (proto.Message.ImageMessage.ImageSourceType|null); + public accessibilityLabel?: (string|null); public static create(properties?: proto.Message.IImageMessage): proto.Message.ImageMessage; public static encode(m: proto.Message.IImageMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ImageMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ImageMessage; + public static toObject(m: proto.Message.ImageMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5180,10 +5756,13 @@ export namespace proto { class InitialSecurityNotificationSettingSync implements IInitialSecurityNotificationSettingSync { constructor(p?: proto.Message.IInitialSecurityNotificationSettingSync); - public securityNotificationEnabled: boolean; + public securityNotificationEnabled?: (boolean|null); public static create(properties?: proto.Message.IInitialSecurityNotificationSettingSync): proto.Message.InitialSecurityNotificationSettingSync; public static encode(m: proto.Message.IInitialSecurityNotificationSettingSync, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InitialSecurityNotificationSettingSync; + public static fromObject(d: { [k: string]: any }): proto.Message.InitialSecurityNotificationSettingSync; + public static toObject(m: proto.Message.InitialSecurityNotificationSettingSync, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5214,6 +5793,9 @@ export namespace proto { public static create(properties?: proto.Message.IInteractiveMessage): proto.Message.InteractiveMessage; public static encode(m: proto.Message.IInteractiveMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage; + public static toObject(m: proto.Message.InteractiveMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5225,10 +5807,13 @@ export namespace proto { class Body implements IBody { constructor(p?: proto.Message.InteractiveMessage.IBody); - public text: string; + public text?: (string|null); public static create(properties?: proto.Message.InteractiveMessage.IBody): proto.Message.InteractiveMessage.Body; public static encode(m: proto.Message.InteractiveMessage.IBody, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.Body; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.Body; + public static toObject(m: proto.Message.InteractiveMessage.Body, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5240,10 +5825,13 @@ export namespace proto { class CarouselMessage implements ICarouselMessage { constructor(p?: proto.Message.InteractiveMessage.ICarouselMessage); public cards: proto.Message.IInteractiveMessage[]; - public messageVersion: number; + public messageVersion?: (number|null); public static create(properties?: proto.Message.InteractiveMessage.ICarouselMessage): proto.Message.InteractiveMessage.CarouselMessage; public static encode(m: proto.Message.InteractiveMessage.ICarouselMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.CarouselMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.CarouselMessage; + public static toObject(m: proto.Message.InteractiveMessage.CarouselMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5255,12 +5843,15 @@ export namespace proto { class CollectionMessage implements ICollectionMessage { constructor(p?: proto.Message.InteractiveMessage.ICollectionMessage); - public bizJid: string; - public id: string; - public messageVersion: number; + public bizJid?: (string|null); + public id?: (string|null); + public messageVersion?: (number|null); public static create(properties?: proto.Message.InteractiveMessage.ICollectionMessage): proto.Message.InteractiveMessage.CollectionMessage; public static encode(m: proto.Message.InteractiveMessage.ICollectionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.CollectionMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.CollectionMessage; + public static toObject(m: proto.Message.InteractiveMessage.CollectionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5270,10 +5861,13 @@ export namespace proto { class Footer implements IFooter { constructor(p?: proto.Message.InteractiveMessage.IFooter); - public text: string; + public text?: (string|null); public static create(properties?: proto.Message.InteractiveMessage.IFooter): proto.Message.InteractiveMessage.Footer; public static encode(m: proto.Message.InteractiveMessage.IFooter, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.Footer; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.Footer; + public static toObject(m: proto.Message.InteractiveMessage.Footer, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5291,9 +5885,9 @@ export namespace proto { class Header implements IHeader { constructor(p?: proto.Message.InteractiveMessage.IHeader); - public title: string; - public subtitle: string; - public hasMediaAttachment: boolean; + public title?: (string|null); + public subtitle?: (string|null); + public hasMediaAttachment?: (boolean|null); public documentMessage?: (proto.Message.IDocumentMessage|null); public imageMessage?: (proto.Message.IImageMessage|null); public jpegThumbnail?: (Uint8Array|null); @@ -5304,6 +5898,9 @@ export namespace proto { public static create(properties?: proto.Message.InteractiveMessage.IHeader): proto.Message.InteractiveMessage.Header; public static encode(m: proto.Message.InteractiveMessage.IHeader, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.Header; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.Header; + public static toObject(m: proto.Message.InteractiveMessage.Header, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5316,11 +5913,14 @@ export namespace proto { class NativeFlowMessage implements INativeFlowMessage { constructor(p?: proto.Message.InteractiveMessage.INativeFlowMessage); public buttons: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton[]; - public messageParamsJson: string; - public messageVersion: number; + public messageParamsJson?: (string|null); + public messageVersion?: (number|null); public static create(properties?: proto.Message.InteractiveMessage.INativeFlowMessage): proto.Message.InteractiveMessage.NativeFlowMessage; public static encode(m: proto.Message.InteractiveMessage.INativeFlowMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.NativeFlowMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.NativeFlowMessage; + public static toObject(m: proto.Message.InteractiveMessage.NativeFlowMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5333,11 +5933,14 @@ export namespace proto { class NativeFlowButton implements INativeFlowButton { constructor(p?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton); - public name: string; - public buttonParamsJson: string; + public name?: (string|null); + public buttonParamsJson?: (string|null); public static create(properties?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton): proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton; public static encode(m: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton; + public static toObject(m: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5350,12 +5953,15 @@ export namespace proto { class ShopMessage implements IShopMessage { constructor(p?: proto.Message.InteractiveMessage.IShopMessage); - public id: string; - public surface: proto.Message.InteractiveMessage.ShopMessage.Surface; - public messageVersion: number; + public id?: (string|null); + public surface?: (proto.Message.InteractiveMessage.ShopMessage.Surface|null); + public messageVersion?: (number|null); public static create(properties?: proto.Message.InteractiveMessage.IShopMessage): proto.Message.InteractiveMessage.ShopMessage; public static encode(m: proto.Message.InteractiveMessage.IShopMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveMessage.ShopMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveMessage.ShopMessage; + public static toObject(m: proto.Message.InteractiveMessage.ShopMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5385,6 +5991,9 @@ export namespace proto { public static create(properties?: proto.Message.IInteractiveResponseMessage): proto.Message.InteractiveResponseMessage; public static encode(m: proto.Message.IInteractiveResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveResponseMessage; + public static toObject(m: proto.Message.InteractiveResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5397,11 +6006,14 @@ export namespace proto { class Body implements IBody { constructor(p?: proto.Message.InteractiveResponseMessage.IBody); - public text: string; - public format: proto.Message.InteractiveResponseMessage.Body.Format; + public text?: (string|null); + public format?: (proto.Message.InteractiveResponseMessage.Body.Format|null); public static create(properties?: proto.Message.InteractiveResponseMessage.IBody): proto.Message.InteractiveResponseMessage.Body; public static encode(m: proto.Message.InteractiveResponseMessage.IBody, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveResponseMessage.Body; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveResponseMessage.Body; + public static toObject(m: proto.Message.InteractiveResponseMessage.Body, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5421,12 +6033,15 @@ export namespace proto { class NativeFlowResponseMessage implements INativeFlowResponseMessage { constructor(p?: proto.Message.InteractiveResponseMessage.INativeFlowResponseMessage); - public name: string; - public paramsJson: string; - public version: number; + public name?: (string|null); + public paramsJson?: (string|null); + public version?: (number|null); public static create(properties?: proto.Message.InteractiveResponseMessage.INativeFlowResponseMessage): proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage; public static encode(m: proto.Message.InteractiveResponseMessage.INativeFlowResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage; + public static toObject(m: proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5446,19 +6061,22 @@ export namespace proto { class InvoiceMessage implements IInvoiceMessage { constructor(p?: proto.Message.IInvoiceMessage); - public note: string; - public token: string; - public attachmentType: proto.Message.InvoiceMessage.AttachmentType; - public attachmentMimetype: string; - public attachmentMediaKey: Uint8Array; - public attachmentMediaKeyTimestamp: (number|Long); - public attachmentFileSha256: Uint8Array; - public attachmentFileEncSha256: Uint8Array; - public attachmentDirectPath: string; - public attachmentJpegThumbnail: Uint8Array; + public note?: (string|null); + public token?: (string|null); + public attachmentType?: (proto.Message.InvoiceMessage.AttachmentType|null); + public attachmentMimetype?: (string|null); + public attachmentMediaKey?: (Uint8Array|null); + public attachmentMediaKeyTimestamp?: (number|Long|null); + public attachmentFileSha256?: (Uint8Array|null); + public attachmentFileEncSha256?: (Uint8Array|null); + public attachmentDirectPath?: (string|null); + public attachmentJpegThumbnail?: (Uint8Array|null); public static create(properties?: proto.Message.IInvoiceMessage): proto.Message.InvoiceMessage; public static encode(m: proto.Message.IInvoiceMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.InvoiceMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.InvoiceMessage; + public static toObject(m: proto.Message.InvoiceMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5479,11 +6097,14 @@ export namespace proto { class KeepInChatMessage implements IKeepInChatMessage { constructor(p?: proto.Message.IKeepInChatMessage); public key?: (proto.IMessageKey|null); - public keepType: proto.KeepType; - public timestampMs: (number|Long); + public keepType?: (proto.KeepType|null); + public timestampMs?: (number|Long|null); public static create(properties?: proto.Message.IKeepInChatMessage): proto.Message.KeepInChatMessage; public static encode(m: proto.Message.IKeepInChatMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.KeepInChatMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.KeepInChatMessage; + public static toObject(m: proto.Message.KeepInChatMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5497,10 +6118,13 @@ export namespace proto { constructor(p?: proto.Message.ILinkPreviewMetadata); public paymentLinkMetadata?: (proto.Message.IPaymentLinkMetadata|null); public urlMetadata?: (proto.Message.IURLMetadata|null); - public fbExperimentId: number; + public fbExperimentId?: (number|null); public static create(properties?: proto.Message.ILinkPreviewMetadata): proto.Message.LinkPreviewMetadata; public static encode(m: proto.Message.ILinkPreviewMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.LinkPreviewMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.LinkPreviewMetadata; + public static toObject(m: proto.Message.LinkPreviewMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5517,17 +6141,20 @@ export namespace proto { class ListMessage implements IListMessage { constructor(p?: proto.Message.IListMessage); - public title: string; - public description: string; - public buttonText: string; - public listType: proto.Message.ListMessage.ListType; + public title?: (string|null); + public description?: (string|null); + public buttonText?: (string|null); + public listType?: (proto.Message.ListMessage.ListType|null); public sections: proto.Message.ListMessage.ISection[]; public productListInfo?: (proto.Message.ListMessage.IProductListInfo|null); - public footerText: string; + public footerText?: (string|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.IListMessage): proto.Message.ListMessage; public static encode(m: proto.Message.IListMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage; + public static toObject(m: proto.Message.ListMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5545,10 +6172,13 @@ export namespace proto { class Product implements IProduct { constructor(p?: proto.Message.ListMessage.IProduct); - public productId: string; + public productId?: (string|null); public static create(properties?: proto.Message.ListMessage.IProduct): proto.Message.ListMessage.Product; public static encode(m: proto.Message.ListMessage.IProduct, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage.Product; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage.Product; + public static toObject(m: proto.Message.ListMessage.Product, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5559,11 +6189,14 @@ export namespace proto { class ProductListHeaderImage implements IProductListHeaderImage { constructor(p?: proto.Message.ListMessage.IProductListHeaderImage); - public productId: string; - public jpegThumbnail: Uint8Array; + public productId?: (string|null); + public jpegThumbnail?: (Uint8Array|null); public static create(properties?: proto.Message.ListMessage.IProductListHeaderImage): proto.Message.ListMessage.ProductListHeaderImage; public static encode(m: proto.Message.ListMessage.IProductListHeaderImage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage.ProductListHeaderImage; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage.ProductListHeaderImage; + public static toObject(m: proto.Message.ListMessage.ProductListHeaderImage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5577,10 +6210,13 @@ export namespace proto { constructor(p?: proto.Message.ListMessage.IProductListInfo); public productSections: proto.Message.ListMessage.IProductSection[]; public headerImage?: (proto.Message.ListMessage.IProductListHeaderImage|null); - public businessOwnerJid: string; + public businessOwnerJid?: (string|null); public static create(properties?: proto.Message.ListMessage.IProductListInfo): proto.Message.ListMessage.ProductListInfo; public static encode(m: proto.Message.ListMessage.IProductListInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage.ProductListInfo; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage.ProductListInfo; + public static toObject(m: proto.Message.ListMessage.ProductListInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5591,11 +6227,14 @@ export namespace proto { class ProductSection implements IProductSection { constructor(p?: proto.Message.ListMessage.IProductSection); - public title: string; + public title?: (string|null); public products: proto.Message.ListMessage.IProduct[]; public static create(properties?: proto.Message.ListMessage.IProductSection): proto.Message.ListMessage.ProductSection; public static encode(m: proto.Message.ListMessage.IProductSection, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage.ProductSection; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage.ProductSection; + public static toObject(m: proto.Message.ListMessage.ProductSection, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5607,12 +6246,15 @@ export namespace proto { class Row implements IRow { constructor(p?: proto.Message.ListMessage.IRow); - public title: string; - public description: string; - public rowId: string; + public title?: (string|null); + public description?: (string|null); + public rowId?: (string|null); public static create(properties?: proto.Message.ListMessage.IRow): proto.Message.ListMessage.Row; public static encode(m: proto.Message.ListMessage.IRow, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage.Row; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage.Row; + public static toObject(m: proto.Message.ListMessage.Row, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5623,11 +6265,14 @@ export namespace proto { class Section implements ISection { constructor(p?: proto.Message.ListMessage.ISection); - public title: string; + public title?: (string|null); public rows: proto.Message.ListMessage.IRow[]; public static create(properties?: proto.Message.ListMessage.ISection): proto.Message.ListMessage.Section; public static encode(m: proto.Message.ListMessage.ISection, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListMessage.Section; + public static fromObject(d: { [k: string]: any }): proto.Message.ListMessage.Section; + public static toObject(m: proto.Message.ListMessage.Section, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5642,14 +6287,17 @@ export namespace proto { class ListResponseMessage implements IListResponseMessage { constructor(p?: proto.Message.IListResponseMessage); - public title: string; - public listType: proto.Message.ListResponseMessage.ListType; + public title?: (string|null); + public listType?: (proto.Message.ListResponseMessage.ListType|null); public singleSelectReply?: (proto.Message.ListResponseMessage.ISingleSelectReply|null); public contextInfo?: (proto.IContextInfo|null); - public description: string; + public description?: (string|null); public static create(properties?: proto.Message.IListResponseMessage): proto.Message.ListResponseMessage; public static encode(m: proto.Message.IListResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ListResponseMessage; + public static toObject(m: proto.Message.ListResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5666,10 +6314,13 @@ export namespace proto { class SingleSelectReply implements ISingleSelectReply { constructor(p?: proto.Message.ListResponseMessage.ISingleSelectReply); - public selectedRowId: string; + public selectedRowId?: (string|null); public static create(properties?: proto.Message.ListResponseMessage.ISingleSelectReply): proto.Message.ListResponseMessage.SingleSelectReply; public static encode(m: proto.Message.ListResponseMessage.ISingleSelectReply, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ListResponseMessage.SingleSelectReply; + public static fromObject(d: { [k: string]: any }): proto.Message.ListResponseMessage.SingleSelectReply; + public static toObject(m: proto.Message.ListResponseMessage.SingleSelectReply, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5689,19 +6340,22 @@ export namespace proto { class LiveLocationMessage implements ILiveLocationMessage { constructor(p?: proto.Message.ILiveLocationMessage); - public degreesLatitude: number; - public degreesLongitude: number; - public accuracyInMeters: number; - public speedInMps: number; - public degreesClockwiseFromMagneticNorth: number; - public caption: string; - public sequenceNumber: (number|Long); - public timeOffset: number; - public jpegThumbnail: Uint8Array; + public degreesLatitude?: (number|null); + public degreesLongitude?: (number|null); + public accuracyInMeters?: (number|null); + public speedInMps?: (number|null); + public degreesClockwiseFromMagneticNorth?: (number|null); + public caption?: (string|null); + public sequenceNumber?: (number|Long|null); + public timeOffset?: (number|null); + public jpegThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.ILiveLocationMessage): proto.Message.LiveLocationMessage; public static encode(m: proto.Message.ILiveLocationMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.LiveLocationMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.LiveLocationMessage; + public static toObject(m: proto.Message.LiveLocationMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5722,21 +6376,24 @@ export namespace proto { class LocationMessage implements ILocationMessage { constructor(p?: proto.Message.ILocationMessage); - public degreesLatitude: number; - public degreesLongitude: number; - public name: string; - public address: string; - public url: string; - public isLive: boolean; - public accuracyInMeters: number; - public speedInMps: number; - public degreesClockwiseFromMagneticNorth: number; - public comment: string; - public jpegThumbnail: Uint8Array; + public degreesLatitude?: (number|null); + public degreesLongitude?: (number|null); + public name?: (string|null); + public address?: (string|null); + public url?: (string|null); + public isLive?: (boolean|null); + public accuracyInMeters?: (number|null); + public speedInMps?: (number|null); + public degreesClockwiseFromMagneticNorth?: (number|null); + public comment?: (string|null); + public jpegThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.ILocationMessage): proto.Message.LocationMessage; public static encode(m: proto.Message.ILocationMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.LocationMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.LocationMessage; + public static toObject(m: proto.Message.LocationMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5752,16 +6409,19 @@ export namespace proto { class MMSThumbnailMetadata implements IMMSThumbnailMetadata { constructor(p?: proto.Message.IMMSThumbnailMetadata); - public thumbnailDirectPath: string; - public thumbnailSha256: Uint8Array; - public thumbnailEncSha256: Uint8Array; - public mediaKey: Uint8Array; - public mediaKeyTimestamp: (number|Long); - public thumbnailHeight: number; - public thumbnailWidth: number; + public thumbnailDirectPath?: (string|null); + public thumbnailSha256?: (Uint8Array|null); + public thumbnailEncSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public mediaKeyTimestamp?: (number|Long|null); + public thumbnailHeight?: (number|null); + public thumbnailWidth?: (number|null); public static create(properties?: proto.Message.IMMSThumbnailMetadata): proto.Message.MMSThumbnailMetadata; public static encode(m: proto.Message.IMMSThumbnailMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.MMSThumbnailMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.MMSThumbnailMetadata; + public static toObject(m: proto.Message.MMSThumbnailMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5778,17 +6438,20 @@ export namespace proto { class MessageHistoryBundle implements IMessageHistoryBundle { constructor(p?: proto.Message.IMessageHistoryBundle); - public mimetype: string; - public fileSha256: Uint8Array; - public mediaKey: Uint8Array; - public fileEncSha256: Uint8Array; - public directPath: string; - public mediaKeyTimestamp: (number|Long); + public mimetype?: (string|null); + public fileSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public directPath?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); public contextInfo?: (proto.IContextInfo|null); public messageHistoryMetadata?: (proto.Message.IMessageHistoryMetadata|null); public static create(properties?: proto.Message.IMessageHistoryBundle): proto.Message.MessageHistoryBundle; public static encode(m: proto.Message.IMessageHistoryBundle, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.MessageHistoryBundle; + public static fromObject(d: { [k: string]: any }): proto.Message.MessageHistoryBundle; + public static toObject(m: proto.Message.MessageHistoryBundle, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5801,11 +6464,14 @@ export namespace proto { class MessageHistoryMetadata implements IMessageHistoryMetadata { constructor(p?: proto.Message.IMessageHistoryMetadata); public historyReceivers: string[]; - public firstMessageTimestamp: (number|Long); - public messageCount: (number|Long); + public firstMessageTimestamp?: (number|Long|null); + public messageCount?: (number|Long|null); public static create(properties?: proto.Message.IMessageHistoryMetadata): proto.Message.MessageHistoryMetadata; public static encode(m: proto.Message.IMessageHistoryMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.MessageHistoryMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.MessageHistoryMetadata; + public static toObject(m: proto.Message.MessageHistoryMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5821,6 +6487,9 @@ export namespace proto { public static create(properties?: proto.Message.IMessageHistoryNotice): proto.Message.MessageHistoryNotice; public static encode(m: proto.Message.IMessageHistoryNotice, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.MessageHistoryNotice; + public static fromObject(d: { [k: string]: any }): proto.Message.MessageHistoryNotice; + public static toObject(m: proto.Message.MessageHistoryNotice, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5835,15 +6504,18 @@ export namespace proto { class NewsletterAdminInviteMessage implements INewsletterAdminInviteMessage { constructor(p?: proto.Message.INewsletterAdminInviteMessage); - public newsletterJid: string; - public newsletterName: string; - public jpegThumbnail: Uint8Array; - public caption: string; - public inviteExpiration: (number|Long); + public newsletterJid?: (string|null); + public newsletterName?: (string|null); + public jpegThumbnail?: (Uint8Array|null); + public caption?: (string|null); + public inviteExpiration?: (number|Long|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.INewsletterAdminInviteMessage): proto.Message.NewsletterAdminInviteMessage; public static encode(m: proto.Message.INewsletterAdminInviteMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.NewsletterAdminInviteMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.NewsletterAdminInviteMessage; + public static toObject(m: proto.Message.NewsletterAdminInviteMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5867,24 +6539,27 @@ export namespace proto { class OrderMessage implements IOrderMessage { constructor(p?: proto.Message.IOrderMessage); - public orderId: string; - public thumbnail: Uint8Array; - public itemCount: number; - public status: proto.Message.OrderMessage.OrderStatus; - public surface: proto.Message.OrderMessage.OrderSurface; - public message: string; - public orderTitle: string; - public sellerJid: string; - public token: string; - public totalAmount1000: (number|Long); - public totalCurrencyCode: string; + public orderId?: (string|null); + public thumbnail?: (Uint8Array|null); + public itemCount?: (number|null); + public status?: (proto.Message.OrderMessage.OrderStatus|null); + public surface?: (proto.Message.OrderMessage.OrderSurface|null); + public message?: (string|null); + public orderTitle?: (string|null); + public sellerJid?: (string|null); + public token?: (string|null); + public totalAmount1000?: (number|Long|null); + public totalCurrencyCode?: (string|null); public contextInfo?: (proto.IContextInfo|null); - public messageVersion: number; + public messageVersion?: (number|null); public orderRequestMessageId?: (proto.IMessageKey|null); - public catalogType: string; + public catalogType?: (string|null); public static create(properties?: proto.Message.IOrderMessage): proto.Message.OrderMessage; public static encode(m: proto.Message.IOrderMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.OrderMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.OrderMessage; + public static toObject(m: proto.Message.OrderMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5908,11 +6583,14 @@ export namespace proto { class PaymentInviteMessage implements IPaymentInviteMessage { constructor(p?: proto.Message.IPaymentInviteMessage); - public serviceType: proto.Message.PaymentInviteMessage.ServiceType; - public expiryTimestamp: (number|Long); + public serviceType?: (proto.Message.PaymentInviteMessage.ServiceType|null); + public expiryTimestamp?: (number|Long|null); public static create(properties?: proto.Message.IPaymentInviteMessage): proto.Message.PaymentInviteMessage; public static encode(m: proto.Message.IPaymentInviteMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PaymentInviteMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PaymentInviteMessage; + public static toObject(m: proto.Message.PaymentInviteMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5938,6 +6616,9 @@ export namespace proto { public static create(properties?: proto.Message.IPaymentLinkMetadata): proto.Message.PaymentLinkMetadata; public static encode(m: proto.Message.IPaymentLinkMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PaymentLinkMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.PaymentLinkMetadata; + public static toObject(m: proto.Message.PaymentLinkMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5949,10 +6630,13 @@ export namespace proto { class PaymentLinkButton implements IPaymentLinkButton { constructor(p?: proto.Message.PaymentLinkMetadata.IPaymentLinkButton); - public displayText: string; + public displayText?: (string|null); public static create(properties?: proto.Message.PaymentLinkMetadata.IPaymentLinkButton): proto.Message.PaymentLinkMetadata.PaymentLinkButton; public static encode(m: proto.Message.PaymentLinkMetadata.IPaymentLinkButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PaymentLinkMetadata.PaymentLinkButton; + public static fromObject(d: { [k: string]: any }): proto.Message.PaymentLinkMetadata.PaymentLinkButton; + public static toObject(m: proto.Message.PaymentLinkMetadata.PaymentLinkButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5962,10 +6646,13 @@ export namespace proto { class PaymentLinkHeader implements IPaymentLinkHeader { constructor(p?: proto.Message.PaymentLinkMetadata.IPaymentLinkHeader); - public headerType: proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType; + public headerType?: (proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType|null); public static create(properties?: proto.Message.PaymentLinkMetadata.IPaymentLinkHeader): proto.Message.PaymentLinkMetadata.PaymentLinkHeader; public static encode(m: proto.Message.PaymentLinkMetadata.IPaymentLinkHeader, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PaymentLinkMetadata.PaymentLinkHeader; + public static fromObject(d: { [k: string]: any }): proto.Message.PaymentLinkMetadata.PaymentLinkHeader; + public static toObject(m: proto.Message.PaymentLinkMetadata.PaymentLinkHeader, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -5990,7 +6677,7 @@ export namespace proto { class PeerDataOperationRequestMessage implements IPeerDataOperationRequestMessage { constructor(p?: proto.Message.IPeerDataOperationRequestMessage); - public peerDataOperationRequestType: proto.Message.PeerDataOperationRequestType; + public peerDataOperationRequestType?: (proto.Message.PeerDataOperationRequestType|null); public requestStickerReupload: proto.Message.PeerDataOperationRequestMessage.IRequestStickerReupload[]; public requestUrlPreview: proto.Message.PeerDataOperationRequestMessage.IRequestUrlPreview[]; public historySyncOnDemandRequest?: (proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest|null); @@ -6000,6 +6687,9 @@ export namespace proto { public static create(properties?: proto.Message.IPeerDataOperationRequestMessage): proto.Message.PeerDataOperationRequestMessage; public static encode(m: proto.Message.IPeerDataOperationRequestMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6017,6 +6707,9 @@ export namespace proto { public static create(properties?: proto.Message.PeerDataOperationRequestMessage.IFullHistorySyncOnDemandRequest): proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest; public static encode(m: proto.Message.PeerDataOperationRequestMessage.IFullHistorySyncOnDemandRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6031,15 +6724,18 @@ export namespace proto { class HistorySyncOnDemandRequest implements IHistorySyncOnDemandRequest { constructor(p?: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest); - public chatJid: string; - public oldestMsgId: string; - public oldestMsgFromMe: boolean; - public onDemandMsgCount: number; - public oldestMsgTimestampMs: (number|Long); - public accountLid: string; + public chatJid?: (string|null); + public oldestMsgId?: (string|null); + public oldestMsgFromMe?: (boolean|null); + public onDemandMsgCount?: (number|null); + public oldestMsgTimestampMs?: (number|Long|null); + public accountLid?: (string|null); public static create(properties?: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; public static encode(m: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6053,6 +6749,9 @@ export namespace proto { public static create(properties?: proto.Message.PeerDataOperationRequestMessage.IPlaceholderMessageResendRequest): proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest; public static encode(m: proto.Message.PeerDataOperationRequestMessage.IPlaceholderMessageResendRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6062,10 +6761,13 @@ export namespace proto { class RequestStickerReupload implements IRequestStickerReupload { constructor(p?: proto.Message.PeerDataOperationRequestMessage.IRequestStickerReupload); - public fileSha256: string; + public fileSha256?: (string|null); public static create(properties?: proto.Message.PeerDataOperationRequestMessage.IRequestStickerReupload): proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload; public static encode(m: proto.Message.PeerDataOperationRequestMessage.IRequestStickerReupload, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6076,11 +6778,14 @@ export namespace proto { class RequestUrlPreview implements IRequestUrlPreview { constructor(p?: proto.Message.PeerDataOperationRequestMessage.IRequestUrlPreview); - public url: string; - public includeHqThumbnail: boolean; + public url?: (string|null); + public includeHqThumbnail?: (boolean|null); public static create(properties?: proto.Message.PeerDataOperationRequestMessage.IRequestUrlPreview): proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview; public static encode(m: proto.Message.PeerDataOperationRequestMessage.IRequestUrlPreview, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6091,11 +6796,14 @@ export namespace proto { class SyncDCollectionFatalRecoveryRequest implements ISyncDCollectionFatalRecoveryRequest { constructor(p?: proto.Message.PeerDataOperationRequestMessage.ISyncDCollectionFatalRecoveryRequest); - public collectionName: string; - public timestamp: (number|Long); + public collectionName?: (string|null); + public timestamp?: (number|Long|null); public static create(properties?: proto.Message.PeerDataOperationRequestMessage.ISyncDCollectionFatalRecoveryRequest): proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest; public static encode(m: proto.Message.PeerDataOperationRequestMessage.ISyncDCollectionFatalRecoveryRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest; + public static toObject(m: proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6108,12 +6816,15 @@ export namespace proto { class PeerDataOperationRequestResponseMessage implements IPeerDataOperationRequestResponseMessage { constructor(p?: proto.Message.IPeerDataOperationRequestResponseMessage); - public peerDataOperationRequestType: proto.Message.PeerDataOperationRequestType; - public stanzaId: string; + public peerDataOperationRequestType?: (proto.Message.PeerDataOperationRequestType|null); + public stanzaId?: (string|null); public peerDataOperationResult: proto.Message.PeerDataOperationRequestResponseMessage.IPeerDataOperationResult[]; public static create(properties?: proto.Message.IPeerDataOperationRequestResponseMessage): proto.Message.PeerDataOperationRequestResponseMessage; public static encode(m: proto.Message.IPeerDataOperationRequestResponseMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6132,7 +6843,7 @@ export namespace proto { class PeerDataOperationResult implements IPeerDataOperationResult { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.IPeerDataOperationResult); - public mediaUploadResult: proto.MediaRetryNotification.ResultType; + public mediaUploadResult?: (proto.MediaRetryNotification.ResultType|null); public stickerMessage?: (proto.Message.IStickerMessage|null); public linkPreviewResponse?: (proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ILinkPreviewResponse|null); public placeholderMessageResendResponse?: (proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IPlaceholderMessageResendResponse|null); @@ -6143,6 +6854,9 @@ export namespace proto { public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.IPeerDataOperationResult): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.IPeerDataOperationResult, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6154,10 +6868,13 @@ export namespace proto { class CompanionMetaNonceFetchResponse implements ICompanionMetaNonceFetchResponse { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ICompanionMetaNonceFetchResponse); - public nonce: string; + public nonce?: (string|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ICompanionMetaNonceFetchResponse): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ICompanionMetaNonceFetchResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6169,10 +6886,13 @@ export namespace proto { class FullHistorySyncOnDemandRequestResponse implements IFullHistorySyncOnDemandRequestResponse { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IFullHistorySyncOnDemandRequestResponse); public requestMetadata?: (proto.Message.IFullHistorySyncOnDemandRequestMetadata|null); - public responseCode: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode; + public responseCode?: (proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IFullHistorySyncOnDemandRequestResponse): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IFullHistorySyncOnDemandRequestResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6198,16 +6918,19 @@ export namespace proto { class LinkPreviewResponse implements ILinkPreviewResponse { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ILinkPreviewResponse); - public url: string; - public title: string; - public description: string; - public thumbData: Uint8Array; - public matchText: string; - public previewType: string; + public url?: (string|null); + public title?: (string|null); + public description?: (string|null); + public thumbData?: (Uint8Array|null); + public matchText?: (string|null); + public previewType?: (string|null); public hqThumbnail?: (proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.ILinkPreviewHighQualityThumbnail|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ILinkPreviewResponse): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ILinkPreviewResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6225,16 +6948,19 @@ export namespace proto { class LinkPreviewHighQualityThumbnail implements ILinkPreviewHighQualityThumbnail { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.ILinkPreviewHighQualityThumbnail); - public directPath: string; - public thumbHash: string; - public encThumbHash: string; - public mediaKey: Uint8Array; - public mediaKeyTimestampMs: (number|Long); - public thumbWidth: number; - public thumbHeight: number; + public directPath?: (string|null); + public thumbHash?: (string|null); + public encThumbHash?: (string|null); + public mediaKey?: (Uint8Array|null); + public mediaKeyTimestampMs?: (number|Long|null); + public thumbWidth?: (number|null); + public thumbHeight?: (number|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.ILinkPreviewHighQualityThumbnail): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.ILinkPreviewHighQualityThumbnail, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6245,10 +6971,13 @@ export namespace proto { class PlaceholderMessageResendResponse implements IPlaceholderMessageResendResponse { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IPlaceholderMessageResendResponse); - public webMessageInfoBytes: Uint8Array; + public webMessageInfoBytes?: (Uint8Array|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IPlaceholderMessageResendResponse): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IPlaceholderMessageResendResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6259,11 +6988,14 @@ export namespace proto { class SyncDSnapshotFatalRecoveryResponse implements ISyncDSnapshotFatalRecoveryResponse { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ISyncDSnapshotFatalRecoveryResponse); - public collectionSnapshot: Uint8Array; - public isCompressed: boolean; + public collectionSnapshot?: (Uint8Array|null); + public isCompressed?: (boolean|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ISyncDSnapshotFatalRecoveryResponse): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.ISyncDSnapshotFatalRecoveryResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6274,11 +7006,14 @@ export namespace proto { class WaffleNonceFetchResponse implements IWaffleNonceFetchResponse { constructor(p?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IWaffleNonceFetchResponse); - public nonce: string; - public waEntFbid: string; + public nonce?: (string|null); + public waEntFbid?: (string|null); public static create(properties?: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IWaffleNonceFetchResponse): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse; public static encode(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.IWaffleNonceFetchResponse, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse; + public static fromObject(d: { [k: string]: any }): proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse; + public static toObject(m: proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6305,11 +7040,14 @@ export namespace proto { class PinInChatMessage implements IPinInChatMessage { constructor(p?: proto.Message.IPinInChatMessage); public key?: (proto.IMessageKey|null); - public type: proto.Message.PinInChatMessage.Type; - public senderTimestampMs: (number|Long); + public type?: (proto.Message.PinInChatMessage.Type|null); + public senderTimestampMs?: (number|Long|null); public static create(properties?: proto.Message.IPinInChatMessage): proto.Message.PinInChatMessage; public static encode(m: proto.Message.IPinInChatMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PinInChatMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PinInChatMessage; + public static toObject(m: proto.Message.PinInChatMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6328,10 +7066,13 @@ export namespace proto { class PlaceholderMessage implements IPlaceholderMessage { constructor(p?: proto.Message.IPlaceholderMessage); - public type: proto.Message.PlaceholderMessage.PlaceholderType; + public type?: (proto.Message.PlaceholderMessage.PlaceholderType|null); public static create(properties?: proto.Message.IPlaceholderMessage): proto.Message.PlaceholderMessage; public static encode(m: proto.Message.IPlaceholderMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PlaceholderMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PlaceholderMessage; + public static toObject(m: proto.Message.PlaceholderMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6361,17 +7102,20 @@ export namespace proto { class PollCreationMessage implements IPollCreationMessage { constructor(p?: proto.Message.IPollCreationMessage); - public encKey: Uint8Array; - public name: string; + public encKey?: (Uint8Array|null); + public name?: (string|null); public options: proto.Message.PollCreationMessage.IOption[]; - public selectableOptionsCount: number; + public selectableOptionsCount?: (number|null); public contextInfo?: (proto.IContextInfo|null); - public pollContentType: proto.Message.PollContentType; - public pollType: proto.Message.PollCreationMessage.PollType; + public pollContentType?: (proto.Message.PollContentType|null); + public pollType?: (proto.Message.PollCreationMessage.PollType|null); public correctAnswer?: (proto.Message.PollCreationMessage.IOption|null); public static create(properties?: proto.Message.IPollCreationMessage): proto.Message.PollCreationMessage; public static encode(m: proto.Message.IPollCreationMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollCreationMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PollCreationMessage; + public static toObject(m: proto.Message.PollCreationMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6384,11 +7128,14 @@ export namespace proto { class Option implements IOption { constructor(p?: proto.Message.PollCreationMessage.IOption); - public optionName: string; - public optionHash: string; + public optionName?: (string|null); + public optionHash?: (string|null); public static create(properties?: proto.Message.PollCreationMessage.IOption): proto.Message.PollCreationMessage.Option; public static encode(m: proto.Message.PollCreationMessage.IOption, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollCreationMessage.Option; + public static fromObject(d: { [k: string]: any }): proto.Message.PollCreationMessage.Option; + public static toObject(m: proto.Message.PollCreationMessage.Option, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6405,11 +7152,14 @@ export namespace proto { class PollEncValue implements IPollEncValue { constructor(p?: proto.Message.IPollEncValue); - public encPayload: Uint8Array; - public encIv: Uint8Array; + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); public static create(properties?: proto.Message.IPollEncValue): proto.Message.PollEncValue; public static encode(m: proto.Message.IPollEncValue, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollEncValue; + public static fromObject(d: { [k: string]: any }): proto.Message.PollEncValue; + public static toObject(m: proto.Message.PollEncValue, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6421,12 +7171,15 @@ export namespace proto { class PollResultSnapshotMessage implements IPollResultSnapshotMessage { constructor(p?: proto.Message.IPollResultSnapshotMessage); - public name: string; + public name?: (string|null); public pollVotes: proto.Message.PollResultSnapshotMessage.IPollVote[]; public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.IPollResultSnapshotMessage): proto.Message.PollResultSnapshotMessage; public static encode(m: proto.Message.IPollResultSnapshotMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollResultSnapshotMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PollResultSnapshotMessage; + public static toObject(m: proto.Message.PollResultSnapshotMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6439,11 +7192,14 @@ export namespace proto { class PollVote implements IPollVote { constructor(p?: proto.Message.PollResultSnapshotMessage.IPollVote); - public optionName: string; - public optionVoteCount: (number|Long); + public optionName?: (string|null); + public optionVoteCount?: (number|Long|null); public static create(properties?: proto.Message.PollResultSnapshotMessage.IPollVote): proto.Message.PollResultSnapshotMessage.PollVote; public static encode(m: proto.Message.PollResultSnapshotMessage.IPollVote, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollResultSnapshotMessage.PollVote; + public static fromObject(d: { [k: string]: any }): proto.Message.PollResultSnapshotMessage.PollVote; + public static toObject(m: proto.Message.PollResultSnapshotMessage.PollVote, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6460,10 +7216,13 @@ export namespace proto { public pollCreationMessageKey?: (proto.IMessageKey|null); public vote?: (proto.Message.IPollEncValue|null); public metadata?: (proto.Message.IPollUpdateMessageMetadata|null); - public senderTimestampMs: (number|Long); + public senderTimestampMs?: (number|Long|null); public static create(properties?: proto.Message.IPollUpdateMessage): proto.Message.PollUpdateMessage; public static encode(m: proto.Message.IPollUpdateMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollUpdateMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PollUpdateMessage; + public static toObject(m: proto.Message.PollUpdateMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6475,6 +7234,9 @@ export namespace proto { public static create(properties?: proto.Message.IPollUpdateMessageMetadata): proto.Message.PollUpdateMessageMetadata; public static encode(m: proto.Message.IPollUpdateMessageMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollUpdateMessageMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.PollUpdateMessageMetadata; + public static toObject(m: proto.Message.PollUpdateMessageMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6488,6 +7250,9 @@ export namespace proto { public static create(properties?: proto.Message.IPollVoteMessage): proto.Message.PollVoteMessage; public static encode(m: proto.Message.IPollVoteMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollVoteMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.PollVoteMessage; + public static toObject(m: proto.Message.PollVoteMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6503,14 +7268,17 @@ export namespace proto { class ProductMessage implements IProductMessage { constructor(p?: proto.Message.IProductMessage); public product?: (proto.Message.ProductMessage.IProductSnapshot|null); - public businessOwnerJid: string; + public businessOwnerJid?: (string|null); public catalog?: (proto.Message.ProductMessage.ICatalogSnapshot|null); - public body: string; - public footer: string; + public body?: (string|null); + public footer?: (string|null); public contextInfo?: (proto.IContextInfo|null); public static create(properties?: proto.Message.IProductMessage): proto.Message.ProductMessage; public static encode(m: proto.Message.IProductMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ProductMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ProductMessage; + public static toObject(m: proto.Message.ProductMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6525,11 +7293,14 @@ export namespace proto { class CatalogSnapshot implements ICatalogSnapshot { constructor(p?: proto.Message.ProductMessage.ICatalogSnapshot); public catalogImage?: (proto.Message.IImageMessage|null); - public title: string; - public description: string; + public title?: (string|null); + public description?: (string|null); public static create(properties?: proto.Message.ProductMessage.ICatalogSnapshot): proto.Message.ProductMessage.CatalogSnapshot; public static encode(m: proto.Message.ProductMessage.ICatalogSnapshot, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ProductMessage.CatalogSnapshot; + public static fromObject(d: { [k: string]: any }): proto.Message.ProductMessage.CatalogSnapshot; + public static toObject(m: proto.Message.ProductMessage.CatalogSnapshot, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6551,20 +7322,23 @@ export namespace proto { class ProductSnapshot implements IProductSnapshot { constructor(p?: proto.Message.ProductMessage.IProductSnapshot); public productImage?: (proto.Message.IImageMessage|null); - public productId: string; - public title: string; - public description: string; - public currencyCode: string; - public priceAmount1000: (number|Long); - public retailerId: string; - public url: string; - public productImageCount: number; - public firstImageId: string; - public salePriceAmount1000: (number|Long); - public signedUrl: string; + public productId?: (string|null); + public title?: (string|null); + public description?: (string|null); + public currencyCode?: (string|null); + public priceAmount1000?: (number|Long|null); + public retailerId?: (string|null); + public url?: (string|null); + public productImageCount?: (number|null); + public firstImageId?: (string|null); + public salePriceAmount1000?: (number|Long|null); + public signedUrl?: (string|null); public static create(properties?: proto.Message.ProductMessage.IProductSnapshot): proto.Message.ProductMessage.ProductSnapshot; public static encode(m: proto.Message.ProductMessage.IProductSnapshot, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ProductMessage.ProductSnapshot; + public static fromObject(d: { [k: string]: any }): proto.Message.ProductMessage.ProductSnapshot; + public static toObject(m: proto.Message.ProductMessage.ProductSnapshot, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6599,9 +7373,9 @@ export namespace proto { class ProtocolMessage implements IProtocolMessage { constructor(p?: proto.Message.IProtocolMessage); public key?: (proto.IMessageKey|null); - public type: proto.Message.ProtocolMessage.Type; - public ephemeralExpiration: number; - public ephemeralSettingTimestamp: (number|Long); + public type?: (proto.Message.ProtocolMessage.Type|null); + public ephemeralExpiration?: (number|null); + public ephemeralSettingTimestamp?: (number|Long|null); public historySyncNotification?: (proto.Message.IHistorySyncNotification|null); public appStateSyncKeyShare?: (proto.Message.IAppStateSyncKeyShare|null); public appStateSyncKeyRequest?: (proto.Message.IAppStateSyncKeyRequest|null); @@ -6609,22 +7383,25 @@ export namespace proto { public appStateFatalExceptionNotification?: (proto.Message.IAppStateFatalExceptionNotification|null); public disappearingMode?: (proto.IDisappearingMode|null); public editedMessage?: (proto.IMessage|null); - public timestampMs: (number|Long); + public timestampMs?: (number|Long|null); public peerDataOperationRequestMessage?: (proto.Message.IPeerDataOperationRequestMessage|null); public peerDataOperationRequestResponseMessage?: (proto.Message.IPeerDataOperationRequestResponseMessage|null); public botFeedbackMessage?: (proto.Message.IBotFeedbackMessage|null); - public invokerJid: string; + public invokerJid?: (string|null); public requestWelcomeMessageMetadata?: (proto.Message.IRequestWelcomeMessageMetadata|null); public mediaNotifyMessage?: (proto.IMediaNotifyMessage|null); public cloudApiThreadControlNotification?: (proto.Message.ICloudAPIThreadControlNotification|null); public lidMigrationMappingSyncMessage?: (proto.ILIDMigrationMappingSyncMessage|null); public limitSharing?: (proto.ILimitSharing|null); - public aiPsiMetadata: Uint8Array; + public aiPsiMetadata?: (Uint8Array|null); public aiQueryFanout?: (proto.IAIQueryFanout|null); public memberLabel?: (proto.IMemberLabel|null); public static create(properties?: proto.Message.IProtocolMessage): proto.Message.ProtocolMessage; public static encode(m: proto.Message.IProtocolMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ProtocolMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ProtocolMessage; + public static toObject(m: proto.Message.ProtocolMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6670,12 +7447,15 @@ export namespace proto { class ReactionMessage implements IReactionMessage { constructor(p?: proto.Message.IReactionMessage); public key?: (proto.IMessageKey|null); - public text: string; - public groupingKey: string; - public senderTimestampMs: (number|Long); + public text?: (string|null); + public groupingKey?: (string|null); + public senderTimestampMs?: (number|Long|null); public static create(properties?: proto.Message.IReactionMessage): proto.Message.ReactionMessage; public static encode(m: proto.Message.IReactionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ReactionMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ReactionMessage; + public static toObject(m: proto.Message.ReactionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6692,15 +7472,18 @@ export namespace proto { class RequestPaymentMessage implements IRequestPaymentMessage { constructor(p?: proto.Message.IRequestPaymentMessage); public noteMessage?: (proto.IMessage|null); - public currencyCodeIso4217: string; - public amount1000: (number|Long); - public requestFrom: string; - public expiryTimestamp: (number|Long); + public currencyCodeIso4217?: (string|null); + public amount1000?: (number|Long|null); + public requestFrom?: (string|null); + public expiryTimestamp?: (number|Long|null); public amount?: (proto.IMoney|null); public background?: (proto.IPaymentBackground|null); public static create(properties?: proto.Message.IRequestPaymentMessage): proto.Message.RequestPaymentMessage; public static encode(m: proto.Message.IRequestPaymentMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.RequestPaymentMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.RequestPaymentMessage; + public static toObject(m: proto.Message.RequestPaymentMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6714,6 +7497,9 @@ export namespace proto { public static create(properties?: proto.Message.IRequestPhoneNumberMessage): proto.Message.RequestPhoneNumberMessage; public static encode(m: proto.Message.IRequestPhoneNumberMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.RequestPhoneNumberMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.RequestPhoneNumberMessage; + public static toObject(m: proto.Message.RequestPhoneNumberMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6723,10 +7509,13 @@ export namespace proto { class RequestWelcomeMessageMetadata implements IRequestWelcomeMessageMetadata { constructor(p?: proto.Message.IRequestWelcomeMessageMetadata); - public localChatState: proto.Message.RequestWelcomeMessageMetadata.LocalChatState; + public localChatState?: (proto.Message.RequestWelcomeMessageMetadata.LocalChatState|null); public static create(properties?: proto.Message.IRequestWelcomeMessageMetadata): proto.Message.RequestWelcomeMessageMetadata; public static encode(m: proto.Message.IRequestWelcomeMessageMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.RequestWelcomeMessageMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.RequestWelcomeMessageMetadata; + public static toObject(m: proto.Message.RequestWelcomeMessageMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6746,12 +7535,15 @@ export namespace proto { class ScheduledCallCreationMessage implements IScheduledCallCreationMessage { constructor(p?: proto.Message.IScheduledCallCreationMessage); - public scheduledTimestampMs: (number|Long); - public callType: proto.Message.ScheduledCallCreationMessage.CallType; - public title: string; + public scheduledTimestampMs?: (number|Long|null); + public callType?: (proto.Message.ScheduledCallCreationMessage.CallType|null); + public title?: (string|null); public static create(properties?: proto.Message.IScheduledCallCreationMessage): proto.Message.ScheduledCallCreationMessage; public static encode(m: proto.Message.IScheduledCallCreationMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ScheduledCallCreationMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ScheduledCallCreationMessage; + public static toObject(m: proto.Message.ScheduledCallCreationMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6772,10 +7564,13 @@ export namespace proto { class ScheduledCallEditMessage implements IScheduledCallEditMessage { constructor(p?: proto.Message.IScheduledCallEditMessage); public key?: (proto.IMessageKey|null); - public editType: proto.Message.ScheduledCallEditMessage.EditType; + public editType?: (proto.Message.ScheduledCallEditMessage.EditType|null); public static create(properties?: proto.Message.IScheduledCallEditMessage): proto.Message.ScheduledCallEditMessage; public static encode(m: proto.Message.IScheduledCallEditMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ScheduledCallEditMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.ScheduledCallEditMessage; + public static toObject(m: proto.Message.ScheduledCallEditMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6797,12 +7592,15 @@ export namespace proto { class SecretEncryptedMessage implements ISecretEncryptedMessage { constructor(p?: proto.Message.ISecretEncryptedMessage); public targetMessageKey?: (proto.IMessageKey|null); - public encPayload: Uint8Array; - public encIv: Uint8Array; - public secretEncType: proto.Message.SecretEncryptedMessage.SecretEncType; + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); + public secretEncType?: (proto.Message.SecretEncryptedMessage.SecretEncType|null); public static create(properties?: proto.Message.ISecretEncryptedMessage): proto.Message.SecretEncryptedMessage; public static encode(m: proto.Message.ISecretEncryptedMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.SecretEncryptedMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.SecretEncryptedMessage; + public static toObject(m: proto.Message.SecretEncryptedMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6829,6 +7627,9 @@ export namespace proto { public static create(properties?: proto.Message.ISendPaymentMessage): proto.Message.SendPaymentMessage; public static encode(m: proto.Message.ISendPaymentMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.SendPaymentMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.SendPaymentMessage; + public static toObject(m: proto.Message.SendPaymentMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6839,11 +7640,14 @@ export namespace proto { class SenderKeyDistributionMessage implements ISenderKeyDistributionMessage { constructor(p?: proto.Message.ISenderKeyDistributionMessage); - public groupId: string; - public axolotlSenderKeyDistributionMessage: Uint8Array; + public groupId?: (string|null); + public axolotlSenderKeyDistributionMessage?: (Uint8Array|null); public static create(properties?: proto.Message.ISenderKeyDistributionMessage): proto.Message.SenderKeyDistributionMessage; public static encode(m: proto.Message.ISenderKeyDistributionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.SenderKeyDistributionMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.SenderKeyDistributionMessage; + public static toObject(m: proto.Message.SenderKeyDistributionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6857,10 +7661,13 @@ export namespace proto { constructor(p?: proto.Message.IStatusNotificationMessage); public responseMessageKey?: (proto.IMessageKey|null); public originalMessageKey?: (proto.IMessageKey|null); - public type: proto.Message.StatusNotificationMessage.StatusNotificationType; + public type?: (proto.Message.StatusNotificationMessage.StatusNotificationType|null); public static create(properties?: proto.Message.IStatusNotificationMessage): proto.Message.StatusNotificationMessage; public static encode(m: proto.Message.IStatusNotificationMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StatusNotificationMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.StatusNotificationMessage; + public static toObject(m: proto.Message.StatusNotificationMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6898,29 +7705,32 @@ export namespace proto { class StickerMessage implements IStickerMessage { constructor(p?: proto.Message.IStickerMessage); - public url: string; - public fileSha256: Uint8Array; - public fileEncSha256: Uint8Array; - public mediaKey: Uint8Array; - public mimetype: string; - public height: number; - public width: number; - public directPath: string; - public fileLength: (number|Long); - public mediaKeyTimestamp: (number|Long); - public firstFrameLength: number; - public firstFrameSidecar: Uint8Array; - public isAnimated: boolean; - public pngThumbnail: Uint8Array; + public url?: (string|null); + public fileSha256?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public mimetype?: (string|null); + public height?: (number|null); + public width?: (number|null); + public directPath?: (string|null); + public fileLength?: (number|Long|null); + public mediaKeyTimestamp?: (number|Long|null); + public firstFrameLength?: (number|null); + public firstFrameSidecar?: (Uint8Array|null); + public isAnimated?: (boolean|null); + public pngThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); - public stickerSentTs: (number|Long); - public isAvatar: boolean; - public isAiSticker: boolean; - public isLottie: boolean; - public accessibilityLabel: string; + public stickerSentTs?: (number|Long|null); + public isAvatar?: (boolean|null); + public isAiSticker?: (boolean|null); + public isLottie?: (boolean|null); + public accessibilityLabel?: (string|null); public static create(properties?: proto.Message.IStickerMessage): proto.Message.StickerMessage; public static encode(m: proto.Message.IStickerMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StickerMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.StickerMessage; + public static toObject(m: proto.Message.StickerMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6951,31 +7761,34 @@ export namespace proto { class StickerPackMessage implements IStickerPackMessage { constructor(p?: proto.Message.IStickerPackMessage); - public stickerPackId: string; - public name: string; - public publisher: string; + public stickerPackId?: (string|null); + public name?: (string|null); + public publisher?: (string|null); public stickers: proto.Message.StickerPackMessage.ISticker[]; - public fileLength: (number|Long); - public fileSha256: Uint8Array; - public fileEncSha256: Uint8Array; - public mediaKey: Uint8Array; - public directPath: string; - public caption: string; + public fileLength?: (number|Long|null); + public fileSha256?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public directPath?: (string|null); + public caption?: (string|null); public contextInfo?: (proto.IContextInfo|null); - public packDescription: string; - public mediaKeyTimestamp: (number|Long); - public trayIconFileName: string; - public thumbnailDirectPath: string; - public thumbnailSha256: Uint8Array; - public thumbnailEncSha256: Uint8Array; - public thumbnailHeight: number; - public thumbnailWidth: number; - public imageDataHash: string; - public stickerPackSize: (number|Long); - public stickerPackOrigin: proto.Message.StickerPackMessage.StickerPackOrigin; + public packDescription?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); + public trayIconFileName?: (string|null); + public thumbnailDirectPath?: (string|null); + public thumbnailSha256?: (Uint8Array|null); + public thumbnailEncSha256?: (Uint8Array|null); + public thumbnailHeight?: (number|null); + public thumbnailWidth?: (number|null); + public imageDataHash?: (string|null); + public stickerPackSize?: (number|Long|null); + public stickerPackOrigin?: (proto.Message.StickerPackMessage.StickerPackOrigin|null); public static create(properties?: proto.Message.IStickerPackMessage): proto.Message.StickerPackMessage; public static encode(m: proto.Message.IStickerPackMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StickerPackMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.StickerPackMessage; + public static toObject(m: proto.Message.StickerPackMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -6992,15 +7805,18 @@ export namespace proto { class Sticker implements ISticker { constructor(p?: proto.Message.StickerPackMessage.ISticker); - public fileName: string; - public isAnimated: boolean; + public fileName?: (string|null); + public isAnimated?: (boolean|null); public emojis: string[]; - public accessibilityLabel: string; - public isLottie: boolean; - public mimetype: string; + public accessibilityLabel?: (string|null); + public isLottie?: (boolean|null); + public mimetype?: (string|null); public static create(properties?: proto.Message.StickerPackMessage.ISticker): proto.Message.StickerPackMessage.Sticker; public static encode(m: proto.Message.StickerPackMessage.ISticker, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StickerPackMessage.Sticker; + public static fromObject(d: { [k: string]: any }): proto.Message.StickerPackMessage.Sticker; + public static toObject(m: proto.Message.StickerPackMessage.Sticker, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7020,11 +7836,14 @@ export namespace proto { class StickerSyncRMRMessage implements IStickerSyncRMRMessage { constructor(p?: proto.Message.IStickerSyncRMRMessage); public filehash: string[]; - public rmrSource: string; - public requestTimestamp: (number|Long); + public rmrSource?: (string|null); + public requestTimestamp?: (number|Long|null); public static create(properties?: proto.Message.IStickerSyncRMRMessage): proto.Message.StickerSyncRMRMessage; public static encode(m: proto.Message.IStickerSyncRMRMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StickerSyncRMRMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.StickerSyncRMRMessage; + public static toObject(m: proto.Message.StickerSyncRMRMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7038,14 +7857,17 @@ export namespace proto { class TemplateButtonReplyMessage implements ITemplateButtonReplyMessage { constructor(p?: proto.Message.ITemplateButtonReplyMessage); - public selectedId: string; - public selectedDisplayText: string; + public selectedId?: (string|null); + public selectedDisplayText?: (string|null); public contextInfo?: (proto.IContextInfo|null); - public selectedIndex: number; - public selectedCarouselCardIndex: number; + public selectedIndex?: (number|null); + public selectedCarouselCardIndex?: (number|null); public static create(properties?: proto.Message.ITemplateButtonReplyMessage): proto.Message.TemplateButtonReplyMessage; public static encode(m: proto.Message.ITemplateButtonReplyMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.TemplateButtonReplyMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.TemplateButtonReplyMessage; + public static toObject(m: proto.Message.TemplateButtonReplyMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7062,7 +7884,7 @@ export namespace proto { constructor(p?: proto.Message.ITemplateMessage); public contextInfo?: (proto.IContextInfo|null); public hydratedTemplate?: (proto.Message.TemplateMessage.IHydratedFourRowTemplate|null); - public templateId: string; + public templateId?: (string|null); public fourRowTemplate?: (proto.Message.TemplateMessage.IFourRowTemplate|null); public hydratedFourRowTemplate?: (proto.Message.TemplateMessage.IHydratedFourRowTemplate|null); public interactiveMessageTemplate?: (proto.Message.IInteractiveMessage|null); @@ -7070,6 +7892,9 @@ export namespace proto { public static create(properties?: proto.Message.ITemplateMessage): proto.Message.TemplateMessage; public static encode(m: proto.Message.ITemplateMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.TemplateMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.TemplateMessage; + public static toObject(m: proto.Message.TemplateMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7100,6 +7925,9 @@ export namespace proto { public static create(properties?: proto.Message.TemplateMessage.IFourRowTemplate): proto.Message.TemplateMessage.FourRowTemplate; public static encode(m: proto.Message.TemplateMessage.IFourRowTemplate, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.TemplateMessage.FourRowTemplate; + public static fromObject(d: { [k: string]: any }): proto.Message.TemplateMessage.FourRowTemplate; + public static toObject(m: proto.Message.TemplateMessage.FourRowTemplate, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7118,11 +7946,11 @@ export namespace proto { class HydratedFourRowTemplate implements IHydratedFourRowTemplate { constructor(p?: proto.Message.TemplateMessage.IHydratedFourRowTemplate); - public hydratedContentText: string; - public hydratedFooterText: string; + public hydratedContentText?: (string|null); + public hydratedFooterText?: (string|null); public hydratedButtons: proto.IHydratedTemplateButton[]; - public templateId: string; - public maskLinkedDevices: boolean; + public templateId?: (string|null); + public maskLinkedDevices?: (boolean|null); public documentMessage?: (proto.Message.IDocumentMessage|null); public hydratedTitleText?: (string|null); public imageMessage?: (proto.Message.IImageMessage|null); @@ -7132,6 +7960,9 @@ export namespace proto { public static create(properties?: proto.Message.TemplateMessage.IHydratedFourRowTemplate): proto.Message.TemplateMessage.HydratedFourRowTemplate; public static encode(m: proto.Message.TemplateMessage.IHydratedFourRowTemplate, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.TemplateMessage.HydratedFourRowTemplate; + public static fromObject(d: { [k: string]: any }): proto.Message.TemplateMessage.HydratedFourRowTemplate; + public static toObject(m: proto.Message.TemplateMessage.HydratedFourRowTemplate, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -7142,10 +7973,13 @@ export namespace proto { class URLMetadata implements IURLMetadata { constructor(p?: proto.Message.IURLMetadata); - public fbExperimentId: number; + public fbExperimentId?: (number|null); public static create(properties?: proto.Message.IURLMetadata): proto.Message.URLMetadata; public static encode(m: proto.Message.IURLMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.URLMetadata; + public static fromObject(d: { [k: string]: any }): proto.Message.URLMetadata; + public static toObject(m: proto.Message.URLMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7181,36 +8015,39 @@ export namespace proto { class VideoMessage implements IVideoMessage { constructor(p?: proto.Message.IVideoMessage); - public url: string; - public mimetype: string; - public fileSha256: Uint8Array; - public fileLength: (number|Long); - public seconds: number; - public mediaKey: Uint8Array; - public caption: string; - public gifPlayback: boolean; - public height: number; - public width: number; - public fileEncSha256: Uint8Array; + public url?: (string|null); + public mimetype?: (string|null); + public fileSha256?: (Uint8Array|null); + public fileLength?: (number|Long|null); + public seconds?: (number|null); + public mediaKey?: (Uint8Array|null); + public caption?: (string|null); + public gifPlayback?: (boolean|null); + public height?: (number|null); + public width?: (number|null); + public fileEncSha256?: (Uint8Array|null); public interactiveAnnotations: proto.IInteractiveAnnotation[]; - public directPath: string; - public mediaKeyTimestamp: (number|Long); - public jpegThumbnail: Uint8Array; + public directPath?: (string|null); + public mediaKeyTimestamp?: (number|Long|null); + public jpegThumbnail?: (Uint8Array|null); public contextInfo?: (proto.IContextInfo|null); - public streamingSidecar: Uint8Array; - public gifAttribution: proto.Message.VideoMessage.Attribution; - public viewOnce: boolean; - public thumbnailDirectPath: string; - public thumbnailSha256: Uint8Array; - public thumbnailEncSha256: Uint8Array; - public staticUrl: string; + public streamingSidecar?: (Uint8Array|null); + public gifAttribution?: (proto.Message.VideoMessage.Attribution|null); + public viewOnce?: (boolean|null); + public thumbnailDirectPath?: (string|null); + public thumbnailSha256?: (Uint8Array|null); + public thumbnailEncSha256?: (Uint8Array|null); + public staticUrl?: (string|null); public annotations: proto.IInteractiveAnnotation[]; - public accessibilityLabel: string; + public accessibilityLabel?: (string|null); public processedVideos: proto.IProcessedVideo[]; - public externalShareFullVideoDurationInSeconds: number; + public externalShareFullVideoDurationInSeconds?: (number|null); public static create(properties?: proto.Message.IVideoMessage): proto.Message.VideoMessage; public static encode(m: proto.Message.IVideoMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.VideoMessage; + public static fromObject(d: { [k: string]: any }): proto.Message.VideoMessage; + public static toObject(m: proto.Message.VideoMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7237,17 +8074,20 @@ export namespace proto { class MessageAddOn implements IMessageAddOn { constructor(p?: proto.IMessageAddOn); - public messageAddOnType: proto.MessageAddOn.MessageAddOnType; + public messageAddOnType?: (proto.MessageAddOn.MessageAddOnType|null); public messageAddOn?: (proto.IMessage|null); - public senderTimestampMs: (number|Long); - public serverTimestampMs: (number|Long); - public status: proto.WebMessageInfo.Status; + public senderTimestampMs?: (number|Long|null); + public serverTimestampMs?: (number|Long|null); + public status?: (proto.WebMessageInfo.Status|null); public addOnContextInfo?: (proto.IMessageAddOnContextInfo|null); public messageAddOnKey?: (proto.IMessageKey|null); public legacyMessage?: (proto.ILegacyMessage|null); public static create(properties?: proto.IMessageAddOn): proto.MessageAddOn; public static encode(m: proto.IMessageAddOn, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MessageAddOn; + public static fromObject(d: { [k: string]: any }): proto.MessageAddOn; + public static toObject(m: proto.MessageAddOn, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7269,11 +8109,14 @@ export namespace proto { class MessageAddOnContextInfo implements IMessageAddOnContextInfo { constructor(p?: proto.IMessageAddOnContextInfo); - public messageAddOnDurationInSecs: number; - public messageAddOnExpiryType: proto.MessageContextInfo.MessageAddonExpiryType; + public messageAddOnDurationInSecs?: (number|null); + public messageAddOnExpiryType?: (proto.MessageContextInfo.MessageAddonExpiryType|null); public static create(properties?: proto.IMessageAddOnContextInfo): proto.MessageAddOnContextInfo; public static encode(m: proto.IMessageAddOnContextInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MessageAddOnContextInfo; + public static fromObject(d: { [k: string]: any }): proto.MessageAddOnContextInfo; + public static toObject(m: proto.MessageAddOnContextInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7285,12 +8128,15 @@ export namespace proto { class MessageAssociation implements IMessageAssociation { constructor(p?: proto.IMessageAssociation); - public associationType: proto.MessageAssociation.AssociationType; + public associationType?: (proto.MessageAssociation.AssociationType|null); public parentMessageKey?: (proto.IMessageKey|null); - public messageIndex: number; + public messageIndex?: (number|null); public static create(properties?: proto.IMessageAssociation): proto.MessageAssociation; public static encode(m: proto.IMessageAssociation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MessageAssociation; + public static fromObject(d: { [k: string]: any }): proto.MessageAssociation; + public static toObject(m: proto.MessageAssociation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7335,22 +8181,25 @@ export namespace proto { class MessageContextInfo implements IMessageContextInfo { constructor(p?: proto.IMessageContextInfo); public deviceListMetadata?: (proto.IDeviceListMetadata|null); - public deviceListMetadataVersion: number; - public messageSecret: Uint8Array; - public paddingBytes: Uint8Array; - public messageAddOnDurationInSecs: number; - public botMessageSecret: Uint8Array; + public deviceListMetadataVersion?: (number|null); + public messageSecret?: (Uint8Array|null); + public paddingBytes?: (Uint8Array|null); + public messageAddOnDurationInSecs?: (number|null); + public botMessageSecret?: (Uint8Array|null); public botMetadata?: (proto.IBotMetadata|null); - public reportingTokenVersion: number; - public messageAddOnExpiryType: proto.MessageContextInfo.MessageAddonExpiryType; + public reportingTokenVersion?: (number|null); + public messageAddOnExpiryType?: (proto.MessageContextInfo.MessageAddonExpiryType|null); public messageAssociation?: (proto.IMessageAssociation|null); - public capiCreatedGroup: boolean; - public supportPayload: string; + public capiCreatedGroup?: (boolean|null); + public supportPayload?: (string|null); public limitSharing?: (proto.ILimitSharing|null); public limitSharingV2?: (proto.ILimitSharing|null); public static create(properties?: proto.IMessageContextInfo): proto.MessageContextInfo; public static encode(m: proto.IMessageContextInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MessageContextInfo; + public static fromObject(d: { [k: string]: any }): proto.MessageContextInfo; + public static toObject(m: proto.MessageContextInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7371,13 +8220,16 @@ export namespace proto { class MessageKey implements IMessageKey { constructor(p?: proto.IMessageKey); - public remoteJid: string; - public fromMe: boolean; - public id: string; - public participant: string; + public remoteJid?: (string|null); + public fromMe?: (boolean|null); + public id?: (string|null); + public participant?: (string|null); public static create(properties?: proto.IMessageKey): proto.MessageKey; public static encode(m: proto.IMessageKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MessageKey; + public static fromObject(d: { [k: string]: any }): proto.MessageKey; + public static toObject(m: proto.MessageKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7389,12 +8241,15 @@ export namespace proto { class MessageSecretMessage implements IMessageSecretMessage { constructor(p?: proto.IMessageSecretMessage); - public version: number; - public encIv: Uint8Array; - public encPayload: Uint8Array; + public version?: (number|null); + public encIv?: (Uint8Array|null); + public encPayload?: (Uint8Array|null); public static create(properties?: proto.IMessageSecretMessage): proto.MessageSecretMessage; public static encode(m: proto.IMessageSecretMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MessageSecretMessage; + public static fromObject(d: { [k: string]: any }): proto.MessageSecretMessage; + public static toObject(m: proto.MessageSecretMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7406,12 +8261,15 @@ export namespace proto { class Money implements IMoney { constructor(p?: proto.IMoney); - public value: (number|Long); - public offset: number; - public currencyCode: string; + public value?: (number|Long|null); + public offset?: (number|null); + public currencyCode?: (string|null); public static create(properties?: proto.IMoney): proto.Money; public static encode(m: proto.IMoney, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Money; + public static fromObject(d: { [k: string]: any }): proto.Money; + public static toObject(m: proto.Money, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7459,48 +8317,51 @@ export namespace proto { class MsgOpaqueData implements IMsgOpaqueData { constructor(p?: proto.IMsgOpaqueData); - public body: string; - public caption: string; - public lng: number; - public isLive: boolean; - public lat: number; - public paymentAmount1000: number; - public paymentNoteMsgBody: string; - public matchedText: string; - public title: string; - public description: string; - public futureproofBuffer: Uint8Array; - public clientUrl: string; - public loc: string; - public pollName: string; + public body?: (string|null); + public caption?: (string|null); + public lng?: (number|null); + public isLive?: (boolean|null); + public lat?: (number|null); + public paymentAmount1000?: (number|null); + public paymentNoteMsgBody?: (string|null); + public matchedText?: (string|null); + public title?: (string|null); + public description?: (string|null); + public futureproofBuffer?: (Uint8Array|null); + public clientUrl?: (string|null); + public loc?: (string|null); + public pollName?: (string|null); public pollOptions: proto.MsgOpaqueData.IPollOption[]; - public pollSelectableOptionsCount: number; - public messageSecret: Uint8Array; - public originalSelfAuthor: string; - public senderTimestampMs: (number|Long); - public pollUpdateParentKey: string; + public pollSelectableOptionsCount?: (number|null); + public messageSecret?: (Uint8Array|null); + public originalSelfAuthor?: (string|null); + public senderTimestampMs?: (number|Long|null); + public pollUpdateParentKey?: (string|null); public encPollVote?: (proto.IPollEncValue|null); - public isSentCagPollCreation: boolean; - public pollContentType: proto.MsgOpaqueData.PollContentType; + public isSentCagPollCreation?: (boolean|null); + public pollContentType?: (proto.MsgOpaqueData.PollContentType|null); public pollVotesSnapshot?: (proto.MsgOpaqueData.IPollVotesSnapshot|null); - public encReactionTargetMessageKey: string; - public encReactionEncPayload: Uint8Array; - public encReactionEncIv: Uint8Array; - public botMessageSecret: Uint8Array; - public targetMessageKey: string; - public encPayload: Uint8Array; - public encIv: Uint8Array; - public eventName: string; - public isEventCanceled: boolean; - public eventDescription: string; - public eventJoinLink: string; - public eventStartTime: (number|Long); + public encReactionTargetMessageKey?: (string|null); + public encReactionEncPayload?: (Uint8Array|null); + public encReactionEncIv?: (Uint8Array|null); + public botMessageSecret?: (Uint8Array|null); + public targetMessageKey?: (string|null); + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); + public eventName?: (string|null); + public isEventCanceled?: (boolean|null); + public eventDescription?: (string|null); + public eventJoinLink?: (string|null); + public eventStartTime?: (number|Long|null); public eventLocation?: (proto.MsgOpaqueData.IEventLocation|null); - public eventEndTime: (number|Long); - public plainProtobufBytes: Uint8Array; + public eventEndTime?: (number|Long|null); + public plainProtobufBytes?: (Uint8Array|null); public static create(properties?: proto.IMsgOpaqueData): proto.MsgOpaqueData; public static encode(m: proto.IMsgOpaqueData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MsgOpaqueData; + public static fromObject(d: { [k: string]: any }): proto.MsgOpaqueData; + public static toObject(m: proto.MsgOpaqueData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7517,15 +8378,18 @@ export namespace proto { class EventLocation implements IEventLocation { constructor(p?: proto.MsgOpaqueData.IEventLocation); - public degreesLatitude: number; - public degreesLongitude: number; - public name: string; - public address: string; - public url: string; - public jpegThumbnail: Uint8Array; + public degreesLatitude?: (number|null); + public degreesLongitude?: (number|null); + public name?: (string|null); + public address?: (string|null); + public url?: (string|null); + public jpegThumbnail?: (Uint8Array|null); public static create(properties?: proto.MsgOpaqueData.IEventLocation): proto.MsgOpaqueData.EventLocation; public static encode(m: proto.MsgOpaqueData.IEventLocation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MsgOpaqueData.EventLocation; + public static fromObject(d: { [k: string]: any }): proto.MsgOpaqueData.EventLocation; + public static toObject(m: proto.MsgOpaqueData.EventLocation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7542,11 +8406,14 @@ export namespace proto { class PollOption implements IPollOption { constructor(p?: proto.MsgOpaqueData.IPollOption); - public name: string; - public hash: string; + public name?: (string|null); + public hash?: (string|null); public static create(properties?: proto.MsgOpaqueData.IPollOption): proto.MsgOpaqueData.PollOption; public static encode(m: proto.MsgOpaqueData.IPollOption, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MsgOpaqueData.PollOption; + public static fromObject(d: { [k: string]: any }): proto.MsgOpaqueData.PollOption; + public static toObject(m: proto.MsgOpaqueData.PollOption, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7558,10 +8425,13 @@ export namespace proto { class PollVoteSnapshot implements IPollVoteSnapshot { constructor(p?: proto.MsgOpaqueData.IPollVoteSnapshot); public option?: (proto.MsgOpaqueData.IPollOption|null); - public optionVoteCount: number; + public optionVoteCount?: (number|null); public static create(properties?: proto.MsgOpaqueData.IPollVoteSnapshot): proto.MsgOpaqueData.PollVoteSnapshot; public static encode(m: proto.MsgOpaqueData.IPollVoteSnapshot, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MsgOpaqueData.PollVoteSnapshot; + public static fromObject(d: { [k: string]: any }): proto.MsgOpaqueData.PollVoteSnapshot; + public static toObject(m: proto.MsgOpaqueData.PollVoteSnapshot, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7575,6 +8445,9 @@ export namespace proto { public static create(properties?: proto.MsgOpaqueData.IPollVotesSnapshot): proto.MsgOpaqueData.PollVotesSnapshot; public static encode(m: proto.MsgOpaqueData.IPollVotesSnapshot, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MsgOpaqueData.PollVotesSnapshot; + public static fromObject(d: { [k: string]: any }): proto.MsgOpaqueData.PollVotesSnapshot; + public static toObject(m: proto.MsgOpaqueData.PollVotesSnapshot, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -7591,6 +8464,9 @@ export namespace proto { public static create(properties?: proto.IMsgRowOpaqueData): proto.MsgRowOpaqueData; public static encode(m: proto.IMsgRowOpaqueData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.MsgRowOpaqueData; + public static fromObject(d: { [k: string]: any }): proto.MsgRowOpaqueData; + public static toObject(m: proto.MsgRowOpaqueData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7601,11 +8477,14 @@ export namespace proto { class NoiseCertificate implements INoiseCertificate { constructor(p?: proto.INoiseCertificate); - public details: Uint8Array; - public signature: Uint8Array; + public details?: (Uint8Array|null); + public signature?: (Uint8Array|null); public static create(properties?: proto.INoiseCertificate): proto.NoiseCertificate; public static encode(m: proto.INoiseCertificate, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NoiseCertificate; + public static fromObject(d: { [k: string]: any }): proto.NoiseCertificate; + public static toObject(m: proto.NoiseCertificate, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7621,14 +8500,17 @@ export namespace proto { class Details implements IDetails { constructor(p?: proto.NoiseCertificate.IDetails); - public serial: number; - public issuer: string; - public expires: (number|Long); - public subject: string; - public key: Uint8Array; + public serial?: (number|null); + public issuer?: (string|null); + public expires?: (number|Long|null); + public subject?: (string|null); + public key?: (Uint8Array|null); public static create(properties?: proto.NoiseCertificate.IDetails): proto.NoiseCertificate.Details; public static encode(m: proto.NoiseCertificate.IDetails, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NoiseCertificate.Details; + public static fromObject(d: { [k: string]: any }): proto.NoiseCertificate.Details; + public static toObject(m: proto.NoiseCertificate.Details, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -7644,11 +8526,14 @@ export namespace proto { constructor(p?: proto.INotificationMessageInfo); public key?: (proto.IMessageKey|null); public message?: (proto.IMessage|null); - public messageTimestamp: (number|Long); - public participant: string; + public messageTimestamp?: (number|Long|null); + public participant?: (string|null); public static create(properties?: proto.INotificationMessageInfo): proto.NotificationMessageInfo; public static encode(m: proto.INotificationMessageInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NotificationMessageInfo; + public static fromObject(d: { [k: string]: any }): proto.NotificationMessageInfo; + public static toObject(m: proto.NotificationMessageInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7663,15 +8548,18 @@ export namespace proto { class NotificationSettings implements INotificationSettings { constructor(p?: proto.INotificationSettings); - public messageVibrate: string; - public messagePopup: string; - public messageLight: string; - public lowPriorityNotifications: boolean; - public reactionsMuted: boolean; - public callVibrate: string; + public messageVibrate?: (string|null); + public messagePopup?: (string|null); + public messageLight?: (string|null); + public lowPriorityNotifications?: (boolean|null); + public reactionsMuted?: (boolean|null); + public callVibrate?: (string|null); public static create(properties?: proto.INotificationSettings): proto.NotificationSettings; public static encode(m: proto.INotificationSettings, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NotificationSettings; + public static fromObject(d: { [k: string]: any }): proto.NotificationSettings; + public static toObject(m: proto.NotificationSettings, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7683,12 +8571,15 @@ export namespace proto { class PairingRequest implements IPairingRequest { constructor(p?: proto.IPairingRequest); - public companionPublicKey: Uint8Array; - public companionIdentityKey: Uint8Array; - public advSecret: Uint8Array; + public companionPublicKey?: (Uint8Array|null); + public companionIdentityKey?: (Uint8Array|null); + public advSecret?: (Uint8Array|null); public static create(properties?: proto.IPairingRequest): proto.PairingRequest; public static encode(m: proto.IPairingRequest, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PairingRequest; + public static fromObject(d: { [k: string]: any }): proto.PairingRequest; + public static toObject(m: proto.PairingRequest, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7700,12 +8591,15 @@ export namespace proto { class PastParticipant implements IPastParticipant { constructor(p?: proto.IPastParticipant); - public userJid: string; - public leaveReason: proto.PastParticipant.LeaveReason; - public leaveTs: (number|Long); + public userJid?: (string|null); + public leaveReason?: (proto.PastParticipant.LeaveReason|null); + public leaveTs?: (number|Long|null); public static create(properties?: proto.IPastParticipant): proto.PastParticipant; public static encode(m: proto.IPastParticipant, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PastParticipant; + public static fromObject(d: { [k: string]: any }): proto.PastParticipant; + public static toObject(m: proto.PastParticipant, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7724,11 +8618,14 @@ export namespace proto { class PastParticipants implements IPastParticipants { constructor(p?: proto.IPastParticipants); - public groupJid: string; + public groupJid?: (string|null); public pastParticipants: proto.IPastParticipant[]; public static create(properties?: proto.IPastParticipants): proto.PastParticipants; public static encode(m: proto.IPastParticipants, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PastParticipants; + public static fromObject(d: { [k: string]: any }): proto.PastParticipants; + public static toObject(m: proto.PastParticipants, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7748,20 +8645,23 @@ export namespace proto { class PatchDebugData implements IPatchDebugData { constructor(p?: proto.IPatchDebugData); - public currentLthash: Uint8Array; - public newLthash: Uint8Array; - public patchVersion: Uint8Array; - public collectionName: Uint8Array; - public firstFourBytesFromAHashOfSnapshotMacKey: Uint8Array; - public newLthashSubtract: Uint8Array; - public numberAdd: number; - public numberRemove: number; - public numberOverride: number; - public senderPlatform: proto.PatchDebugData.Platform; - public isSenderPrimary: boolean; + public currentLthash?: (Uint8Array|null); + public newLthash?: (Uint8Array|null); + public patchVersion?: (Uint8Array|null); + public collectionName?: (Uint8Array|null); + public firstFourBytesFromAHashOfSnapshotMacKey?: (Uint8Array|null); + public newLthashSubtract?: (Uint8Array|null); + public numberAdd?: (number|null); + public numberRemove?: (number|null); + public numberOverride?: (number|null); + public senderPlatform?: (proto.PatchDebugData.Platform|null); + public isSenderPrimary?: (boolean|null); public static create(properties?: proto.IPatchDebugData): proto.PatchDebugData; public static encode(m: proto.IPatchDebugData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PatchDebugData; + public static fromObject(d: { [k: string]: any }): proto.PatchDebugData; + public static toObject(m: proto.PatchDebugData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7795,19 +8695,22 @@ export namespace proto { class PaymentBackground implements IPaymentBackground { constructor(p?: proto.IPaymentBackground); - public id: string; - public fileLength: (number|Long); - public width: number; - public height: number; - public mimetype: string; - public placeholderArgb: number; - public textArgb: number; - public subtextArgb: number; + public id?: (string|null); + public fileLength?: (number|Long|null); + public width?: (number|null); + public height?: (number|null); + public mimetype?: (string|null); + public placeholderArgb?: (number|null); + public textArgb?: (number|null); + public subtextArgb?: (number|null); public mediaData?: (proto.PaymentBackground.IMediaData|null); - public type: proto.PaymentBackground.Type; + public type?: (proto.PaymentBackground.Type|null); public static create(properties?: proto.IPaymentBackground): proto.PaymentBackground; public static encode(m: proto.IPaymentBackground, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PaymentBackground; + public static fromObject(d: { [k: string]: any }): proto.PaymentBackground; + public static toObject(m: proto.PaymentBackground, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7823,14 +8726,17 @@ export namespace proto { class MediaData implements IMediaData { constructor(p?: proto.PaymentBackground.IMediaData); - public mediaKey: Uint8Array; - public mediaKeyTimestamp: (number|Long); - public fileSha256: Uint8Array; - public fileEncSha256: Uint8Array; - public directPath: string; + public mediaKey?: (Uint8Array|null); + public mediaKeyTimestamp?: (number|Long|null); + public fileSha256?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public directPath?: (string|null); public static create(properties?: proto.PaymentBackground.IMediaData): proto.PaymentBackground.MediaData; public static encode(m: proto.PaymentBackground.IMediaData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PaymentBackground.MediaData; + public static fromObject(d: { [k: string]: any }): proto.PaymentBackground.MediaData; + public static toObject(m: proto.PaymentBackground.MediaData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7858,22 +8764,25 @@ export namespace proto { class PaymentInfo implements IPaymentInfo { constructor(p?: proto.IPaymentInfo); - public currencyDeprecated: proto.PaymentInfo.Currency; - public amount1000: (number|Long); - public receiverJid: string; - public status: proto.PaymentInfo.Status; - public transactionTimestamp: (number|Long); + public currencyDeprecated?: (proto.PaymentInfo.Currency|null); + public amount1000?: (number|Long|null); + public receiverJid?: (string|null); + public status?: (proto.PaymentInfo.Status|null); + public transactionTimestamp?: (number|Long|null); public requestMessageKey?: (proto.IMessageKey|null); - public expiryTimestamp: (number|Long); - public futureproofed: boolean; - public currency: string; - public txnStatus: proto.PaymentInfo.TxnStatus; - public useNoviFiatFormat: boolean; + public expiryTimestamp?: (number|Long|null); + public futureproofed?: (boolean|null); + public currency?: (string|null); + public txnStatus?: (proto.PaymentInfo.TxnStatus|null); + public useNoviFiatFormat?: (boolean|null); public primaryAmount?: (proto.IMoney|null); public exchangeAmount?: (proto.IMoney|null); public static create(properties?: proto.IPaymentInfo): proto.PaymentInfo; public static encode(m: proto.IPaymentInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PaymentInfo; + public static fromObject(d: { [k: string]: any }): proto.PaymentInfo; + public static toObject(m: proto.PaymentInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7942,11 +8851,14 @@ export namespace proto { class PhoneNumberToLIDMapping implements IPhoneNumberToLIDMapping { constructor(p?: proto.IPhoneNumberToLIDMapping); - public pnJid: string; - public lidJid: string; + public pnJid?: (string|null); + public lidJid?: (string|null); public static create(properties?: proto.IPhoneNumberToLIDMapping): proto.PhoneNumberToLIDMapping; public static encode(m: proto.IPhoneNumberToLIDMapping, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PhoneNumberToLIDMapping; + public static fromObject(d: { [k: string]: any }): proto.PhoneNumberToLIDMapping; + public static toObject(m: proto.PhoneNumberToLIDMapping, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7958,12 +8870,15 @@ export namespace proto { class PhotoChange implements IPhotoChange { constructor(p?: proto.IPhotoChange); - public oldPhoto: Uint8Array; - public newPhoto: Uint8Array; - public newPhotoId: number; + public oldPhoto?: (Uint8Array|null); + public newPhoto?: (Uint8Array|null); + public newPhotoId?: (number|null); public static create(properties?: proto.IPhotoChange): proto.PhotoChange; public static encode(m: proto.IPhotoChange, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PhotoChange; + public static fromObject(d: { [k: string]: any }): proto.PhotoChange; + public static toObject(m: proto.PhotoChange, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -7977,14 +8892,17 @@ export namespace proto { class PinInChat implements IPinInChat { constructor(p?: proto.IPinInChat); - public type: proto.PinInChat.Type; + public type?: (proto.PinInChat.Type|null); public key?: (proto.IMessageKey|null); - public senderTimestampMs: (number|Long); - public serverTimestampMs: (number|Long); + public senderTimestampMs?: (number|Long|null); + public serverTimestampMs?: (number|Long|null); public messageAddOnContextInfo?: (proto.IMessageAddOnContextInfo|null); public static create(properties?: proto.IPinInChat): proto.PinInChat; public static encode(m: proto.IPinInChat, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PinInChat; + public static fromObject(d: { [k: string]: any }): proto.PinInChat; + public static toObject(m: proto.PinInChat, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8006,13 +8924,16 @@ export namespace proto { class Point implements IPoint { constructor(p?: proto.IPoint); - public xDeprecated: number; - public yDeprecated: number; - public x: number; - public y: number; + public xDeprecated?: (number|null); + public yDeprecated?: (number|null); + public x?: (number|null); + public y?: (number|null); public static create(properties?: proto.IPoint): proto.Point; public static encode(m: proto.IPoint, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Point; + public static fromObject(d: { [k: string]: any }): proto.Point; + public static toObject(m: proto.Point, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8022,10 +8943,13 @@ export namespace proto { class PollAdditionalMetadata implements IPollAdditionalMetadata { constructor(p?: proto.IPollAdditionalMetadata); - public pollInvalidated: boolean; + public pollInvalidated?: (boolean|null); public static create(properties?: proto.IPollAdditionalMetadata): proto.PollAdditionalMetadata; public static encode(m: proto.IPollAdditionalMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PollAdditionalMetadata; + public static fromObject(d: { [k: string]: any }): proto.PollAdditionalMetadata; + public static toObject(m: proto.PollAdditionalMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8036,11 +8960,14 @@ export namespace proto { class PollEncValue implements IPollEncValue { constructor(p?: proto.IPollEncValue); - public encPayload: Uint8Array; - public encIv: Uint8Array; + public encPayload?: (Uint8Array|null); + public encIv?: (Uint8Array|null); public static create(properties?: proto.IPollEncValue): proto.PollEncValue; public static encode(m: proto.IPollEncValue, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PollEncValue; + public static fromObject(d: { [k: string]: any }): proto.PollEncValue; + public static toObject(m: proto.PollEncValue, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8056,12 +8983,15 @@ export namespace proto { constructor(p?: proto.IPollUpdate); public pollUpdateMessageKey?: (proto.IMessageKey|null); public vote?: (proto.Message.IPollVoteMessage|null); - public senderTimestampMs: (number|Long); - public serverTimestampMs: (number|Long); - public unread: boolean; + public senderTimestampMs?: (number|Long|null); + public serverTimestampMs?: (number|Long|null); + public unread?: (boolean|null); public static create(properties?: proto.IPollUpdate): proto.PollUpdate; public static encode(m: proto.IPollUpdate, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PollUpdate; + public static fromObject(d: { [k: string]: any }): proto.PollUpdate; + public static toObject(m: proto.PollUpdate, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8073,12 +9003,15 @@ export namespace proto { class PreKeyRecordStructure implements IPreKeyRecordStructure { constructor(p?: proto.IPreKeyRecordStructure); - public id: number; - public publicKey: Uint8Array; - public privateKey: Uint8Array; + public id?: (number|null); + public publicKey?: (Uint8Array|null); + public privateKey?: (Uint8Array|null); public static create(properties?: proto.IPreKeyRecordStructure): proto.PreKeyRecordStructure; public static encode(m: proto.IPreKeyRecordStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PreKeyRecordStructure; + public static fromObject(d: { [k: string]: any }): proto.PreKeyRecordStructure; + public static toObject(m: proto.PreKeyRecordStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8093,15 +9026,18 @@ export namespace proto { class PreKeySignalMessage implements IPreKeySignalMessage { constructor(p?: proto.IPreKeySignalMessage); - public registrationId: number; - public preKeyId: number; - public signedPreKeyId: number; - public baseKey: Uint8Array; - public identityKey: Uint8Array; - public message: Uint8Array; + public registrationId?: (number|null); + public preKeyId?: (number|null); + public signedPreKeyId?: (number|null); + public baseKey?: (Uint8Array|null); + public identityKey?: (Uint8Array|null); + public message?: (Uint8Array|null); public static create(properties?: proto.IPreKeySignalMessage): proto.PreKeySignalMessage; public static encode(m: proto.IPreKeySignalMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PreKeySignalMessage; + public static fromObject(d: { [k: string]: any }): proto.PreKeySignalMessage; + public static toObject(m: proto.PreKeySignalMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8111,10 +9047,13 @@ export namespace proto { class PremiumMessageInfo implements IPremiumMessageInfo { constructor(p?: proto.IPremiumMessageInfo); - public serverCampaignId: string; + public serverCampaignId?: (string|null); public static create(properties?: proto.IPremiumMessageInfo): proto.PremiumMessageInfo; public static encode(m: proto.IPremiumMessageInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PremiumMessageInfo; + public static fromObject(d: { [k: string]: any }): proto.PremiumMessageInfo; + public static toObject(m: proto.PremiumMessageInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8125,11 +9064,14 @@ export namespace proto { class PrimaryEphemeralIdentity implements IPrimaryEphemeralIdentity { constructor(p?: proto.IPrimaryEphemeralIdentity); - public publicKey: Uint8Array; - public nonce: Uint8Array; + public publicKey?: (Uint8Array|null); + public nonce?: (Uint8Array|null); public static create(properties?: proto.IPrimaryEphemeralIdentity): proto.PrimaryEphemeralIdentity; public static encode(m: proto.IPrimaryEphemeralIdentity, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PrimaryEphemeralIdentity; + public static fromObject(d: { [k: string]: any }): proto.PrimaryEphemeralIdentity; + public static toObject(m: proto.PrimaryEphemeralIdentity, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8152,17 +9094,20 @@ export namespace proto { class ProcessedVideo implements IProcessedVideo { constructor(p?: proto.IProcessedVideo); - public directPath: string; - public fileSha256: Uint8Array; - public height: number; - public width: number; - public fileLength: (number|Long); - public bitrate: number; - public quality: proto.ProcessedVideo.VideoQuality; + public directPath?: (string|null); + public fileSha256?: (Uint8Array|null); + public height?: (number|null); + public width?: (number|null); + public fileLength?: (number|Long|null); + public bitrate?: (number|null); + public quality?: (proto.ProcessedVideo.VideoQuality|null); public capabilities: string[]; public static create(properties?: proto.IProcessedVideo): proto.ProcessedVideo; public static encode(m: proto.IProcessedVideo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ProcessedVideo; + public static fromObject(d: { [k: string]: any }): proto.ProcessedVideo; + public static toObject(m: proto.ProcessedVideo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8183,11 +9128,14 @@ export namespace proto { class ProloguePayload implements IProloguePayload { constructor(p?: proto.IProloguePayload); - public companionEphemeralIdentity: Uint8Array; + public companionEphemeralIdentity?: (Uint8Array|null); public commitment?: (proto.ICompanionCommitment|null); public static create(properties?: proto.IProloguePayload): proto.ProloguePayload; public static encode(m: proto.IProloguePayload, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ProloguePayload; + public static fromObject(d: { [k: string]: any }): proto.ProloguePayload; + public static toObject(m: proto.ProloguePayload, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8198,11 +9146,14 @@ export namespace proto { class Pushname implements IPushname { constructor(p?: proto.IPushname); - public id: string; - public pushname: string; + public id?: (string|null); + public pushname?: (string|null); public static create(properties?: proto.IPushname): proto.Pushname; public static encode(m: proto.IPushname, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Pushname; + public static fromObject(d: { [k: string]: any }): proto.Pushname; + public static toObject(m: proto.Pushname, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8217,13 +9168,16 @@ export namespace proto { class Reaction implements IReaction { constructor(p?: proto.IReaction); public key?: (proto.IMessageKey|null); - public text: string; - public groupingKey: string; - public senderTimestampMs: (number|Long); - public unread: boolean; + public text?: (string|null); + public groupingKey?: (string|null); + public senderTimestampMs?: (number|Long|null); + public unread?: (boolean|null); public static create(properties?: proto.IReaction): proto.Reaction; public static encode(m: proto.IReaction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Reaction; + public static fromObject(d: { [k: string]: any }): proto.Reaction; + public static toObject(m: proto.Reaction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8234,11 +9188,14 @@ export namespace proto { class RecentEmojiWeight implements IRecentEmojiWeight { constructor(p?: proto.IRecentEmojiWeight); - public emoji: string; - public weight: number; + public emoji?: (string|null); + public weight?: (number|null); public static create(properties?: proto.IRecentEmojiWeight): proto.RecentEmojiWeight; public static encode(m: proto.IRecentEmojiWeight, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RecentEmojiWeight; + public static fromObject(d: { [k: string]: any }): proto.RecentEmojiWeight; + public static toObject(m: proto.RecentEmojiWeight, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8254,6 +9211,9 @@ export namespace proto { public static create(properties?: proto.IRecordStructure): proto.RecordStructure; public static encode(m: proto.IRecordStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RecordStructure; + public static fromObject(d: { [k: string]: any }): proto.RecordStructure; + public static toObject(m: proto.RecordStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8266,13 +9226,16 @@ export namespace proto { class Reportable implements IReportable { constructor(p?: proto.IReportable); - public minVersion: number; - public maxVersion: number; - public notReportableMinVersion: number; - public never: boolean; + public minVersion?: (number|null); + public maxVersion?: (number|null); + public notReportableMinVersion?: (number|null); + public never?: (boolean|null); public static create(properties?: proto.IReportable): proto.Reportable; public static encode(m: proto.IReportable, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Reportable; + public static fromObject(d: { [k: string]: any }): proto.Reportable; + public static toObject(m: proto.Reportable, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8282,10 +9245,13 @@ export namespace proto { class ReportingTokenInfo implements IReportingTokenInfo { constructor(p?: proto.IReportingTokenInfo); - public reportingTag: Uint8Array; + public reportingTag?: (Uint8Array|null); public static create(properties?: proto.IReportingTokenInfo): proto.ReportingTokenInfo; public static encode(m: proto.IReportingTokenInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ReportingTokenInfo; + public static fromObject(d: { [k: string]: any }): proto.ReportingTokenInfo; + public static toObject(m: proto.ReportingTokenInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8298,13 +9264,16 @@ export namespace proto { class SenderKeyDistributionMessage implements ISenderKeyDistributionMessage { constructor(p?: proto.ISenderKeyDistributionMessage); - public id: number; - public iteration: number; - public chainKey: Uint8Array; - public signingKey: Uint8Array; + public id?: (number|null); + public iteration?: (number|null); + public chainKey?: (Uint8Array|null); + public signingKey?: (Uint8Array|null); public static create(properties?: proto.ISenderKeyDistributionMessage): proto.SenderKeyDistributionMessage; public static encode(m: proto.ISenderKeyDistributionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyDistributionMessage; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyDistributionMessage; + public static toObject(m: proto.SenderKeyDistributionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8316,12 +9285,15 @@ export namespace proto { class SenderKeyMessage implements ISenderKeyMessage { constructor(p?: proto.ISenderKeyMessage); - public id: number; - public iteration: number; - public ciphertext: Uint8Array; + public id?: (number|null); + public iteration?: (number|null); + public ciphertext?: (Uint8Array|null); public static create(properties?: proto.ISenderKeyMessage): proto.SenderKeyMessage; public static encode(m: proto.ISenderKeyMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyMessage; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyMessage; + public static toObject(m: proto.SenderKeyMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8335,6 +9307,9 @@ export namespace proto { public static create(properties?: proto.ISenderKeyRecordStructure): proto.SenderKeyRecordStructure; public static encode(m: proto.ISenderKeyRecordStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyRecordStructure; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyRecordStructure; + public static toObject(m: proto.SenderKeyRecordStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8347,13 +9322,16 @@ export namespace proto { class SenderKeyStateStructure implements ISenderKeyStateStructure { constructor(p?: proto.ISenderKeyStateStructure); - public senderKeyId: number; + public senderKeyId?: (number|null); public senderChainKey?: (proto.SenderKeyStateStructure.ISenderChainKey|null); public senderSigningKey?: (proto.SenderKeyStateStructure.ISenderSigningKey|null); public senderMessageKeys: proto.SenderKeyStateStructure.ISenderMessageKey[]; public static create(properties?: proto.ISenderKeyStateStructure): proto.SenderKeyStateStructure; public static encode(m: proto.ISenderKeyStateStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyStateStructure; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyStateStructure; + public static toObject(m: proto.SenderKeyStateStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8366,11 +9344,14 @@ export namespace proto { class SenderChainKey implements ISenderChainKey { constructor(p?: proto.SenderKeyStateStructure.ISenderChainKey); - public iteration: number; - public seed: Uint8Array; + public iteration?: (number|null); + public seed?: (Uint8Array|null); public static create(properties?: proto.SenderKeyStateStructure.ISenderChainKey): proto.SenderKeyStateStructure.SenderChainKey; public static encode(m: proto.SenderKeyStateStructure.ISenderChainKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyStateStructure.SenderChainKey; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyStateStructure.SenderChainKey; + public static toObject(m: proto.SenderKeyStateStructure.SenderChainKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8381,11 +9362,14 @@ export namespace proto { class SenderMessageKey implements ISenderMessageKey { constructor(p?: proto.SenderKeyStateStructure.ISenderMessageKey); - public iteration: number; - public seed: Uint8Array; + public iteration?: (number|null); + public seed?: (Uint8Array|null); public static create(properties?: proto.SenderKeyStateStructure.ISenderMessageKey): proto.SenderKeyStateStructure.SenderMessageKey; public static encode(m: proto.SenderKeyStateStructure.ISenderMessageKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyStateStructure.SenderMessageKey; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyStateStructure.SenderMessageKey; + public static toObject(m: proto.SenderKeyStateStructure.SenderMessageKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8396,11 +9380,14 @@ export namespace proto { class SenderSigningKey implements ISenderSigningKey { constructor(p?: proto.SenderKeyStateStructure.ISenderSigningKey); - public public: Uint8Array; - public private: Uint8Array; + public public?: (Uint8Array|null); + public private?: (Uint8Array|null); public static create(properties?: proto.SenderKeyStateStructure.ISenderSigningKey): proto.SenderKeyStateStructure.SenderSigningKey; public static encode(m: proto.SenderKeyStateStructure.ISenderSigningKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SenderKeyStateStructure.SenderSigningKey; + public static fromObject(d: { [k: string]: any }): proto.SenderKeyStateStructure.SenderSigningKey; + public static toObject(m: proto.SenderKeyStateStructure.SenderSigningKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -8411,10 +9398,13 @@ export namespace proto { class ServerErrorReceipt implements IServerErrorReceipt { constructor(p?: proto.IServerErrorReceipt); - public stanzaId: string; + public stanzaId?: (string|null); public static create(properties?: proto.IServerErrorReceipt): proto.ServerErrorReceipt; public static encode(m: proto.IServerErrorReceipt, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServerErrorReceipt; + public static fromObject(d: { [k: string]: any }): proto.ServerErrorReceipt; + public static toObject(m: proto.ServerErrorReceipt, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8436,22 +9426,25 @@ export namespace proto { class SessionStructure implements ISessionStructure { constructor(p?: proto.ISessionStructure); - public sessionVersion: number; - public localIdentityPublic: Uint8Array; - public remoteIdentityPublic: Uint8Array; - public rootKey: Uint8Array; - public previousCounter: number; + public sessionVersion?: (number|null); + public localIdentityPublic?: (Uint8Array|null); + public remoteIdentityPublic?: (Uint8Array|null); + public rootKey?: (Uint8Array|null); + public previousCounter?: (number|null); public senderChain?: (proto.SessionStructure.IChain|null); public receiverChains: proto.SessionStructure.IChain[]; public pendingKeyExchange?: (proto.SessionStructure.IPendingKeyExchange|null); public pendingPreKey?: (proto.SessionStructure.IPendingPreKey|null); - public remoteRegistrationId: number; - public localRegistrationId: number; - public needsRefresh: boolean; - public aliceBaseKey: Uint8Array; + public remoteRegistrationId?: (number|null); + public localRegistrationId?: (number|null); + public needsRefresh?: (boolean|null); + public aliceBaseKey?: (Uint8Array|null); public static create(properties?: proto.ISessionStructure): proto.SessionStructure; public static encode(m: proto.ISessionStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SessionStructure; + public static fromObject(d: { [k: string]: any }): proto.SessionStructure; + public static toObject(m: proto.SessionStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8466,13 +9459,16 @@ export namespace proto { class Chain implements IChain { constructor(p?: proto.SessionStructure.IChain); - public senderRatchetKey: Uint8Array; - public senderRatchetKeyPrivate: Uint8Array; + public senderRatchetKey?: (Uint8Array|null); + public senderRatchetKeyPrivate?: (Uint8Array|null); public chainKey?: (proto.SessionStructure.Chain.IChainKey|null); public messageKeys: proto.SessionStructure.Chain.IMessageKey[]; public static create(properties?: proto.SessionStructure.IChain): proto.SessionStructure.Chain; public static encode(m: proto.SessionStructure.IChain, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SessionStructure.Chain; + public static fromObject(d: { [k: string]: any }): proto.SessionStructure.Chain; + public static toObject(m: proto.SessionStructure.Chain, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8485,11 +9481,14 @@ export namespace proto { class ChainKey implements IChainKey { constructor(p?: proto.SessionStructure.Chain.IChainKey); - public index: number; - public key: Uint8Array; + public index?: (number|null); + public key?: (Uint8Array|null); public static create(properties?: proto.SessionStructure.Chain.IChainKey): proto.SessionStructure.Chain.ChainKey; public static encode(m: proto.SessionStructure.Chain.IChainKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SessionStructure.Chain.ChainKey; + public static fromObject(d: { [k: string]: any }): proto.SessionStructure.Chain.ChainKey; + public static toObject(m: proto.SessionStructure.Chain.ChainKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8502,13 +9501,16 @@ export namespace proto { class MessageKey implements IMessageKey { constructor(p?: proto.SessionStructure.Chain.IMessageKey); - public index: number; - public cipherKey: Uint8Array; - public macKey: Uint8Array; - public iv: Uint8Array; + public index?: (number|null); + public cipherKey?: (Uint8Array|null); + public macKey?: (Uint8Array|null); + public iv?: (Uint8Array|null); public static create(properties?: proto.SessionStructure.Chain.IMessageKey): proto.SessionStructure.Chain.MessageKey; public static encode(m: proto.SessionStructure.Chain.IMessageKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SessionStructure.Chain.MessageKey; + public static fromObject(d: { [k: string]: any }): proto.SessionStructure.Chain.MessageKey; + public static toObject(m: proto.SessionStructure.Chain.MessageKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -8525,16 +9527,19 @@ export namespace proto { class PendingKeyExchange implements IPendingKeyExchange { constructor(p?: proto.SessionStructure.IPendingKeyExchange); - public sequence: number; - public localBaseKey: Uint8Array; - public localBaseKeyPrivate: Uint8Array; - public localRatchetKey: Uint8Array; - public localRatchetKeyPrivate: Uint8Array; - public localIdentityKey: Uint8Array; - public localIdentityKeyPrivate: Uint8Array; + public sequence?: (number|null); + public localBaseKey?: (Uint8Array|null); + public localBaseKeyPrivate?: (Uint8Array|null); + public localRatchetKey?: (Uint8Array|null); + public localRatchetKeyPrivate?: (Uint8Array|null); + public localIdentityKey?: (Uint8Array|null); + public localIdentityKeyPrivate?: (Uint8Array|null); public static create(properties?: proto.SessionStructure.IPendingKeyExchange): proto.SessionStructure.PendingKeyExchange; public static encode(m: proto.SessionStructure.IPendingKeyExchange, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SessionStructure.PendingKeyExchange; + public static fromObject(d: { [k: string]: any }): proto.SessionStructure.PendingKeyExchange; + public static toObject(m: proto.SessionStructure.PendingKeyExchange, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8546,12 +9551,15 @@ export namespace proto { class PendingPreKey implements IPendingPreKey { constructor(p?: proto.SessionStructure.IPendingPreKey); - public preKeyId: number; - public signedPreKeyId: number; - public baseKey: Uint8Array; + public preKeyId?: (number|null); + public signedPreKeyId?: (number|null); + public baseKey?: (Uint8Array|null); public static create(properties?: proto.SessionStructure.IPendingPreKey): proto.SessionStructure.PendingPreKey; public static encode(m: proto.SessionStructure.IPendingPreKey, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SessionStructure.PendingPreKey; + public static fromObject(d: { [k: string]: any }): proto.SessionStructure.PendingPreKey; + public static toObject(m: proto.SessionStructure.PendingPreKey, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -8565,13 +9573,16 @@ export namespace proto { class SignalMessage implements ISignalMessage { constructor(p?: proto.ISignalMessage); - public ratchetKey: Uint8Array; - public counter: number; - public previousCounter: number; - public ciphertext: Uint8Array; + public ratchetKey?: (Uint8Array|null); + public counter?: (number|null); + public previousCounter?: (number|null); + public ciphertext?: (Uint8Array|null); public static create(properties?: proto.ISignalMessage): proto.SignalMessage; public static encode(m: proto.ISignalMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignalMessage; + public static fromObject(d: { [k: string]: any }): proto.SignalMessage; + public static toObject(m: proto.SignalMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8585,14 +9596,17 @@ export namespace proto { class SignedPreKeyRecordStructure implements ISignedPreKeyRecordStructure { constructor(p?: proto.ISignedPreKeyRecordStructure); - public id: number; - public publicKey: Uint8Array; - public privateKey: Uint8Array; - public signature: Uint8Array; - public timestamp: (number|Long); + public id?: (number|null); + public publicKey?: (Uint8Array|null); + public privateKey?: (Uint8Array|null); + public signature?: (Uint8Array|null); + public timestamp?: (number|Long|null); public static create(properties?: proto.ISignedPreKeyRecordStructure): proto.SignedPreKeyRecordStructure; public static encode(m: proto.ISignedPreKeyRecordStructure, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignedPreKeyRecordStructure; + public static fromObject(d: { [k: string]: any }): proto.SignedPreKeyRecordStructure; + public static toObject(m: proto.SignedPreKeyRecordStructure, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8606,21 +9620,27 @@ export namespace proto { public static create(properties?: proto.IStatusMentionMessage): proto.StatusMentionMessage; public static encode(m: proto.IStatusMentionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StatusMentionMessage; + public static fromObject(d: { [k: string]: any }): proto.StatusMentionMessage; + public static toObject(m: proto.StatusMentionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface IStatusPSA { - campaignId: (number|Long); + campaignId?: (number|Long|null); campaignExpirationTimestamp?: (number|Long|null); } class StatusPSA implements IStatusPSA { constructor(p?: proto.IStatusPSA); public campaignId: (number|Long); - public campaignExpirationTimestamp: (number|Long); + public campaignExpirationTimestamp?: (number|Long|null); public static create(properties?: proto.IStatusPSA): proto.StatusPSA; public static encode(m: proto.IStatusPSA, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StatusPSA; + public static fromObject(d: { [k: string]: any }): proto.StatusPSA; + public static toObject(m: proto.StatusPSA, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8641,21 +9661,24 @@ export namespace proto { class StickerMetadata implements IStickerMetadata { constructor(p?: proto.IStickerMetadata); - public url: string; - public fileSha256: Uint8Array; - public fileEncSha256: Uint8Array; - public mediaKey: Uint8Array; - public mimetype: string; - public height: number; - public width: number; - public directPath: string; - public fileLength: (number|Long); - public weight: number; - public lastStickerSentTs: (number|Long); - public isLottie: boolean; + public url?: (string|null); + public fileSha256?: (Uint8Array|null); + public fileEncSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public mimetype?: (string|null); + public height?: (number|null); + public width?: (number|null); + public directPath?: (string|null); + public fileLength?: (number|Long|null); + public weight?: (number|null); + public lastStickerSentTs?: (number|Long|null); + public isLottie?: (boolean|null); public static create(properties?: proto.IStickerMetadata): proto.StickerMetadata; public static encode(m: proto.IStickerMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StickerMetadata; + public static fromObject(d: { [k: string]: any }): proto.StickerMetadata; + public static toObject(m: proto.StickerMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8668,13 +9691,16 @@ export namespace proto { class SyncActionData implements ISyncActionData { constructor(p?: proto.ISyncActionData); - public index: Uint8Array; + public index?: (Uint8Array|null); public value?: (proto.ISyncActionValue|null); - public padding: Uint8Array; - public version: number; + public padding?: (Uint8Array|null); + public version?: (number|null); public static create(properties?: proto.ISyncActionData): proto.SyncActionData; public static encode(m: proto.ISyncActionData, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionData; + public static fromObject(d: { [k: string]: any }): proto.SyncActionData; + public static toObject(m: proto.SyncActionData, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8740,7 +9766,7 @@ export namespace proto { class SyncActionValue implements ISyncActionValue { constructor(p?: proto.ISyncActionValue); - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public starAction?: (proto.SyncActionValue.IStarAction|null); public contactAction?: (proto.SyncActionValue.IContactAction|null); public muteAction?: (proto.SyncActionValue.IMuteAction|null); @@ -8800,6 +9826,9 @@ export namespace proto { public static create(properties?: proto.ISyncActionValue): proto.SyncActionValue; public static encode(m: proto.ISyncActionValue, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue; + public static toObject(m: proto.SyncActionValue, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8813,12 +9842,15 @@ export namespace proto { class AgentAction implements IAgentAction { constructor(p?: proto.SyncActionValue.IAgentAction); - public name: string; - public deviceID: number; - public isDeleted: boolean; + public name?: (string|null); + public deviceID?: (number|null); + public isDeleted?: (boolean|null); public static create(properties?: proto.SyncActionValue.IAgentAction): proto.SyncActionValue.AgentAction; public static encode(m: proto.SyncActionValue.IAgentAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.AgentAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.AgentAction; + public static toObject(m: proto.SyncActionValue.AgentAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8828,10 +9860,13 @@ export namespace proto { class AndroidUnsupportedActions implements IAndroidUnsupportedActions { constructor(p?: proto.SyncActionValue.IAndroidUnsupportedActions); - public allowed: boolean; + public allowed?: (boolean|null); public static create(properties?: proto.SyncActionValue.IAndroidUnsupportedActions): proto.SyncActionValue.AndroidUnsupportedActions; public static encode(m: proto.SyncActionValue.IAndroidUnsupportedActions, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.AndroidUnsupportedActions; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.AndroidUnsupportedActions; + public static toObject(m: proto.SyncActionValue.AndroidUnsupportedActions, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8842,11 +9877,14 @@ export namespace proto { class ArchiveChatAction implements IArchiveChatAction { constructor(p?: proto.SyncActionValue.IArchiveChatAction); - public archived: boolean; + public archived?: (boolean|null); public messageRange?: (proto.SyncActionValue.ISyncActionMessageRange|null); public static create(properties?: proto.SyncActionValue.IArchiveChatAction): proto.SyncActionValue.ArchiveChatAction; public static encode(m: proto.SyncActionValue.IArchiveChatAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.ArchiveChatAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.ArchiveChatAction; + public static toObject(m: proto.SyncActionValue.ArchiveChatAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8856,10 +9894,13 @@ export namespace proto { class BotWelcomeRequestAction implements IBotWelcomeRequestAction { constructor(p?: proto.SyncActionValue.IBotWelcomeRequestAction); - public isSent: boolean; + public isSent?: (boolean|null); public static create(properties?: proto.SyncActionValue.IBotWelcomeRequestAction): proto.SyncActionValue.BotWelcomeRequestAction; public static encode(m: proto.SyncActionValue.IBotWelcomeRequestAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.BotWelcomeRequestAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.BotWelcomeRequestAction; + public static toObject(m: proto.SyncActionValue.BotWelcomeRequestAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8873,6 +9914,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.ICallLogAction): proto.SyncActionValue.CallLogAction; public static encode(m: proto.SyncActionValue.ICallLogAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.CallLogAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.CallLogAction; + public static toObject(m: proto.SyncActionValue.CallLogAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8882,10 +9926,13 @@ export namespace proto { class ChatAssignmentAction implements IChatAssignmentAction { constructor(p?: proto.SyncActionValue.IChatAssignmentAction); - public deviceAgentID: string; + public deviceAgentID?: (string|null); public static create(properties?: proto.SyncActionValue.IChatAssignmentAction): proto.SyncActionValue.ChatAssignmentAction; public static encode(m: proto.SyncActionValue.IChatAssignmentAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.ChatAssignmentAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.ChatAssignmentAction; + public static toObject(m: proto.SyncActionValue.ChatAssignmentAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8895,10 +9942,13 @@ export namespace proto { class ChatAssignmentOpenedStatusAction implements IChatAssignmentOpenedStatusAction { constructor(p?: proto.SyncActionValue.IChatAssignmentOpenedStatusAction); - public chatOpened: boolean; + public chatOpened?: (boolean|null); public static create(properties?: proto.SyncActionValue.IChatAssignmentOpenedStatusAction): proto.SyncActionValue.ChatAssignmentOpenedStatusAction; public static encode(m: proto.SyncActionValue.IChatAssignmentOpenedStatusAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.ChatAssignmentOpenedStatusAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.ChatAssignmentOpenedStatusAction; + public static toObject(m: proto.SyncActionValue.ChatAssignmentOpenedStatusAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8912,6 +9962,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.IClearChatAction): proto.SyncActionValue.ClearChatAction; public static encode(m: proto.SyncActionValue.IClearChatAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.ClearChatAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.ClearChatAction; + public static toObject(m: proto.SyncActionValue.ClearChatAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8926,15 +9979,18 @@ export namespace proto { class ContactAction implements IContactAction { constructor(p?: proto.SyncActionValue.IContactAction); - public fullName: string; - public firstName: string; - public lidJid: string; - public saveOnPrimaryAddressbook: boolean; - public pnJid: string; - public username: string; + public fullName?: (string|null); + public firstName?: (string|null); + public lidJid?: (string|null); + public saveOnPrimaryAddressbook?: (boolean|null); + public pnJid?: (string|null); + public username?: (string|null); public static create(properties?: proto.SyncActionValue.IContactAction): proto.SyncActionValue.ContactAction; public static encode(m: proto.SyncActionValue.IContactAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.ContactAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.ContactAction; + public static toObject(m: proto.SyncActionValue.ContactAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8944,17 +10000,20 @@ export namespace proto { class CtwaPerCustomerDataSharingAction implements ICtwaPerCustomerDataSharingAction { constructor(p?: proto.SyncActionValue.ICtwaPerCustomerDataSharingAction); - public isCtwaPerCustomerDataSharingEnabled: boolean; + public isCtwaPerCustomerDataSharingEnabled?: (boolean|null); public static create(properties?: proto.SyncActionValue.ICtwaPerCustomerDataSharingAction): proto.SyncActionValue.CtwaPerCustomerDataSharingAction; public static encode(m: proto.SyncActionValue.ICtwaPerCustomerDataSharingAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.CtwaPerCustomerDataSharingAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.CtwaPerCustomerDataSharingAction; + public static toObject(m: proto.SyncActionValue.CtwaPerCustomerDataSharingAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface ICustomPaymentMethod { - credentialId: string; - country: string; - type: string; + credentialId?: (string|null); + country?: (string|null); + type?: (string|null); metadata?: (proto.SyncActionValue.ICustomPaymentMethodMetadata[]|null); } @@ -8967,12 +10026,15 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.ICustomPaymentMethod): proto.SyncActionValue.CustomPaymentMethod; public static encode(m: proto.SyncActionValue.ICustomPaymentMethod, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.CustomPaymentMethod; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.CustomPaymentMethod; + public static toObject(m: proto.SyncActionValue.CustomPaymentMethod, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface ICustomPaymentMethodMetadata { - key: string; - value: string; + key?: (string|null); + value?: (string|null); } class CustomPaymentMethodMetadata implements ICustomPaymentMethodMetadata { @@ -8982,6 +10044,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.ICustomPaymentMethodMetadata): proto.SyncActionValue.CustomPaymentMethodMetadata; public static encode(m: proto.SyncActionValue.ICustomPaymentMethodMetadata, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.CustomPaymentMethodMetadata; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.CustomPaymentMethodMetadata; + public static toObject(m: proto.SyncActionValue.CustomPaymentMethodMetadata, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -8995,6 +10060,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.ICustomPaymentMethodsAction): proto.SyncActionValue.CustomPaymentMethodsAction; public static encode(m: proto.SyncActionValue.ICustomPaymentMethodsAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.CustomPaymentMethodsAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.CustomPaymentMethodsAction; + public static toObject(m: proto.SyncActionValue.CustomPaymentMethodsAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9008,6 +10076,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.IDeleteChatAction): proto.SyncActionValue.DeleteChatAction; public static encode(m: proto.SyncActionValue.IDeleteChatAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.DeleteChatAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.DeleteChatAction; + public static toObject(m: proto.SyncActionValue.DeleteChatAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9018,11 +10089,14 @@ export namespace proto { class DeleteIndividualCallLogAction implements IDeleteIndividualCallLogAction { constructor(p?: proto.SyncActionValue.IDeleteIndividualCallLogAction); - public peerJid: string; - public isIncoming: boolean; + public peerJid?: (string|null); + public isIncoming?: (boolean|null); public static create(properties?: proto.SyncActionValue.IDeleteIndividualCallLogAction): proto.SyncActionValue.DeleteIndividualCallLogAction; public static encode(m: proto.SyncActionValue.IDeleteIndividualCallLogAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.DeleteIndividualCallLogAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.DeleteIndividualCallLogAction; + public static toObject(m: proto.SyncActionValue.DeleteIndividualCallLogAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9033,11 +10107,14 @@ export namespace proto { class DeleteMessageForMeAction implements IDeleteMessageForMeAction { constructor(p?: proto.SyncActionValue.IDeleteMessageForMeAction); - public deleteMedia: boolean; - public messageTimestamp: (number|Long); + public deleteMedia?: (boolean|null); + public messageTimestamp?: (number|Long|null); public static create(properties?: proto.SyncActionValue.IDeleteMessageForMeAction): proto.SyncActionValue.DeleteMessageForMeAction; public static encode(m: proto.SyncActionValue.IDeleteMessageForMeAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.DeleteMessageForMeAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.DeleteMessageForMeAction; + public static toObject(m: proto.SyncActionValue.DeleteMessageForMeAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9047,10 +10124,13 @@ export namespace proto { class ExternalWebBetaAction implements IExternalWebBetaAction { constructor(p?: proto.SyncActionValue.IExternalWebBetaAction); - public isOptIn: boolean; + public isOptIn?: (boolean|null); public static create(properties?: proto.SyncActionValue.IExternalWebBetaAction): proto.SyncActionValue.ExternalWebBetaAction; public static encode(m: proto.SyncActionValue.IExternalWebBetaAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.ExternalWebBetaAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.ExternalWebBetaAction; + public static toObject(m: proto.SyncActionValue.ExternalWebBetaAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9064,6 +10144,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.IFavoritesAction): proto.SyncActionValue.FavoritesAction; public static encode(m: proto.SyncActionValue.IFavoritesAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.FavoritesAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.FavoritesAction; + public static toObject(m: proto.SyncActionValue.FavoritesAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9075,10 +10158,13 @@ export namespace proto { class Favorite implements IFavorite { constructor(p?: proto.SyncActionValue.FavoritesAction.IFavorite); - public id: string; + public id?: (string|null); public static create(properties?: proto.SyncActionValue.FavoritesAction.IFavorite): proto.SyncActionValue.FavoritesAction.Favorite; public static encode(m: proto.SyncActionValue.FavoritesAction.IFavorite, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.FavoritesAction.Favorite; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.FavoritesAction.Favorite; + public static toObject(m: proto.SyncActionValue.FavoritesAction.Favorite, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -9089,10 +10175,13 @@ export namespace proto { class KeyExpiration implements IKeyExpiration { constructor(p?: proto.SyncActionValue.IKeyExpiration); - public expiredKeyEpoch: number; + public expiredKeyEpoch?: (number|null); public static create(properties?: proto.SyncActionValue.IKeyExpiration): proto.SyncActionValue.KeyExpiration; public static encode(m: proto.SyncActionValue.IKeyExpiration, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.KeyExpiration; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.KeyExpiration; + public static toObject(m: proto.SyncActionValue.KeyExpiration, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9102,10 +10191,13 @@ export namespace proto { class LabelAssociationAction implements ILabelAssociationAction { constructor(p?: proto.SyncActionValue.ILabelAssociationAction); - public labeled: boolean; + public labeled?: (boolean|null); public static create(properties?: proto.SyncActionValue.ILabelAssociationAction): proto.SyncActionValue.LabelAssociationAction; public static encode(m: proto.SyncActionValue.ILabelAssociationAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.LabelAssociationAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.LabelAssociationAction; + public static toObject(m: proto.SyncActionValue.LabelAssociationAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9122,17 +10214,20 @@ export namespace proto { class LabelEditAction implements ILabelEditAction { constructor(p?: proto.SyncActionValue.ILabelEditAction); - public name: string; - public color: number; - public predefinedId: number; - public deleted: boolean; - public orderIndex: number; - public isActive: boolean; - public type: proto.SyncActionValue.LabelEditAction.ListType; - public isImmutable: boolean; + public name?: (string|null); + public color?: (number|null); + public predefinedId?: (number|null); + public deleted?: (boolean|null); + public orderIndex?: (number|null); + public isActive?: (boolean|null); + public type?: (proto.SyncActionValue.LabelEditAction.ListType|null); + public isImmutable?: (boolean|null); public static create(properties?: proto.SyncActionValue.ILabelEditAction): proto.SyncActionValue.LabelEditAction; public static encode(m: proto.SyncActionValue.ILabelEditAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.LabelEditAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.LabelEditAction; + public static toObject(m: proto.SyncActionValue.LabelEditAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9160,6 +10255,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.ILabelReorderingAction): proto.SyncActionValue.LabelReorderingAction; public static encode(m: proto.SyncActionValue.ILabelReorderingAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.LabelReorderingAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.LabelReorderingAction; + public static toObject(m: proto.SyncActionValue.LabelReorderingAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9172,13 +10270,16 @@ export namespace proto { class LidContactAction implements ILidContactAction { constructor(p?: proto.SyncActionValue.ILidContactAction); - public fullName: string; - public firstName: string; - public username: string; - public saveOnPrimaryAddressbook: boolean; + public fullName?: (string|null); + public firstName?: (string|null); + public username?: (string|null); + public saveOnPrimaryAddressbook?: (boolean|null); public static create(properties?: proto.SyncActionValue.ILidContactAction): proto.SyncActionValue.LidContactAction; public static encode(m: proto.SyncActionValue.ILidContactAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.LidContactAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.LidContactAction; + public static toObject(m: proto.SyncActionValue.LidContactAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9188,10 +10289,13 @@ export namespace proto { class LocaleSetting implements ILocaleSetting { constructor(p?: proto.SyncActionValue.ILocaleSetting); - public locale: string; + public locale?: (string|null); public static create(properties?: proto.SyncActionValue.ILocaleSetting): proto.SyncActionValue.LocaleSetting; public static encode(m: proto.SyncActionValue.ILocaleSetting, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.LocaleSetting; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.LocaleSetting; + public static toObject(m: proto.SyncActionValue.LocaleSetting, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9201,10 +10305,13 @@ export namespace proto { class LockChatAction implements ILockChatAction { constructor(p?: proto.SyncActionValue.ILockChatAction); - public locked: boolean; + public locked?: (boolean|null); public static create(properties?: proto.SyncActionValue.ILockChatAction): proto.SyncActionValue.LockChatAction; public static encode(m: proto.SyncActionValue.ILockChatAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.LockChatAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.LockChatAction; + public static toObject(m: proto.SyncActionValue.LockChatAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9215,11 +10322,14 @@ export namespace proto { class MarkChatAsReadAction implements IMarkChatAsReadAction { constructor(p?: proto.SyncActionValue.IMarkChatAsReadAction); - public read: boolean; + public read?: (boolean|null); public messageRange?: (proto.SyncActionValue.ISyncActionMessageRange|null); public static create(properties?: proto.SyncActionValue.IMarkChatAsReadAction): proto.SyncActionValue.MarkChatAsReadAction; public static encode(m: proto.SyncActionValue.IMarkChatAsReadAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.MarkChatAsReadAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.MarkChatAsReadAction; + public static toObject(m: proto.SyncActionValue.MarkChatAsReadAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9235,16 +10345,19 @@ export namespace proto { class MarketingMessageAction implements IMarketingMessageAction { constructor(p?: proto.SyncActionValue.IMarketingMessageAction); - public name: string; - public message: string; - public type: proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType; - public createdAt: (number|Long); - public lastSentAt: (number|Long); - public isDeleted: boolean; - public mediaId: string; + public name?: (string|null); + public message?: (string|null); + public type?: (proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType|null); + public createdAt?: (number|Long|null); + public lastSentAt?: (number|Long|null); + public isDeleted?: (boolean|null); + public mediaId?: (string|null); public static create(properties?: proto.SyncActionValue.IMarketingMessageAction): proto.SyncActionValue.MarketingMessageAction; public static encode(m: proto.SyncActionValue.IMarketingMessageAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.MarketingMessageAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.MarketingMessageAction; + public static toObject(m: proto.SyncActionValue.MarketingMessageAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9261,16 +10374,19 @@ export namespace proto { class MarketingMessageBroadcastAction implements IMarketingMessageBroadcastAction { constructor(p?: proto.SyncActionValue.IMarketingMessageBroadcastAction); - public repliedCount: number; + public repliedCount?: (number|null); public static create(properties?: proto.SyncActionValue.IMarketingMessageBroadcastAction): proto.SyncActionValue.MarketingMessageBroadcastAction; public static encode(m: proto.SyncActionValue.IMarketingMessageBroadcastAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.MarketingMessageBroadcastAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.MarketingMessageBroadcastAction; + public static toObject(m: proto.SyncActionValue.MarketingMessageBroadcastAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface IMerchantPaymentPartnerAction { - status: proto.SyncActionValue.MerchantPaymentPartnerAction.Status; - country: string; + status?: (proto.SyncActionValue.MerchantPaymentPartnerAction.Status|null); + country?: (string|null); gatewayName?: (string|null); credentialId?: (string|null); } @@ -9279,11 +10395,14 @@ export namespace proto { constructor(p?: proto.SyncActionValue.IMerchantPaymentPartnerAction); public status: proto.SyncActionValue.MerchantPaymentPartnerAction.Status; public country: string; - public gatewayName: string; - public credentialId: string; + public gatewayName?: (string|null); + public credentialId?: (string|null); public static create(properties?: proto.SyncActionValue.IMerchantPaymentPartnerAction): proto.SyncActionValue.MerchantPaymentPartnerAction; public static encode(m: proto.SyncActionValue.IMerchantPaymentPartnerAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.MerchantPaymentPartnerAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.MerchantPaymentPartnerAction; + public static toObject(m: proto.SyncActionValue.MerchantPaymentPartnerAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9303,12 +10422,15 @@ export namespace proto { class MuteAction implements IMuteAction { constructor(p?: proto.SyncActionValue.IMuteAction); - public muted: boolean; - public muteEndTimestamp: (number|Long); - public autoMuted: boolean; + public muted?: (boolean|null); + public muteEndTimestamp?: (number|Long|null); + public autoMuted?: (boolean|null); public static create(properties?: proto.SyncActionValue.IMuteAction): proto.SyncActionValue.MuteAction; public static encode(m: proto.SyncActionValue.IMuteAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.MuteAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.MuteAction; + public static toObject(m: proto.SyncActionValue.MuteAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9322,14 +10444,17 @@ export namespace proto { class NoteEditAction implements INoteEditAction { constructor(p?: proto.SyncActionValue.INoteEditAction); - public type: proto.SyncActionValue.NoteEditAction.NoteType; - public chatJid: string; - public createdAt: (number|Long); - public deleted: boolean; - public unstructuredContent: string; + public type?: (proto.SyncActionValue.NoteEditAction.NoteType|null); + public chatJid?: (string|null); + public createdAt?: (number|Long|null); + public deleted?: (boolean|null); + public unstructuredContent?: (string|null); public static create(properties?: proto.SyncActionValue.INoteEditAction): proto.SyncActionValue.NoteEditAction; public static encode(m: proto.SyncActionValue.INoteEditAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.NoteEditAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.NoteEditAction; + public static toObject(m: proto.SyncActionValue.NoteEditAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9347,10 +10472,13 @@ export namespace proto { class NotificationActivitySettingAction implements INotificationActivitySettingAction { constructor(p?: proto.SyncActionValue.INotificationActivitySettingAction); - public notificationActivitySetting: proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting; + public notificationActivitySetting?: (proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting|null); public static create(properties?: proto.SyncActionValue.INotificationActivitySettingAction): proto.SyncActionValue.NotificationActivitySettingAction; public static encode(m: proto.SyncActionValue.INotificationActivitySettingAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.NotificationActivitySettingAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.NotificationActivitySettingAction; + public static toObject(m: proto.SyncActionValue.NotificationActivitySettingAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9370,10 +10498,13 @@ export namespace proto { class NuxAction implements INuxAction { constructor(p?: proto.SyncActionValue.INuxAction); - public acknowledged: boolean; + public acknowledged?: (boolean|null); public static create(properties?: proto.SyncActionValue.INuxAction): proto.SyncActionValue.NuxAction; public static encode(m: proto.SyncActionValue.INuxAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.NuxAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.NuxAction; + public static toObject(m: proto.SyncActionValue.NuxAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9383,16 +10514,19 @@ export namespace proto { class PaymentInfoAction implements IPaymentInfoAction { constructor(p?: proto.SyncActionValue.IPaymentInfoAction); - public cpi: string; + public cpi?: (string|null); public static create(properties?: proto.SyncActionValue.IPaymentInfoAction): proto.SyncActionValue.PaymentInfoAction; public static encode(m: proto.SyncActionValue.IPaymentInfoAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PaymentInfoAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PaymentInfoAction; + public static toObject(m: proto.SyncActionValue.PaymentInfoAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } interface IPaymentTosAction { - paymentNotice: proto.SyncActionValue.PaymentTosAction.PaymentNotice; - accepted: boolean; + paymentNotice?: (proto.SyncActionValue.PaymentTosAction.PaymentNotice|null); + accepted?: (boolean|null); } class PaymentTosAction implements IPaymentTosAction { @@ -9402,6 +10536,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.IPaymentTosAction): proto.SyncActionValue.PaymentTosAction; public static encode(m: proto.SyncActionValue.IPaymentTosAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PaymentTosAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PaymentTosAction; + public static toObject(m: proto.SyncActionValue.PaymentTosAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9418,10 +10555,13 @@ export namespace proto { class PinAction implements IPinAction { constructor(p?: proto.SyncActionValue.IPinAction); - public pinned: boolean; + public pinned?: (boolean|null); public static create(properties?: proto.SyncActionValue.IPinAction): proto.SyncActionValue.PinAction; public static encode(m: proto.SyncActionValue.IPinAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PinAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PinAction; + public static toObject(m: proto.SyncActionValue.PinAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9431,10 +10571,13 @@ export namespace proto { class PnForLidChatAction implements IPnForLidChatAction { constructor(p?: proto.SyncActionValue.IPnForLidChatAction); - public pnJid: string; + public pnJid?: (string|null); public static create(properties?: proto.SyncActionValue.IPnForLidChatAction): proto.SyncActionValue.PnForLidChatAction; public static encode(m: proto.SyncActionValue.IPnForLidChatAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PnForLidChatAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PnForLidChatAction; + public static toObject(m: proto.SyncActionValue.PnForLidChatAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9448,6 +10591,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.IPrimaryFeature): proto.SyncActionValue.PrimaryFeature; public static encode(m: proto.SyncActionValue.IPrimaryFeature, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PrimaryFeature; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PrimaryFeature; + public static toObject(m: proto.SyncActionValue.PrimaryFeature, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9457,10 +10603,13 @@ export namespace proto { class PrimaryVersionAction implements IPrimaryVersionAction { constructor(p?: proto.SyncActionValue.IPrimaryVersionAction); - public version: string; + public version?: (string|null); public static create(properties?: proto.SyncActionValue.IPrimaryVersionAction): proto.SyncActionValue.PrimaryVersionAction; public static encode(m: proto.SyncActionValue.IPrimaryVersionAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PrimaryVersionAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PrimaryVersionAction; + public static toObject(m: proto.SyncActionValue.PrimaryVersionAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9470,10 +10619,13 @@ export namespace proto { class PrivacySettingDisableLinkPreviewsAction implements IPrivacySettingDisableLinkPreviewsAction { constructor(p?: proto.SyncActionValue.IPrivacySettingDisableLinkPreviewsAction); - public isPreviewsDisabled: boolean; + public isPreviewsDisabled?: (boolean|null); public static create(properties?: proto.SyncActionValue.IPrivacySettingDisableLinkPreviewsAction): proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction; public static encode(m: proto.SyncActionValue.IPrivacySettingDisableLinkPreviewsAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction; + public static toObject(m: proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9483,10 +10635,13 @@ export namespace proto { class PrivacySettingRelayAllCalls implements IPrivacySettingRelayAllCalls { constructor(p?: proto.SyncActionValue.IPrivacySettingRelayAllCalls); - public isEnabled: boolean; + public isEnabled?: (boolean|null); public static create(properties?: proto.SyncActionValue.IPrivacySettingRelayAllCalls): proto.SyncActionValue.PrivacySettingRelayAllCalls; public static encode(m: proto.SyncActionValue.IPrivacySettingRelayAllCalls, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PrivacySettingRelayAllCalls; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PrivacySettingRelayAllCalls; + public static toObject(m: proto.SyncActionValue.PrivacySettingRelayAllCalls, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9496,10 +10651,13 @@ export namespace proto { class PushNameSetting implements IPushNameSetting { constructor(p?: proto.SyncActionValue.IPushNameSetting); - public name: string; + public name?: (string|null); public static create(properties?: proto.SyncActionValue.IPushNameSetting): proto.SyncActionValue.PushNameSetting; public static encode(m: proto.SyncActionValue.IPushNameSetting, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.PushNameSetting; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.PushNameSetting; + public static toObject(m: proto.SyncActionValue.PushNameSetting, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9513,14 +10671,17 @@ export namespace proto { class QuickReplyAction implements IQuickReplyAction { constructor(p?: proto.SyncActionValue.IQuickReplyAction); - public shortcut: string; - public message: string; + public shortcut?: (string|null); + public message?: (string|null); public keywords: string[]; - public count: number; - public deleted: boolean; + public count?: (number|null); + public deleted?: (boolean|null); public static create(properties?: proto.SyncActionValue.IQuickReplyAction): proto.SyncActionValue.QuickReplyAction; public static encode(m: proto.SyncActionValue.IQuickReplyAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.QuickReplyAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.QuickReplyAction; + public static toObject(m: proto.SyncActionValue.QuickReplyAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9534,6 +10695,9 @@ export namespace proto { public static create(properties?: proto.SyncActionValue.IRecentEmojiWeightsAction): proto.SyncActionValue.RecentEmojiWeightsAction; public static encode(m: proto.SyncActionValue.IRecentEmojiWeightsAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.RecentEmojiWeightsAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.RecentEmojiWeightsAction; + public static toObject(m: proto.SyncActionValue.RecentEmojiWeightsAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9543,10 +10707,13 @@ export namespace proto { class RemoveRecentStickerAction implements IRemoveRecentStickerAction { constructor(p?: proto.SyncActionValue.IRemoveRecentStickerAction); - public lastStickerSentTs: (number|Long); + public lastStickerSentTs?: (number|Long|null); public static create(properties?: proto.SyncActionValue.IRemoveRecentStickerAction): proto.SyncActionValue.RemoveRecentStickerAction; public static encode(m: proto.SyncActionValue.IRemoveRecentStickerAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.RemoveRecentStickerAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.RemoveRecentStickerAction; + public static toObject(m: proto.SyncActionValue.RemoveRecentStickerAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9556,10 +10723,13 @@ export namespace proto { class SecurityNotificationSetting implements ISecurityNotificationSetting { constructor(p?: proto.SyncActionValue.ISecurityNotificationSetting); - public showNotification: boolean; + public showNotification?: (boolean|null); public static create(properties?: proto.SyncActionValue.ISecurityNotificationSetting): proto.SyncActionValue.SecurityNotificationSetting; public static encode(m: proto.SyncActionValue.ISecurityNotificationSetting, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.SecurityNotificationSetting; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.SecurityNotificationSetting; + public static toObject(m: proto.SyncActionValue.SecurityNotificationSetting, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9569,10 +10739,13 @@ export namespace proto { class StarAction implements IStarAction { constructor(p?: proto.SyncActionValue.IStarAction); - public starred: boolean; + public starred?: (boolean|null); public static create(properties?: proto.SyncActionValue.IStarAction): proto.SyncActionValue.StarAction; public static encode(m: proto.SyncActionValue.IStarAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.StarAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.StarAction; + public static toObject(m: proto.SyncActionValue.StarAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9583,11 +10756,14 @@ export namespace proto { class StatusPrivacyAction implements IStatusPrivacyAction { constructor(p?: proto.SyncActionValue.IStatusPrivacyAction); - public mode: proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode; + public mode?: (proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode|null); public userJid: string[]; public static create(properties?: proto.SyncActionValue.IStatusPrivacyAction): proto.SyncActionValue.StatusPrivacyAction; public static encode(m: proto.SyncActionValue.IStatusPrivacyAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.StatusPrivacyAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.StatusPrivacyAction; + public static toObject(m: proto.SyncActionValue.StatusPrivacyAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9616,20 +10792,23 @@ export namespace proto { class StickerAction implements IStickerAction { constructor(p?: proto.SyncActionValue.IStickerAction); - public url: string; - public fileEncSha256: Uint8Array; - public mediaKey: Uint8Array; - public mimetype: string; - public height: number; - public width: number; - public directPath: string; - public fileLength: (number|Long); - public isFavorite: boolean; - public deviceIdHint: number; - public isLottie: boolean; + public url?: (string|null); + public fileEncSha256?: (Uint8Array|null); + public mediaKey?: (Uint8Array|null); + public mimetype?: (string|null); + public height?: (number|null); + public width?: (number|null); + public directPath?: (string|null); + public fileLength?: (number|Long|null); + public isFavorite?: (boolean|null); + public deviceIdHint?: (number|null); + public isLottie?: (boolean|null); public static create(properties?: proto.SyncActionValue.IStickerAction): proto.SyncActionValue.StickerAction; public static encode(m: proto.SyncActionValue.IStickerAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.StickerAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.StickerAction; + public static toObject(m: proto.SyncActionValue.StickerAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9641,12 +10820,15 @@ export namespace proto { class SubscriptionAction implements ISubscriptionAction { constructor(p?: proto.SyncActionValue.ISubscriptionAction); - public isDeactivated: boolean; - public isAutoRenewing: boolean; - public expirationDate: (number|Long); + public isDeactivated?: (boolean|null); + public isAutoRenewing?: (boolean|null); + public expirationDate?: (number|Long|null); public static create(properties?: proto.SyncActionValue.ISubscriptionAction): proto.SyncActionValue.SubscriptionAction; public static encode(m: proto.SyncActionValue.ISubscriptionAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.SubscriptionAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.SubscriptionAction; + public static toObject(m: proto.SyncActionValue.SubscriptionAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9658,10 +10840,13 @@ export namespace proto { class SyncActionMessage implements ISyncActionMessage { constructor(p?: proto.SyncActionValue.ISyncActionMessage); public key?: (proto.IMessageKey|null); - public timestamp: (number|Long); + public timestamp?: (number|Long|null); public static create(properties?: proto.SyncActionValue.ISyncActionMessage): proto.SyncActionValue.SyncActionMessage; public static encode(m: proto.SyncActionValue.ISyncActionMessage, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.SyncActionMessage; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.SyncActionMessage; + public static toObject(m: proto.SyncActionValue.SyncActionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9673,12 +10858,15 @@ export namespace proto { class SyncActionMessageRange implements ISyncActionMessageRange { constructor(p?: proto.SyncActionValue.ISyncActionMessageRange); - public lastMessageTimestamp: (number|Long); - public lastSystemMessageTimestamp: (number|Long); + public lastMessageTimestamp?: (number|Long|null); + public lastSystemMessageTimestamp?: (number|Long|null); public messages: proto.SyncActionValue.ISyncActionMessage[]; public static create(properties?: proto.SyncActionValue.ISyncActionMessageRange): proto.SyncActionValue.SyncActionMessageRange; public static encode(m: proto.SyncActionValue.ISyncActionMessageRange, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.SyncActionMessageRange; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.SyncActionMessageRange; + public static toObject(m: proto.SyncActionValue.SyncActionMessageRange, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9688,10 +10876,13 @@ export namespace proto { class TimeFormatAction implements ITimeFormatAction { constructor(p?: proto.SyncActionValue.ITimeFormatAction); - public isTwentyFourHourFormatEnabled: boolean; + public isTwentyFourHourFormatEnabled?: (boolean|null); public static create(properties?: proto.SyncActionValue.ITimeFormatAction): proto.SyncActionValue.TimeFormatAction; public static encode(m: proto.SyncActionValue.ITimeFormatAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.TimeFormatAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.TimeFormatAction; + public static toObject(m: proto.SyncActionValue.TimeFormatAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9701,10 +10892,13 @@ export namespace proto { class UnarchiveChatsSetting implements IUnarchiveChatsSetting { constructor(p?: proto.SyncActionValue.IUnarchiveChatsSetting); - public unarchiveChats: boolean; + public unarchiveChats?: (boolean|null); public static create(properties?: proto.SyncActionValue.IUnarchiveChatsSetting): proto.SyncActionValue.UnarchiveChatsSetting; public static encode(m: proto.SyncActionValue.IUnarchiveChatsSetting, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.UnarchiveChatsSetting; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.UnarchiveChatsSetting; + public static toObject(m: proto.SyncActionValue.UnarchiveChatsSetting, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9714,10 +10908,13 @@ export namespace proto { class UserStatusMuteAction implements IUserStatusMuteAction { constructor(p?: proto.SyncActionValue.IUserStatusMuteAction); - public muted: boolean; + public muted?: (boolean|null); public static create(properties?: proto.SyncActionValue.IUserStatusMuteAction): proto.SyncActionValue.UserStatusMuteAction; public static encode(m: proto.SyncActionValue.IUserStatusMuteAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.UserStatusMuteAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.UserStatusMuteAction; + public static toObject(m: proto.SyncActionValue.UserStatusMuteAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9727,10 +10924,13 @@ export namespace proto { class UsernameChatStartModeAction implements IUsernameChatStartModeAction { constructor(p?: proto.SyncActionValue.IUsernameChatStartModeAction); - public chatStartMode: proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode; + public chatStartMode?: (proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode|null); public static create(properties?: proto.SyncActionValue.IUsernameChatStartModeAction): proto.SyncActionValue.UsernameChatStartModeAction; public static encode(m: proto.SyncActionValue.IUsernameChatStartModeAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.UsernameChatStartModeAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.UsernameChatStartModeAction; + public static toObject(m: proto.SyncActionValue.UsernameChatStartModeAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9748,10 +10948,13 @@ export namespace proto { class WaffleAccountLinkStateAction implements IWaffleAccountLinkStateAction { constructor(p?: proto.SyncActionValue.IWaffleAccountLinkStateAction); - public linkState: proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState; + public linkState?: (proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState|null); public static create(properties?: proto.SyncActionValue.IWaffleAccountLinkStateAction): proto.SyncActionValue.WaffleAccountLinkStateAction; public static encode(m: proto.SyncActionValue.IWaffleAccountLinkStateAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.WaffleAccountLinkStateAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.WaffleAccountLinkStateAction; + public static toObject(m: proto.SyncActionValue.WaffleAccountLinkStateAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9768,10 +10971,13 @@ export namespace proto { class WamoUserIdentifierAction implements IWamoUserIdentifierAction { constructor(p?: proto.SyncActionValue.IWamoUserIdentifierAction); - public identifier: string; + public identifier?: (string|null); public static create(properties?: proto.SyncActionValue.IWamoUserIdentifierAction): proto.SyncActionValue.WamoUserIdentifierAction; public static encode(m: proto.SyncActionValue.IWamoUserIdentifierAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncActionValue.WamoUserIdentifierAction; + public static fromObject(d: { [k: string]: any }): proto.SyncActionValue.WamoUserIdentifierAction; + public static toObject(m: proto.SyncActionValue.WamoUserIdentifierAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -9782,10 +10988,13 @@ export namespace proto { class SyncdIndex implements ISyncdIndex { constructor(p?: proto.ISyncdIndex); - public blob: Uint8Array; + public blob?: (Uint8Array|null); public static create(properties?: proto.ISyncdIndex): proto.SyncdIndex; public static encode(m: proto.ISyncdIndex, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdIndex; + public static fromObject(d: { [k: string]: any }): proto.SyncdIndex; + public static toObject(m: proto.SyncdIndex, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9796,11 +11005,14 @@ export namespace proto { class SyncdMutation implements ISyncdMutation { constructor(p?: proto.ISyncdMutation); - public operation: proto.SyncdMutation.SyncdOperation; + public operation?: (proto.SyncdMutation.SyncdOperation|null); public record?: (proto.ISyncdRecord|null); public static create(properties?: proto.ISyncdMutation): proto.SyncdMutation; public static encode(m: proto.ISyncdMutation, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdMutation; + public static fromObject(d: { [k: string]: any }): proto.SyncdMutation; + public static toObject(m: proto.SyncdMutation, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9822,6 +11034,9 @@ export namespace proto { public static create(properties?: proto.ISyncdMutations): proto.SyncdMutations; public static encode(m: proto.ISyncdMutations, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdMutations; + public static fromObject(d: { [k: string]: any }): proto.SyncdMutations; + public static toObject(m: proto.SyncdMutations, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9842,15 +11057,18 @@ export namespace proto { public version?: (proto.ISyncdVersion|null); public mutations: proto.ISyncdMutation[]; public externalMutations?: (proto.IExternalBlobReference|null); - public snapshotMac: Uint8Array; - public patchMac: Uint8Array; + public snapshotMac?: (Uint8Array|null); + public patchMac?: (Uint8Array|null); public keyId?: (proto.IKeyId|null); public exitCode?: (proto.IExitCode|null); - public deviceIndex: number; - public clientDebugData: Uint8Array; + public deviceIndex?: (number|null); + public clientDebugData?: (Uint8Array|null); public static create(properties?: proto.ISyncdPatch): proto.SyncdPatch; public static encode(m: proto.ISyncdPatch, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdPatch; + public static fromObject(d: { [k: string]: any }): proto.SyncdPatch; + public static toObject(m: proto.SyncdPatch, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9868,6 +11086,9 @@ export namespace proto { public static create(properties?: proto.ISyncdRecord): proto.SyncdRecord; public static encode(m: proto.ISyncdRecord, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdRecord; + public static fromObject(d: { [k: string]: any }): proto.SyncdRecord; + public static toObject(m: proto.SyncdRecord, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9882,11 +11103,14 @@ export namespace proto { constructor(p?: proto.ISyncdSnapshot); public version?: (proto.ISyncdVersion|null); public records: proto.ISyncdRecord[]; - public mac: Uint8Array; + public mac?: (Uint8Array|null); public keyId?: (proto.IKeyId|null); public static create(properties?: proto.ISyncdSnapshot): proto.SyncdSnapshot; public static encode(m: proto.ISyncdSnapshot, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdSnapshot; + public static fromObject(d: { [k: string]: any }): proto.SyncdSnapshot; + public static toObject(m: proto.SyncdSnapshot, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9896,10 +11120,13 @@ export namespace proto { class SyncdValue implements ISyncdValue { constructor(p?: proto.ISyncdValue); - public blob: Uint8Array; + public blob?: (Uint8Array|null); public static create(properties?: proto.ISyncdValue): proto.SyncdValue; public static encode(m: proto.ISyncdValue, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdValue; + public static fromObject(d: { [k: string]: any }): proto.SyncdValue; + public static toObject(m: proto.SyncdValue, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9909,10 +11136,13 @@ export namespace proto { class SyncdVersion implements ISyncdVersion { constructor(p?: proto.ISyncdVersion); - public version: (number|Long); + public version?: (number|Long|null); public static create(properties?: proto.ISyncdVersion): proto.SyncdVersion; public static encode(m: proto.ISyncdVersion, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SyncdVersion; + public static fromObject(d: { [k: string]: any }): proto.SyncdVersion; + public static toObject(m: proto.SyncdVersion, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9923,11 +11153,14 @@ export namespace proto { class TapLinkAction implements ITapLinkAction { constructor(p?: proto.ITapLinkAction); - public title: string; - public tapUrl: string; + public title?: (string|null); + public tapUrl?: (string|null); public static create(properties?: proto.ITapLinkAction): proto.TapLinkAction; public static encode(m: proto.ITapLinkAction, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TapLinkAction; + public static fromObject(d: { [k: string]: any }): proto.TapLinkAction; + public static toObject(m: proto.TapLinkAction, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9940,7 +11173,7 @@ export namespace proto { class TemplateButton implements ITemplateButton { constructor(p?: proto.ITemplateButton); - public index: number; + public index?: (number|null); public quickReplyButton?: (proto.TemplateButton.IQuickReplyButton|null); public urlButton?: (proto.TemplateButton.IURLButton|null); public callButton?: (proto.TemplateButton.ICallButton|null); @@ -9948,6 +11181,9 @@ export namespace proto { public static create(properties?: proto.ITemplateButton): proto.TemplateButton; public static encode(m: proto.ITemplateButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TemplateButton; + public static fromObject(d: { [k: string]: any }): proto.TemplateButton; + public static toObject(m: proto.TemplateButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9965,6 +11201,9 @@ export namespace proto { public static create(properties?: proto.TemplateButton.ICallButton): proto.TemplateButton.CallButton; public static encode(m: proto.TemplateButton.ICallButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TemplateButton.CallButton; + public static fromObject(d: { [k: string]: any }): proto.TemplateButton.CallButton; + public static toObject(m: proto.TemplateButton.CallButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9976,10 +11215,13 @@ export namespace proto { class QuickReplyButton implements IQuickReplyButton { constructor(p?: proto.TemplateButton.IQuickReplyButton); public displayText?: (proto.Message.IHighlyStructuredMessage|null); - public id: string; + public id?: (string|null); public static create(properties?: proto.TemplateButton.IQuickReplyButton): proto.TemplateButton.QuickReplyButton; public static encode(m: proto.TemplateButton.IQuickReplyButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TemplateButton.QuickReplyButton; + public static fromObject(d: { [k: string]: any }): proto.TemplateButton.QuickReplyButton; + public static toObject(m: proto.TemplateButton.QuickReplyButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -9995,6 +11237,9 @@ export namespace proto { public static create(properties?: proto.TemplateButton.IURLButton): proto.TemplateButton.URLButton; public static encode(m: proto.TemplateButton.IURLButton, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TemplateButton.URLButton; + public static fromObject(d: { [k: string]: any }): proto.TemplateButton.URLButton; + public static toObject(m: proto.TemplateButton.URLButton, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10009,6 +11254,9 @@ export namespace proto { public static create(properties?: proto.IUrlTrackingMap): proto.UrlTrackingMap; public static encode(m: proto.IUrlTrackingMap, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UrlTrackingMap; + public static fromObject(d: { [k: string]: any }): proto.UrlTrackingMap; + public static toObject(m: proto.UrlTrackingMap, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10023,13 +11271,16 @@ export namespace proto { class UrlTrackingMapElement implements IUrlTrackingMapElement { constructor(p?: proto.UrlTrackingMap.IUrlTrackingMapElement); - public originalUrl: string; - public unconsentedUsersUrl: string; - public consentedUsersUrl: string; - public cardIndex: number; + public originalUrl?: (string|null); + public unconsentedUsersUrl?: (string|null); + public consentedUsersUrl?: (string|null); + public cardIndex?: (number|null); public static create(properties?: proto.UrlTrackingMap.IUrlTrackingMapElement): proto.UrlTrackingMap.UrlTrackingMapElement; public static encode(m: proto.UrlTrackingMap.IUrlTrackingMapElement, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UrlTrackingMap.UrlTrackingMapElement; + public static fromObject(d: { [k: string]: any }): proto.UrlTrackingMap.UrlTrackingMapElement; + public static toObject(m: proto.UrlTrackingMap.UrlTrackingMapElement, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10043,13 +11294,16 @@ export namespace proto { class UserPassword implements IUserPassword { constructor(p?: proto.IUserPassword); - public encoding: proto.UserPassword.Encoding; - public transformer: proto.UserPassword.Transformer; + public encoding?: (proto.UserPassword.Encoding|null); + public transformer?: (proto.UserPassword.Transformer|null); public transformerArg: proto.UserPassword.ITransformerArg[]; - public transformedData: Uint8Array; + public transformedData?: (Uint8Array|null); public static create(properties?: proto.IUserPassword): proto.UserPassword; public static encode(m: proto.IUserPassword, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UserPassword; + public static fromObject(d: { [k: string]: any }): proto.UserPassword; + public static toObject(m: proto.UserPassword, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10073,11 +11327,14 @@ export namespace proto { class TransformerArg implements ITransformerArg { constructor(p?: proto.UserPassword.ITransformerArg); - public key: string; + public key?: (string|null); public value?: (proto.UserPassword.TransformerArg.IValue|null); public static create(properties?: proto.UserPassword.ITransformerArg): proto.UserPassword.TransformerArg; public static encode(m: proto.UserPassword.ITransformerArg, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UserPassword.TransformerArg; + public static fromObject(d: { [k: string]: any }): proto.UserPassword.TransformerArg; + public static toObject(m: proto.UserPassword.TransformerArg, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10096,13 +11353,16 @@ export namespace proto { public static create(properties?: proto.UserPassword.TransformerArg.IValue): proto.UserPassword.TransformerArg.Value; public static encode(m: proto.UserPassword.TransformerArg.IValue, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UserPassword.TransformerArg.Value; + public static fromObject(d: { [k: string]: any }): proto.UserPassword.TransformerArg.Value; + public static toObject(m: proto.UserPassword.TransformerArg.Value, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } } interface IUserReceipt { - userJid: string; + userJid?: (string|null); receiptTimestamp?: (number|Long|null); readTimestamp?: (number|Long|null); playedTimestamp?: (number|Long|null); @@ -10113,14 +11373,17 @@ export namespace proto { class UserReceipt implements IUserReceipt { constructor(p?: proto.IUserReceipt); public userJid: string; - public receiptTimestamp: (number|Long); - public readTimestamp: (number|Long); - public playedTimestamp: (number|Long); + public receiptTimestamp?: (number|Long|null); + public readTimestamp?: (number|Long|null); + public playedTimestamp?: (number|Long|null); public pendingDeviceJid: string[]; public deliveredDeviceJid: string[]; public static create(properties?: proto.IUserReceipt): proto.UserReceipt; public static encode(m: proto.IUserReceipt, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UserReceipt; + public static fromObject(d: { [k: string]: any }): proto.UserReceipt; + public static toObject(m: proto.UserReceipt, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10132,12 +11395,15 @@ export namespace proto { class VerifiedNameCertificate implements IVerifiedNameCertificate { constructor(p?: proto.IVerifiedNameCertificate); - public details: Uint8Array; - public signature: Uint8Array; - public serverSignature: Uint8Array; + public details?: (Uint8Array|null); + public signature?: (Uint8Array|null); + public serverSignature?: (Uint8Array|null); public static create(properties?: proto.IVerifiedNameCertificate): proto.VerifiedNameCertificate; public static encode(m: proto.IVerifiedNameCertificate, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.VerifiedNameCertificate; + public static fromObject(d: { [k: string]: any }): proto.VerifiedNameCertificate; + public static toObject(m: proto.VerifiedNameCertificate, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10153,14 +11419,17 @@ export namespace proto { class Details implements IDetails { constructor(p?: proto.VerifiedNameCertificate.IDetails); - public serial: (number|Long); - public issuer: string; - public verifiedName: string; + public serial?: (number|Long|null); + public issuer?: (string|null); + public verifiedName?: (string|null); public localizedNames: proto.ILocalizedName[]; - public issueTime: (number|Long); + public issueTime?: (number|Long|null); public static create(properties?: proto.VerifiedNameCertificate.IDetails): proto.VerifiedNameCertificate.Details; public static encode(m: proto.VerifiedNameCertificate.IDetails, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.VerifiedNameCertificate.Details; + public static fromObject(d: { [k: string]: any }): proto.VerifiedNameCertificate.Details; + public static toObject(m: proto.VerifiedNameCertificate.Details, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10172,11 +11441,14 @@ export namespace proto { class WallpaperSettings implements IWallpaperSettings { constructor(p?: proto.IWallpaperSettings); - public filename: string; - public opacity: number; + public filename?: (string|null); + public opacity?: (number|null); public static create(properties?: proto.IWallpaperSettings): proto.WallpaperSettings; public static encode(m: proto.IWallpaperSettings, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.WallpaperSettings; + public static fromObject(d: { [k: string]: any }): proto.WallpaperSettings; + public static toObject(m: proto.WallpaperSettings, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10230,54 +11502,57 @@ export namespace proto { class WebFeatures implements IWebFeatures { constructor(p?: proto.IWebFeatures); - public labelsDisplay: proto.WebFeatures.Flag; - public voipIndividualOutgoing: proto.WebFeatures.Flag; - public groupsV3: proto.WebFeatures.Flag; - public groupsV3Create: proto.WebFeatures.Flag; - public changeNumberV2: proto.WebFeatures.Flag; - public queryStatusV3Thumbnail: proto.WebFeatures.Flag; - public liveLocations: proto.WebFeatures.Flag; - public queryVname: proto.WebFeatures.Flag; - public voipIndividualIncoming: proto.WebFeatures.Flag; - public quickRepliesQuery: proto.WebFeatures.Flag; - public payments: proto.WebFeatures.Flag; - public stickerPackQuery: proto.WebFeatures.Flag; - public liveLocationsFinal: proto.WebFeatures.Flag; - public labelsEdit: proto.WebFeatures.Flag; - public mediaUpload: proto.WebFeatures.Flag; - public mediaUploadRichQuickReplies: proto.WebFeatures.Flag; - public vnameV2: proto.WebFeatures.Flag; - public videoPlaybackUrl: proto.WebFeatures.Flag; - public statusRanking: proto.WebFeatures.Flag; - public voipIndividualVideo: proto.WebFeatures.Flag; - public thirdPartyStickers: proto.WebFeatures.Flag; - public frequentlyForwardedSetting: proto.WebFeatures.Flag; - public groupsV4JoinPermission: proto.WebFeatures.Flag; - public recentStickers: proto.WebFeatures.Flag; - public catalog: proto.WebFeatures.Flag; - public starredStickers: proto.WebFeatures.Flag; - public voipGroupCall: proto.WebFeatures.Flag; - public templateMessage: proto.WebFeatures.Flag; - public templateMessageInteractivity: proto.WebFeatures.Flag; - public ephemeralMessages: proto.WebFeatures.Flag; - public e2ENotificationSync: proto.WebFeatures.Flag; - public recentStickersV2: proto.WebFeatures.Flag; - public recentStickersV3: proto.WebFeatures.Flag; - public userNotice: proto.WebFeatures.Flag; - public support: proto.WebFeatures.Flag; - public groupUiiCleanup: proto.WebFeatures.Flag; - public groupDogfoodingInternalOnly: proto.WebFeatures.Flag; - public settingsSync: proto.WebFeatures.Flag; - public archiveV2: proto.WebFeatures.Flag; - public ephemeralAllowGroupMembers: proto.WebFeatures.Flag; - public ephemeral24HDuration: proto.WebFeatures.Flag; - public mdForceUpgrade: proto.WebFeatures.Flag; - public disappearingMode: proto.WebFeatures.Flag; - public externalMdOptInAvailable: proto.WebFeatures.Flag; - public noDeleteMessageTimeLimit: proto.WebFeatures.Flag; + public labelsDisplay?: (proto.WebFeatures.Flag|null); + public voipIndividualOutgoing?: (proto.WebFeatures.Flag|null); + public groupsV3?: (proto.WebFeatures.Flag|null); + public groupsV3Create?: (proto.WebFeatures.Flag|null); + public changeNumberV2?: (proto.WebFeatures.Flag|null); + public queryStatusV3Thumbnail?: (proto.WebFeatures.Flag|null); + public liveLocations?: (proto.WebFeatures.Flag|null); + public queryVname?: (proto.WebFeatures.Flag|null); + public voipIndividualIncoming?: (proto.WebFeatures.Flag|null); + public quickRepliesQuery?: (proto.WebFeatures.Flag|null); + public payments?: (proto.WebFeatures.Flag|null); + public stickerPackQuery?: (proto.WebFeatures.Flag|null); + public liveLocationsFinal?: (proto.WebFeatures.Flag|null); + public labelsEdit?: (proto.WebFeatures.Flag|null); + public mediaUpload?: (proto.WebFeatures.Flag|null); + public mediaUploadRichQuickReplies?: (proto.WebFeatures.Flag|null); + public vnameV2?: (proto.WebFeatures.Flag|null); + public videoPlaybackUrl?: (proto.WebFeatures.Flag|null); + public statusRanking?: (proto.WebFeatures.Flag|null); + public voipIndividualVideo?: (proto.WebFeatures.Flag|null); + public thirdPartyStickers?: (proto.WebFeatures.Flag|null); + public frequentlyForwardedSetting?: (proto.WebFeatures.Flag|null); + public groupsV4JoinPermission?: (proto.WebFeatures.Flag|null); + public recentStickers?: (proto.WebFeatures.Flag|null); + public catalog?: (proto.WebFeatures.Flag|null); + public starredStickers?: (proto.WebFeatures.Flag|null); + public voipGroupCall?: (proto.WebFeatures.Flag|null); + public templateMessage?: (proto.WebFeatures.Flag|null); + public templateMessageInteractivity?: (proto.WebFeatures.Flag|null); + public ephemeralMessages?: (proto.WebFeatures.Flag|null); + public e2ENotificationSync?: (proto.WebFeatures.Flag|null); + public recentStickersV2?: (proto.WebFeatures.Flag|null); + public recentStickersV3?: (proto.WebFeatures.Flag|null); + public userNotice?: (proto.WebFeatures.Flag|null); + public support?: (proto.WebFeatures.Flag|null); + public groupUiiCleanup?: (proto.WebFeatures.Flag|null); + public groupDogfoodingInternalOnly?: (proto.WebFeatures.Flag|null); + public settingsSync?: (proto.WebFeatures.Flag|null); + public archiveV2?: (proto.WebFeatures.Flag|null); + public ephemeralAllowGroupMembers?: (proto.WebFeatures.Flag|null); + public ephemeral24HDuration?: (proto.WebFeatures.Flag|null); + public mdForceUpgrade?: (proto.WebFeatures.Flag|null); + public disappearingMode?: (proto.WebFeatures.Flag|null); + public externalMdOptInAvailable?: (proto.WebFeatures.Flag|null); + public noDeleteMessageTimeLimit?: (proto.WebFeatures.Flag|null); public static create(properties?: proto.IWebFeatures): proto.WebFeatures; public static encode(m: proto.IWebFeatures, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.WebFeatures; + public static fromObject(d: { [k: string]: any }): proto.WebFeatures; + public static toObject(m: proto.WebFeatures, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10292,7 +11567,7 @@ export namespace proto { } interface IWebMessageInfo { - key: proto.IMessageKey; + key?: (proto.IMessageKey|null); message?: (proto.IMessage|null); messageTimestamp?: (number|Long|null); status?: (proto.WebMessageInfo.Status|null); @@ -10358,71 +11633,74 @@ export namespace proto { class WebMessageInfo implements IWebMessageInfo { constructor(p?: proto.IWebMessageInfo); - public key: proto.IMessageKey; + public key?: (proto.IMessageKey|null); public message?: (proto.IMessage|null); - public messageTimestamp: (number|Long); - public status: proto.WebMessageInfo.Status; - public participant: string; - public messageC2STimestamp: (number|Long); - public ignore: boolean; - public starred: boolean; - public broadcast: boolean; - public pushName: string; - public mediaCiphertextSha256: Uint8Array; - public multicast: boolean; - public urlText: boolean; - public urlNumber: boolean; - public messageStubType: proto.WebMessageInfo.StubType; - public clearMedia: boolean; + public messageTimestamp?: (number|Long|null); + public status?: (proto.WebMessageInfo.Status|null); + public participant?: (string|null); + public messageC2STimestamp?: (number|Long|null); + public ignore?: (boolean|null); + public starred?: (boolean|null); + public broadcast?: (boolean|null); + public pushName?: (string|null); + public mediaCiphertextSha256?: (Uint8Array|null); + public multicast?: (boolean|null); + public urlText?: (boolean|null); + public urlNumber?: (boolean|null); + public messageStubType?: (proto.WebMessageInfo.StubType|null); + public clearMedia?: (boolean|null); public messageStubParameters: string[]; - public duration: number; + public duration?: (number|null); public labels: string[]; public paymentInfo?: (proto.IPaymentInfo|null); public finalLiveLocation?: (proto.Message.ILiveLocationMessage|null); public quotedPaymentInfo?: (proto.IPaymentInfo|null); - public ephemeralStartTimestamp: (number|Long); - public ephemeralDuration: number; - public ephemeralOffToOn: boolean; - public ephemeralOutOfSync: boolean; - public bizPrivacyStatus: proto.WebMessageInfo.BizPrivacyStatus; - public verifiedBizName: string; + public ephemeralStartTimestamp?: (number|Long|null); + public ephemeralDuration?: (number|null); + public ephemeralOffToOn?: (boolean|null); + public ephemeralOutOfSync?: (boolean|null); + public bizPrivacyStatus?: (proto.WebMessageInfo.BizPrivacyStatus|null); + public verifiedBizName?: (string|null); public mediaData?: (proto.IMediaData|null); public photoChange?: (proto.IPhotoChange|null); public userReceipt: proto.IUserReceipt[]; public reactions: proto.IReaction[]; public quotedStickerData?: (proto.IMediaData|null); - public futureproofData: Uint8Array; + public futureproofData?: (Uint8Array|null); public statusPsa?: (proto.IStatusPSA|null); public pollUpdates: proto.IPollUpdate[]; public pollAdditionalMetadata?: (proto.IPollAdditionalMetadata|null); - public agentId: string; - public statusAlreadyViewed: boolean; - public messageSecret: Uint8Array; + public agentId?: (string|null); + public statusAlreadyViewed?: (boolean|null); + public messageSecret?: (Uint8Array|null); public keepInChat?: (proto.IKeepInChat|null); - public originalSelfAuthorUserJidString: string; - public revokeMessageTimestamp: (number|Long); + public originalSelfAuthorUserJidString?: (string|null); + public revokeMessageTimestamp?: (number|Long|null); public pinInChat?: (proto.IPinInChat|null); public premiumMessageInfo?: (proto.IPremiumMessageInfo|null); - public is1PBizBotMessage: boolean; - public isGroupHistoryMessage: boolean; - public botMessageInvokerJid: string; + public is1PBizBotMessage?: (boolean|null); + public isGroupHistoryMessage?: (boolean|null); + public botMessageInvokerJid?: (string|null); public commentMetadata?: (proto.ICommentMetadata|null); public eventResponses: proto.IEventResponse[]; public reportingTokenInfo?: (proto.IReportingTokenInfo|null); - public newsletterServerId: (number|Long); + public newsletterServerId?: (number|Long|null); public eventAdditionalMetadata?: (proto.IEventAdditionalMetadata|null); - public isMentionedInStatus: boolean; + public isMentionedInStatus?: (boolean|null); public statusMentions: string[]; public targetMessageId?: (proto.IMessageKey|null); public messageAddOns: proto.IMessageAddOn[]; public statusMentionMessageInfo?: (proto.IStatusMentionMessage|null); - public isSupportAiMessage: boolean; + public isSupportAiMessage?: (boolean|null); public statusMentionSources: string[]; public supportAiCitations: proto.ICitation[]; - public botTargetId: string; + public botTargetId?: (string|null); public static create(properties?: proto.IWebMessageInfo): proto.WebMessageInfo; public static encode(m: proto.IWebMessageInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.WebMessageInfo; + public static fromObject(d: { [k: string]: any }): proto.WebMessageInfo; + public static toObject(m: proto.WebMessageInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -10676,13 +11954,16 @@ export namespace proto { class WebNotificationsInfo implements IWebNotificationsInfo { constructor(p?: proto.IWebNotificationsInfo); - public timestamp: (number|Long); - public unreadChats: number; - public notifyMessageCount: number; + public timestamp?: (number|Long|null); + public unreadChats?: (number|null); + public notifyMessageCount?: (number|null); public notifyMessages: proto.IWebMessageInfo[]; public static create(properties?: proto.IWebNotificationsInfo): proto.WebNotificationsInfo; public static encode(m: proto.IWebNotificationsInfo, w?: $protobuf.Writer): $protobuf.Writer; public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.WebNotificationsInfo; + public static fromObject(d: { [k: string]: any }): proto.WebNotificationsInfo; + public static toObject(m: proto.WebNotificationsInfo, o?: $protobuf.IConversionOptions): { [k: string]: any }; + public toJSON(): { [k: string]: any }; public static getTypeUrl(typeUrlPrefix?: string): string; } } diff --git a/WAProto/index.js b/WAProto/index.js index a14389e7..913a0a8a 100644 --- a/WAProto/index.js +++ b/WAProto/index.js @@ -18,11 +18,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ADVDeviceIdentity.prototype.rawId = 0; - ADVDeviceIdentity.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ADVDeviceIdentity.prototype.keyIndex = 0; - ADVDeviceIdentity.prototype.accountType = 0; - ADVDeviceIdentity.prototype.deviceType = 0; + ADVDeviceIdentity.prototype.rawId = null; + ADVDeviceIdentity.prototype.timestamp = null; + ADVDeviceIdentity.prototype.keyIndex = null; + ADVDeviceIdentity.prototype.accountType = null; + ADVDeviceIdentity.prototype.deviceType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVDeviceIdentity.prototype, "_rawId", { + get: $util.oneOfGetter($oneOfFields = ["rawId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVDeviceIdentity.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVDeviceIdentity.prototype, "_keyIndex", { + get: $util.oneOfGetter($oneOfFields = ["keyIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVDeviceIdentity.prototype, "_accountType", { + get: $util.oneOfGetter($oneOfFields = ["accountType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVDeviceIdentity.prototype, "_deviceType", { + get: $util.oneOfGetter($oneOfFields = ["deviceType"]), + set: $util.oneOfSetter($oneOfFields) + }); ADVDeviceIdentity.create = function create(properties) { return new ADVDeviceIdentity(properties); @@ -81,6 +113,100 @@ export const proto = $root.proto = (() => { return m; }; + ADVDeviceIdentity.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ADVDeviceIdentity) + return d; + var m = new $root.proto.ADVDeviceIdentity(); + if (d.rawId != null) { + m.rawId = d.rawId >>> 0; + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true); + } + if (d.keyIndex != null) { + m.keyIndex = d.keyIndex >>> 0; + } + switch (d.accountType) { + default: + if (typeof d.accountType === "number") { + m.accountType = d.accountType; + break; + } + break; + case "E2EE": + case 0: + m.accountType = 0; + break; + case "HOSTED": + case 1: + m.accountType = 1; + break; + } + switch (d.deviceType) { + default: + if (typeof d.deviceType === "number") { + m.deviceType = d.deviceType; + break; + } + break; + case "E2EE": + case 0: + m.deviceType = 0; + break; + case "HOSTED": + case 1: + m.deviceType = 1; + break; + } + return m; + }; + + ADVDeviceIdentity.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.rawId != null && m.hasOwnProperty("rawId")) { + d.rawId = m.rawId; + if (o.oneofs) + d._rawId = "rawId"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + if (m.keyIndex != null && m.hasOwnProperty("keyIndex")) { + d.keyIndex = m.keyIndex; + if (o.oneofs) + d._keyIndex = "keyIndex"; + } + if (m.accountType != null && m.hasOwnProperty("accountType")) { + d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType; + if (o.oneofs) + d._accountType = "accountType"; + } + if (m.deviceType != null && m.hasOwnProperty("deviceType")) { + d.deviceType = o.enums === String ? $root.proto.ADVEncryptionType[m.deviceType] === undefined ? m.deviceType : $root.proto.ADVEncryptionType[m.deviceType] : m.deviceType; + if (o.oneofs) + d._deviceType = "deviceType"; + } + return d; + }; + + ADVDeviceIdentity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ADVDeviceIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -108,11 +234,37 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ADVKeyIndexList.prototype.rawId = 0; - ADVKeyIndexList.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ADVKeyIndexList.prototype.currentIndex = 0; + ADVKeyIndexList.prototype.rawId = null; + ADVKeyIndexList.prototype.timestamp = null; + ADVKeyIndexList.prototype.currentIndex = null; ADVKeyIndexList.prototype.validIndexes = $util.emptyArray; - ADVKeyIndexList.prototype.accountType = 0; + ADVKeyIndexList.prototype.accountType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVKeyIndexList.prototype, "_rawId", { + get: $util.oneOfGetter($oneOfFields = ["rawId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVKeyIndexList.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVKeyIndexList.prototype, "_currentIndex", { + get: $util.oneOfGetter($oneOfFields = ["currentIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVKeyIndexList.prototype, "_accountType", { + get: $util.oneOfGetter($oneOfFields = ["accountType"]), + set: $util.oneOfSetter($oneOfFields) + }); ADVKeyIndexList.create = function create(properties) { return new ADVKeyIndexList(properties); @@ -182,6 +334,96 @@ export const proto = $root.proto = (() => { return m; }; + ADVKeyIndexList.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ADVKeyIndexList) + return d; + var m = new $root.proto.ADVKeyIndexList(); + if (d.rawId != null) { + m.rawId = d.rawId >>> 0; + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true); + } + if (d.currentIndex != null) { + m.currentIndex = d.currentIndex >>> 0; + } + if (d.validIndexes) { + if (!Array.isArray(d.validIndexes)) + throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected"); + m.validIndexes = []; + for (var i = 0; i < d.validIndexes.length; ++i) { + m.validIndexes[i] = d.validIndexes[i] >>> 0; + } + } + switch (d.accountType) { + default: + if (typeof d.accountType === "number") { + m.accountType = d.accountType; + break; + } + break; + case "E2EE": + case 0: + m.accountType = 0; + break; + case "HOSTED": + case 1: + m.accountType = 1; + break; + } + return m; + }; + + ADVKeyIndexList.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.validIndexes = []; + } + if (m.rawId != null && m.hasOwnProperty("rawId")) { + d.rawId = m.rawId; + if (o.oneofs) + d._rawId = "rawId"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + if (m.currentIndex != null && m.hasOwnProperty("currentIndex")) { + d.currentIndex = m.currentIndex; + if (o.oneofs) + d._currentIndex = "currentIndex"; + } + if (m.validIndexes && m.validIndexes.length) { + d.validIndexes = []; + for (var j = 0; j < m.validIndexes.length; ++j) { + d.validIndexes[j] = m.validIndexes[j]; + } + } + if (m.accountType != null && m.hasOwnProperty("accountType")) { + d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType; + if (o.oneofs) + d._accountType = "accountType"; + } + return d; + }; + + ADVKeyIndexList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ADVKeyIndexList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -201,10 +443,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ADVSignedDeviceIdentity.prototype.details = $util.newBuffer([]); - ADVSignedDeviceIdentity.prototype.accountSignatureKey = $util.newBuffer([]); - ADVSignedDeviceIdentity.prototype.accountSignature = $util.newBuffer([]); - ADVSignedDeviceIdentity.prototype.deviceSignature = $util.newBuffer([]); + ADVSignedDeviceIdentity.prototype.details = null; + ADVSignedDeviceIdentity.prototype.accountSignatureKey = null; + ADVSignedDeviceIdentity.prototype.accountSignature = null; + ADVSignedDeviceIdentity.prototype.deviceSignature = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_details", { + get: $util.oneOfGetter($oneOfFields = ["details"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_accountSignatureKey", { + get: $util.oneOfGetter($oneOfFields = ["accountSignatureKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_accountSignature", { + get: $util.oneOfGetter($oneOfFields = ["accountSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_deviceSignature", { + get: $util.oneOfGetter($oneOfFields = ["deviceSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); ADVSignedDeviceIdentity.create = function create(properties) { return new ADVSignedDeviceIdentity(properties); @@ -257,6 +525,68 @@ export const proto = $root.proto = (() => { return m; }; + ADVSignedDeviceIdentity.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ADVSignedDeviceIdentity) + return d; + var m = new $root.proto.ADVSignedDeviceIdentity(); + if (d.details != null) { + if (typeof d.details === "string") + $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); + else if (d.details.length >= 0) + m.details = d.details; + } + if (d.accountSignatureKey != null) { + if (typeof d.accountSignatureKey === "string") + $util.base64.decode(d.accountSignatureKey, m.accountSignatureKey = $util.newBuffer($util.base64.length(d.accountSignatureKey)), 0); + else if (d.accountSignatureKey.length >= 0) + m.accountSignatureKey = d.accountSignatureKey; + } + if (d.accountSignature != null) { + if (typeof d.accountSignature === "string") + $util.base64.decode(d.accountSignature, m.accountSignature = $util.newBuffer($util.base64.length(d.accountSignature)), 0); + else if (d.accountSignature.length >= 0) + m.accountSignature = d.accountSignature; + } + if (d.deviceSignature != null) { + if (typeof d.deviceSignature === "string") + $util.base64.decode(d.deviceSignature, m.deviceSignature = $util.newBuffer($util.base64.length(d.deviceSignature)), 0); + else if (d.deviceSignature.length >= 0) + m.deviceSignature = d.deviceSignature; + } + return m; + }; + + ADVSignedDeviceIdentity.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.details != null && m.hasOwnProperty("details")) { + d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; + if (o.oneofs) + d._details = "details"; + } + if (m.accountSignatureKey != null && m.hasOwnProperty("accountSignatureKey")) { + d.accountSignatureKey = o.bytes === String ? $util.base64.encode(m.accountSignatureKey, 0, m.accountSignatureKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignatureKey) : m.accountSignatureKey; + if (o.oneofs) + d._accountSignatureKey = "accountSignatureKey"; + } + if (m.accountSignature != null && m.hasOwnProperty("accountSignature")) { + d.accountSignature = o.bytes === String ? $util.base64.encode(m.accountSignature, 0, m.accountSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignature) : m.accountSignature; + if (o.oneofs) + d._accountSignature = "accountSignature"; + } + if (m.deviceSignature != null && m.hasOwnProperty("deviceSignature")) { + d.deviceSignature = o.bytes === String ? $util.base64.encode(m.deviceSignature, 0, m.deviceSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.deviceSignature) : m.deviceSignature; + if (o.oneofs) + d._deviceSignature = "deviceSignature"; + } + return d; + }; + + ADVSignedDeviceIdentity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ADVSignedDeviceIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -276,9 +606,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ADVSignedDeviceIdentityHMAC.prototype.details = $util.newBuffer([]); - ADVSignedDeviceIdentityHMAC.prototype.hmac = $util.newBuffer([]); - ADVSignedDeviceIdentityHMAC.prototype.accountType = 0; + ADVSignedDeviceIdentityHMAC.prototype.details = null; + ADVSignedDeviceIdentityHMAC.prototype.hmac = null; + ADVSignedDeviceIdentityHMAC.prototype.accountType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_details", { + get: $util.oneOfGetter($oneOfFields = ["details"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_hmac", { + get: $util.oneOfGetter($oneOfFields = ["hmac"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_accountType", { + get: $util.oneOfGetter($oneOfFields = ["accountType"]), + set: $util.oneOfSetter($oneOfFields) + }); ADVSignedDeviceIdentityHMAC.create = function create(properties) { return new ADVSignedDeviceIdentityHMAC(properties); @@ -325,6 +675,67 @@ export const proto = $root.proto = (() => { return m; }; + ADVSignedDeviceIdentityHMAC.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ADVSignedDeviceIdentityHMAC) + return d; + var m = new $root.proto.ADVSignedDeviceIdentityHMAC(); + if (d.details != null) { + if (typeof d.details === "string") + $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); + else if (d.details.length >= 0) + m.details = d.details; + } + if (d.hmac != null) { + if (typeof d.hmac === "string") + $util.base64.decode(d.hmac, m.hmac = $util.newBuffer($util.base64.length(d.hmac)), 0); + else if (d.hmac.length >= 0) + m.hmac = d.hmac; + } + switch (d.accountType) { + default: + if (typeof d.accountType === "number") { + m.accountType = d.accountType; + break; + } + break; + case "E2EE": + case 0: + m.accountType = 0; + break; + case "HOSTED": + case 1: + m.accountType = 1; + break; + } + return m; + }; + + ADVSignedDeviceIdentityHMAC.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.details != null && m.hasOwnProperty("details")) { + d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; + if (o.oneofs) + d._details = "details"; + } + if (m.hmac != null && m.hasOwnProperty("hmac")) { + d.hmac = o.bytes === String ? $util.base64.encode(m.hmac, 0, m.hmac.length) : o.bytes === Array ? Array.prototype.slice.call(m.hmac) : m.hmac; + if (o.oneofs) + d._hmac = "hmac"; + } + if (m.accountType != null && m.hasOwnProperty("accountType")) { + d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType; + if (o.oneofs) + d._accountType = "accountType"; + } + return d; + }; + + ADVSignedDeviceIdentityHMAC.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ADVSignedDeviceIdentityHMAC.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -344,9 +755,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ADVSignedKeyIndexList.prototype.details = $util.newBuffer([]); - ADVSignedKeyIndexList.prototype.accountSignature = $util.newBuffer([]); - ADVSignedKeyIndexList.prototype.accountSignatureKey = $util.newBuffer([]); + ADVSignedKeyIndexList.prototype.details = null; + ADVSignedKeyIndexList.prototype.accountSignature = null; + ADVSignedKeyIndexList.prototype.accountSignatureKey = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedKeyIndexList.prototype, "_details", { + get: $util.oneOfGetter($oneOfFields = ["details"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedKeyIndexList.prototype, "_accountSignature", { + get: $util.oneOfGetter($oneOfFields = ["accountSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ADVSignedKeyIndexList.prototype, "_accountSignatureKey", { + get: $util.oneOfGetter($oneOfFields = ["accountSignatureKey"]), + set: $util.oneOfSetter($oneOfFields) + }); ADVSignedKeyIndexList.create = function create(properties) { return new ADVSignedKeyIndexList(properties); @@ -393,6 +824,57 @@ export const proto = $root.proto = (() => { return m; }; + ADVSignedKeyIndexList.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ADVSignedKeyIndexList) + return d; + var m = new $root.proto.ADVSignedKeyIndexList(); + if (d.details != null) { + if (typeof d.details === "string") + $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); + else if (d.details.length >= 0) + m.details = d.details; + } + if (d.accountSignature != null) { + if (typeof d.accountSignature === "string") + $util.base64.decode(d.accountSignature, m.accountSignature = $util.newBuffer($util.base64.length(d.accountSignature)), 0); + else if (d.accountSignature.length >= 0) + m.accountSignature = d.accountSignature; + } + if (d.accountSignatureKey != null) { + if (typeof d.accountSignatureKey === "string") + $util.base64.decode(d.accountSignatureKey, m.accountSignatureKey = $util.newBuffer($util.base64.length(d.accountSignatureKey)), 0); + else if (d.accountSignatureKey.length >= 0) + m.accountSignatureKey = d.accountSignatureKey; + } + return m; + }; + + ADVSignedKeyIndexList.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.details != null && m.hasOwnProperty("details")) { + d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; + if (o.oneofs) + d._details = "details"; + } + if (m.accountSignature != null && m.hasOwnProperty("accountSignature")) { + d.accountSignature = o.bytes === String ? $util.base64.encode(m.accountSignature, 0, m.accountSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignature) : m.accountSignature; + if (o.oneofs) + d._accountSignature = "accountSignature"; + } + if (m.accountSignatureKey != null && m.hasOwnProperty("accountSignatureKey")) { + d.accountSignatureKey = o.bytes === String ? $util.base64.encode(m.accountSignatureKey, 0, m.accountSignatureKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignatureKey) : m.accountSignatureKey; + if (o.oneofs) + d._accountSignatureKey = "accountSignatureKey"; + } + return d; + }; + + ADVSignedKeyIndexList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ADVSignedKeyIndexList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -414,7 +896,27 @@ export const proto = $root.proto = (() => { AIQueryFanout.prototype.messageKey = null; AIQueryFanout.prototype.message = null; - AIQueryFanout.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AIQueryFanout.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIQueryFanout.prototype, "_messageKey", { + get: $util.oneOfGetter($oneOfFields = ["messageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIQueryFanout.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIQueryFanout.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); AIQueryFanout.create = function create(properties) { return new AIQueryFanout(properties); @@ -461,6 +963,62 @@ export const proto = $root.proto = (() => { return m; }; + AIQueryFanout.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIQueryFanout) + return d; + var m = new $root.proto.AIQueryFanout(); + if (d.messageKey != null) { + if (typeof d.messageKey !== "object") + throw TypeError(".proto.AIQueryFanout.messageKey: object expected"); + m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey); + } + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.AIQueryFanout.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + AIQueryFanout.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageKey != null && m.hasOwnProperty("messageKey")) { + d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o); + if (o.oneofs) + d._messageKey = "messageKey"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + AIQueryFanout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIQueryFanout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -481,10 +1039,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseMessage.prototype.messageType = 0; + AIRichResponseMessage.prototype.messageType = null; AIRichResponseMessage.prototype.submessages = $util.emptyArray; AIRichResponseMessage.prototype.unifiedResponse = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMessage.prototype, "_messageType", { + get: $util.oneOfGetter($oneOfFields = ["messageType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMessage.prototype, "_unifiedResponse", { + get: $util.oneOfGetter($oneOfFields = ["unifiedResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + AIRichResponseMessage.create = function create(properties) { return new AIRichResponseMessage(properties); }; @@ -534,6 +1106,74 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage) + return d; + var m = new $root.proto.AIRichResponseMessage(); + switch (d.messageType) { + default: + if (typeof d.messageType === "number") { + m.messageType = d.messageType; + break; + } + break; + case "AI_RICH_RESPONSE_TYPE_UNKNOWN": + case 0: + m.messageType = 0; + break; + case "AI_RICH_RESPONSE_TYPE_STANDARD": + case 1: + m.messageType = 1; + break; + } + if (d.submessages) { + if (!Array.isArray(d.submessages)) + throw TypeError(".proto.AIRichResponseMessage.submessages: array expected"); + m.submessages = []; + for (var i = 0; i < d.submessages.length; ++i) { + if (typeof d.submessages[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.submessages: object expected"); + m.submessages[i] = $root.proto.AIRichResponseMessage.AIRichResponseSubMessage.fromObject(d.submessages[i]); + } + } + if (d.unifiedResponse != null) { + if (typeof d.unifiedResponse !== "object") + throw TypeError(".proto.AIRichResponseMessage.unifiedResponse: object expected"); + m.unifiedResponse = $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse.fromObject(d.unifiedResponse); + } + return m; + }; + + AIRichResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.submessages = []; + } + if (m.messageType != null && m.hasOwnProperty("messageType")) { + d.messageType = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseMessageType[m.messageType] === undefined ? m.messageType : $root.proto.AIRichResponseMessage.AIRichResponseMessageType[m.messageType] : m.messageType; + if (o.oneofs) + d._messageType = "messageType"; + } + if (m.submessages && m.submessages.length) { + d.submessages = []; + for (var j = 0; j < m.submessages.length; ++j) { + d.submessages[j] = $root.proto.AIRichResponseMessage.AIRichResponseSubMessage.toObject(m.submessages[j], o); + } + } + if (m.unifiedResponse != null && m.hasOwnProperty("unifiedResponse")) { + d.unifiedResponse = $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse.toObject(m.unifiedResponse, o); + if (o.oneofs) + d._unifiedResponse = "unifiedResponse"; + } + return d; + }; + + AIRichResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -551,9 +1191,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseCodeMetadata.prototype.codeLanguage = ""; + AIRichResponseCodeMetadata.prototype.codeLanguage = null; AIRichResponseCodeMetadata.prototype.codeBlocks = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseCodeMetadata.prototype, "_codeLanguage", { + get: $util.oneOfGetter($oneOfFields = ["codeLanguage"]), + set: $util.oneOfSetter($oneOfFields) + }); + AIRichResponseCodeMetadata.create = function create(properties) { return new AIRichResponseCodeMetadata(properties); }; @@ -597,6 +1245,51 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseCodeMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata(); + if (d.codeLanguage != null) { + m.codeLanguage = String(d.codeLanguage); + } + if (d.codeBlocks) { + if (!Array.isArray(d.codeBlocks)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseCodeMetadata.codeBlocks: array expected"); + m.codeBlocks = []; + for (var i = 0; i < d.codeBlocks.length; ++i) { + if (typeof d.codeBlocks[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseCodeMetadata.codeBlocks: object expected"); + m.codeBlocks[i] = $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.fromObject(d.codeBlocks[i]); + } + } + return m; + }; + + AIRichResponseCodeMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.codeBlocks = []; + } + if (m.codeLanguage != null && m.hasOwnProperty("codeLanguage")) { + d.codeLanguage = m.codeLanguage; + if (o.oneofs) + d._codeLanguage = "codeLanguage"; + } + if (m.codeBlocks && m.codeBlocks.length) { + d.codeBlocks = []; + for (var j = 0; j < m.codeBlocks.length; ++j) { + d.codeBlocks[j] = $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.toObject(m.codeBlocks[j], o); + } + } + return d; + }; + + AIRichResponseCodeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseCodeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -613,8 +1306,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseCodeBlock.prototype.highlightType = 0; - AIRichResponseCodeBlock.prototype.codeContent = ""; + AIRichResponseCodeBlock.prototype.highlightType = null; + AIRichResponseCodeBlock.prototype.codeContent = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseCodeBlock.prototype, "_highlightType", { + get: $util.oneOfGetter($oneOfFields = ["highlightType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseCodeBlock.prototype, "_codeContent", { + get: $util.oneOfGetter($oneOfFields = ["codeContent"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseCodeBlock.create = function create(properties) { return new AIRichResponseCodeBlock(properties); @@ -655,6 +1362,69 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseCodeBlock.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeBlock(); + switch (d.highlightType) { + default: + if (typeof d.highlightType === "number") { + m.highlightType = d.highlightType; + break; + } + break; + case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT": + case 0: + m.highlightType = 0; + break; + case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD": + case 1: + m.highlightType = 1; + break; + case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD": + case 2: + m.highlightType = 2; + break; + case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING": + case 3: + m.highlightType = 3; + break; + case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER": + case 4: + m.highlightType = 4; + break; + case "AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT": + case 5: + m.highlightType = 5; + break; + } + if (d.codeContent != null) { + m.codeContent = String(d.codeContent); + } + return m; + }; + + AIRichResponseCodeBlock.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.highlightType != null && m.hasOwnProperty("highlightType")) { + d.highlightType = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[m.highlightType] === undefined ? m.highlightType : $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[m.highlightType] : m.highlightType; + if (o.oneofs) + d._highlightType = "highlightType"; + } + if (m.codeContent != null && m.hasOwnProperty("codeContent")) { + d.codeContent = m.codeContent; + if (o.oneofs) + d._codeContent = "codeContent"; + } + return d; + }; + + AIRichResponseCodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseCodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -690,7 +1460,15 @@ export const proto = $root.proto = (() => { } AIRichResponseContentItemsMetadata.prototype.itemsMetadata = $util.emptyArray; - AIRichResponseContentItemsMetadata.prototype.contentType = 0; + AIRichResponseContentItemsMetadata.prototype.contentType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseContentItemsMetadata.prototype, "_contentType", { + get: $util.oneOfGetter($oneOfFields = ["contentType"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseContentItemsMetadata.create = function create(properties) { return new AIRichResponseContentItemsMetadata(properties); @@ -735,6 +1513,64 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseContentItemsMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata(); + if (d.itemsMetadata) { + if (!Array.isArray(d.itemsMetadata)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.itemsMetadata: array expected"); + m.itemsMetadata = []; + for (var i = 0; i < d.itemsMetadata.length; ++i) { + if (typeof d.itemsMetadata[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.itemsMetadata: object expected"); + m.itemsMetadata[i] = $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.fromObject(d.itemsMetadata[i]); + } + } + switch (d.contentType) { + default: + if (typeof d.contentType === "number") { + m.contentType = d.contentType; + break; + } + break; + case "DEFAULT": + case 0: + m.contentType = 0; + break; + case "CAROUSEL": + case 1: + m.contentType = 1; + break; + } + return m; + }; + + AIRichResponseContentItemsMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.itemsMetadata = []; + } + if (m.itemsMetadata && m.itemsMetadata.length) { + d.itemsMetadata = []; + for (var j = 0; j < m.itemsMetadata.length; ++j) { + d.itemsMetadata[j] = $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.toObject(m.itemsMetadata[j], o); + } + } + if (m.contentType != null && m.hasOwnProperty("contentType")) { + d.contentType = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.ContentType[m.contentType] === undefined ? m.contentType : $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.ContentType[m.contentType] : m.contentType; + if (o.oneofs) + d._contentType = "contentType"; + } + return d; + }; + + AIRichResponseContentItemsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseContentItemsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -793,6 +1629,34 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseContentItemMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata(); + if (d.reelItem != null) { + if (typeof d.reelItem !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected"); + m.reelItem = $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(d.reelItem); + } + return m; + }; + + AIRichResponseContentItemMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.reelItem != null && m.hasOwnProperty("reelItem")) { + d.reelItem = $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(m.reelItem, o); + if (o.oneofs) + d.aIRichResponseContentItem = "reelItem"; + } + return d; + }; + + AIRichResponseContentItemMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseContentItemMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -812,10 +1676,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseReelItem.prototype.title = ""; - AIRichResponseReelItem.prototype.profileIconUrl = ""; - AIRichResponseReelItem.prototype.thumbnailUrl = ""; - AIRichResponseReelItem.prototype.videoUrl = ""; + AIRichResponseReelItem.prototype.title = null; + AIRichResponseReelItem.prototype.profileIconUrl = null; + AIRichResponseReelItem.prototype.thumbnailUrl = null; + AIRichResponseReelItem.prototype.videoUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseReelItem.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseReelItem.prototype, "_profileIconUrl", { + get: $util.oneOfGetter($oneOfFields = ["profileIconUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseReelItem.prototype, "_thumbnailUrl", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseReelItem.prototype, "_videoUrl", { + get: $util.oneOfGetter($oneOfFields = ["videoUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseReelItem.create = function create(properties) { return new AIRichResponseReelItem(properties); @@ -868,6 +1758,56 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseReelItem.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.profileIconUrl != null) { + m.profileIconUrl = String(d.profileIconUrl); + } + if (d.thumbnailUrl != null) { + m.thumbnailUrl = String(d.thumbnailUrl); + } + if (d.videoUrl != null) { + m.videoUrl = String(d.videoUrl); + } + return m; + }; + + AIRichResponseReelItem.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.profileIconUrl != null && m.hasOwnProperty("profileIconUrl")) { + d.profileIconUrl = m.profileIconUrl; + if (o.oneofs) + d._profileIconUrl = "profileIconUrl"; + } + if (m.thumbnailUrl != null && m.hasOwnProperty("thumbnailUrl")) { + d.thumbnailUrl = m.thumbnailUrl; + if (o.oneofs) + d._thumbnailUrl = "thumbnailUrl"; + } + if (m.videoUrl != null && m.hasOwnProperty("videoUrl")) { + d.videoUrl = m.videoUrl; + if (o.oneofs) + d._videoUrl = "videoUrl"; + } + return d; + }; + + AIRichResponseReelItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseReelItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -897,10 +1837,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseDynamicMetadata.prototype.type = 0; - AIRichResponseDynamicMetadata.prototype.version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - AIRichResponseDynamicMetadata.prototype.url = ""; - AIRichResponseDynamicMetadata.prototype.loopCount = 0; + AIRichResponseDynamicMetadata.prototype.type = null; + AIRichResponseDynamicMetadata.prototype.version = null; + AIRichResponseDynamicMetadata.prototype.url = null; + AIRichResponseDynamicMetadata.prototype.loopCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseDynamicMetadata.prototype, "_loopCount", { + get: $util.oneOfGetter($oneOfFields = ["loopCount"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseDynamicMetadata.create = function create(properties) { return new AIRichResponseDynamicMetadata(properties); @@ -953,6 +1919,83 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseDynamicMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseDynamicMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseDynamicMetadata(); + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN": + case 0: + m.type = 0; + break; + case "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE": + case 1: + m.type = 1; + break; + case "AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF": + case 2: + m.type = 2; + break; + } + if (d.version != null) { + if ($util.Long) + (m.version = $util.Long.fromValue(d.version)).unsigned = true; + else if (typeof d.version === "string") + m.version = parseInt(d.version, 10); + else if (typeof d.version === "number") + m.version = d.version; + else if (typeof d.version === "object") + m.version = new $util.LongBits(d.version.low >>> 0, d.version.high >>> 0).toNumber(true); + } + if (d.url != null) { + m.url = String(d.url); + } + if (d.loopCount != null) { + m.loopCount = d.loopCount >>> 0; + } + return m; + }; + + AIRichResponseDynamicMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[m.type] === undefined ? m.type : $root.proto.AIRichResponseMessage.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.version != null && m.hasOwnProperty("version")) { + if (typeof m.version === "number") + d.version = o.longs === String ? String(m.version) : m.version; + else + d.version = o.longs === String ? $util.Long.prototype.toString.call(m.version) : o.longs === Number ? new $util.LongBits(m.version.low >>> 0, m.version.high >>> 0).toNumber(true) : m.version; + if (o.oneofs) + d._version = "version"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.loopCount != null && m.hasOwnProperty("loopCount")) { + d.loopCount = m.loopCount; + if (o.oneofs) + d._loopCount = "loopCount"; + } + return d; + }; + + AIRichResponseDynamicMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseDynamicMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -984,6 +2027,14 @@ export const proto = $root.proto = (() => { AIRichResponseGridImageMetadata.prototype.gridImageUrl = null; AIRichResponseGridImageMetadata.prototype.imageUrls = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseGridImageMetadata.prototype, "_gridImageUrl", { + get: $util.oneOfGetter($oneOfFields = ["gridImageUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + AIRichResponseGridImageMetadata.create = function create(properties) { return new AIRichResponseGridImageMetadata(properties); }; @@ -1027,6 +2078,53 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseGridImageMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseGridImageMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseGridImageMetadata(); + if (d.gridImageUrl != null) { + if (typeof d.gridImageUrl !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseGridImageMetadata.gridImageUrl: object expected"); + m.gridImageUrl = $root.proto.AIRichResponseMessage.AIRichResponseImageURL.fromObject(d.gridImageUrl); + } + if (d.imageUrls) { + if (!Array.isArray(d.imageUrls)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseGridImageMetadata.imageUrls: array expected"); + m.imageUrls = []; + for (var i = 0; i < d.imageUrls.length; ++i) { + if (typeof d.imageUrls[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseGridImageMetadata.imageUrls: object expected"); + m.imageUrls[i] = $root.proto.AIRichResponseMessage.AIRichResponseImageURL.fromObject(d.imageUrls[i]); + } + } + return m; + }; + + AIRichResponseGridImageMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.imageUrls = []; + } + if (m.gridImageUrl != null && m.hasOwnProperty("gridImageUrl")) { + d.gridImageUrl = $root.proto.AIRichResponseMessage.AIRichResponseImageURL.toObject(m.gridImageUrl, o); + if (o.oneofs) + d._gridImageUrl = "gridImageUrl"; + } + if (m.imageUrls && m.imageUrls.length) { + d.imageUrls = []; + for (var j = 0; j < m.imageUrls.length; ++j) { + d.imageUrls[j] = $root.proto.AIRichResponseMessage.AIRichResponseImageURL.toObject(m.imageUrls[j], o); + } + } + return d; + }; + + AIRichResponseGridImageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseGridImageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1046,9 +2144,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseImageURL.prototype.imagePreviewUrl = ""; - AIRichResponseImageURL.prototype.imageHighResUrl = ""; - AIRichResponseImageURL.prototype.sourceUrl = ""; + AIRichResponseImageURL.prototype.imagePreviewUrl = null; + AIRichResponseImageURL.prototype.imageHighResUrl = null; + AIRichResponseImageURL.prototype.sourceUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseImageURL.prototype, "_imagePreviewUrl", { + get: $util.oneOfGetter($oneOfFields = ["imagePreviewUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseImageURL.prototype, "_imageHighResUrl", { + get: $util.oneOfGetter($oneOfFields = ["imageHighResUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseImageURL.prototype, "_sourceUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseImageURL.create = function create(properties) { return new AIRichResponseImageURL(properties); @@ -1095,6 +2213,48 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseImageURL.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseImageURL) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseImageURL(); + if (d.imagePreviewUrl != null) { + m.imagePreviewUrl = String(d.imagePreviewUrl); + } + if (d.imageHighResUrl != null) { + m.imageHighResUrl = String(d.imageHighResUrl); + } + if (d.sourceUrl != null) { + m.sourceUrl = String(d.sourceUrl); + } + return m; + }; + + AIRichResponseImageURL.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.imagePreviewUrl != null && m.hasOwnProperty("imagePreviewUrl")) { + d.imagePreviewUrl = m.imagePreviewUrl; + if (o.oneofs) + d._imagePreviewUrl = "imagePreviewUrl"; + } + if (m.imageHighResUrl != null && m.hasOwnProperty("imageHighResUrl")) { + d.imageHighResUrl = m.imageHighResUrl; + if (o.oneofs) + d._imageHighResUrl = "imageHighResUrl"; + } + if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) { + d.sourceUrl = m.sourceUrl; + if (o.oneofs) + d._sourceUrl = "sourceUrl"; + } + return d; + }; + + AIRichResponseImageURL.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseImageURL.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1115,9 +2275,35 @@ export const proto = $root.proto = (() => { } AIRichResponseInlineImageMetadata.prototype.imageUrl = null; - AIRichResponseInlineImageMetadata.prototype.imageText = ""; - AIRichResponseInlineImageMetadata.prototype.alignment = 0; - AIRichResponseInlineImageMetadata.prototype.tapLinkUrl = ""; + AIRichResponseInlineImageMetadata.prototype.imageText = null; + AIRichResponseInlineImageMetadata.prototype.alignment = null; + AIRichResponseInlineImageMetadata.prototype.tapLinkUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_imageUrl", { + get: $util.oneOfGetter($oneOfFields = ["imageUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_imageText", { + get: $util.oneOfGetter($oneOfFields = ["imageText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_alignment", { + get: $util.oneOfGetter($oneOfFields = ["alignment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseInlineImageMetadata.prototype, "_tapLinkUrl", { + get: $util.oneOfGetter($oneOfFields = ["tapLinkUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseInlineImageMetadata.create = function create(properties) { return new AIRichResponseInlineImageMetadata(properties); @@ -1170,6 +2356,75 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseInlineImageMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata(); + if (d.imageUrl != null) { + if (typeof d.imageUrl !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.imageUrl: object expected"); + m.imageUrl = $root.proto.AIRichResponseMessage.AIRichResponseImageURL.fromObject(d.imageUrl); + } + if (d.imageText != null) { + m.imageText = String(d.imageText); + } + switch (d.alignment) { + default: + if (typeof d.alignment === "number") { + m.alignment = d.alignment; + break; + } + break; + case "AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED": + case 0: + m.alignment = 0; + break; + case "AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED": + case 1: + m.alignment = 1; + break; + case "AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED": + case 2: + m.alignment = 2; + break; + } + if (d.tapLinkUrl != null) { + m.tapLinkUrl = String(d.tapLinkUrl); + } + return m; + }; + + AIRichResponseInlineImageMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.imageUrl != null && m.hasOwnProperty("imageUrl")) { + d.imageUrl = $root.proto.AIRichResponseMessage.AIRichResponseImageURL.toObject(m.imageUrl, o); + if (o.oneofs) + d._imageUrl = "imageUrl"; + } + if (m.imageText != null && m.hasOwnProperty("imageText")) { + d.imageText = m.imageText; + if (o.oneofs) + d._imageText = "imageText"; + } + if (m.alignment != null && m.hasOwnProperty("alignment")) { + d.alignment = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[m.alignment] === undefined ? m.alignment : $root.proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[m.alignment] : m.alignment; + if (o.oneofs) + d._alignment = "alignment"; + } + if (m.tapLinkUrl != null && m.hasOwnProperty("tapLinkUrl")) { + d.tapLinkUrl = m.tapLinkUrl; + if (o.oneofs) + d._tapLinkUrl = "tapLinkUrl"; + } + return d; + }; + + AIRichResponseInlineImageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseInlineImageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1198,9 +2453,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseLatexMetadata.prototype.text = ""; + AIRichResponseLatexMetadata.prototype.text = null; AIRichResponseLatexMetadata.prototype.expressions = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexMetadata.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + AIRichResponseLatexMetadata.create = function create(properties) { return new AIRichResponseLatexMetadata(properties); }; @@ -1244,6 +2507,51 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseLatexMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata(); + if (d.text != null) { + m.text = String(d.text); + } + if (d.expressions) { + if (!Array.isArray(d.expressions)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseLatexMetadata.expressions: array expected"); + m.expressions = []; + for (var i = 0; i < d.expressions.length; ++i) { + if (typeof d.expressions[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseLatexMetadata.expressions: object expected"); + m.expressions[i] = $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.fromObject(d.expressions[i]); + } + } + return m; + }; + + AIRichResponseLatexMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.expressions = []; + } + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.expressions && m.expressions.length) { + d.expressions = []; + for (var j = 0; j < m.expressions.length; ++j) { + d.expressions[j] = $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.toObject(m.expressions[j], o); + } + } + return d; + }; + + AIRichResponseLatexMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseLatexMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1260,15 +2568,71 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseLatexExpression.prototype.latexExpression = ""; - AIRichResponseLatexExpression.prototype.url = ""; - AIRichResponseLatexExpression.prototype.width = 0; - AIRichResponseLatexExpression.prototype.height = 0; - AIRichResponseLatexExpression.prototype.fontHeight = 0; - AIRichResponseLatexExpression.prototype.imageTopPadding = 0; - AIRichResponseLatexExpression.prototype.imageLeadingPadding = 0; - AIRichResponseLatexExpression.prototype.imageBottomPadding = 0; - AIRichResponseLatexExpression.prototype.imageTrailingPadding = 0; + AIRichResponseLatexExpression.prototype.latexExpression = null; + AIRichResponseLatexExpression.prototype.url = null; + AIRichResponseLatexExpression.prototype.width = null; + AIRichResponseLatexExpression.prototype.height = null; + AIRichResponseLatexExpression.prototype.fontHeight = null; + AIRichResponseLatexExpression.prototype.imageTopPadding = null; + AIRichResponseLatexExpression.prototype.imageLeadingPadding = null; + AIRichResponseLatexExpression.prototype.imageBottomPadding = null; + AIRichResponseLatexExpression.prototype.imageTrailingPadding = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_latexExpression", { + get: $util.oneOfGetter($oneOfFields = ["latexExpression"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_fontHeight", { + get: $util.oneOfGetter($oneOfFields = ["fontHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageTopPadding", { + get: $util.oneOfGetter($oneOfFields = ["imageTopPadding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageLeadingPadding", { + get: $util.oneOfGetter($oneOfFields = ["imageLeadingPadding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageBottomPadding", { + get: $util.oneOfGetter($oneOfFields = ["imageBottomPadding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseLatexExpression.prototype, "_imageTrailingPadding", { + get: $util.oneOfGetter($oneOfFields = ["imageTrailingPadding"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseLatexExpression.create = function create(properties) { return new AIRichResponseLatexExpression(properties); @@ -1351,6 +2715,96 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseLatexExpression.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata.AIRichResponseLatexExpression(); + if (d.latexExpression != null) { + m.latexExpression = String(d.latexExpression); + } + if (d.url != null) { + m.url = String(d.url); + } + if (d.width != null) { + m.width = Number(d.width); + } + if (d.height != null) { + m.height = Number(d.height); + } + if (d.fontHeight != null) { + m.fontHeight = Number(d.fontHeight); + } + if (d.imageTopPadding != null) { + m.imageTopPadding = Number(d.imageTopPadding); + } + if (d.imageLeadingPadding != null) { + m.imageLeadingPadding = Number(d.imageLeadingPadding); + } + if (d.imageBottomPadding != null) { + m.imageBottomPadding = Number(d.imageBottomPadding); + } + if (d.imageTrailingPadding != null) { + m.imageTrailingPadding = Number(d.imageTrailingPadding); + } + return m; + }; + + AIRichResponseLatexExpression.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.latexExpression != null && m.hasOwnProperty("latexExpression")) { + d.latexExpression = m.latexExpression; + if (o.oneofs) + d._latexExpression = "latexExpression"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = o.json && !isFinite(m.width) ? String(m.width) : m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = o.json && !isFinite(m.height) ? String(m.height) : m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.fontHeight != null && m.hasOwnProperty("fontHeight")) { + d.fontHeight = o.json && !isFinite(m.fontHeight) ? String(m.fontHeight) : m.fontHeight; + if (o.oneofs) + d._fontHeight = "fontHeight"; + } + if (m.imageTopPadding != null && m.hasOwnProperty("imageTopPadding")) { + d.imageTopPadding = o.json && !isFinite(m.imageTopPadding) ? String(m.imageTopPadding) : m.imageTopPadding; + if (o.oneofs) + d._imageTopPadding = "imageTopPadding"; + } + if (m.imageLeadingPadding != null && m.hasOwnProperty("imageLeadingPadding")) { + d.imageLeadingPadding = o.json && !isFinite(m.imageLeadingPadding) ? String(m.imageLeadingPadding) : m.imageLeadingPadding; + if (o.oneofs) + d._imageLeadingPadding = "imageLeadingPadding"; + } + if (m.imageBottomPadding != null && m.hasOwnProperty("imageBottomPadding")) { + d.imageBottomPadding = o.json && !isFinite(m.imageBottomPadding) ? String(m.imageBottomPadding) : m.imageBottomPadding; + if (o.oneofs) + d._imageBottomPadding = "imageBottomPadding"; + } + if (m.imageTrailingPadding != null && m.hasOwnProperty("imageTrailingPadding")) { + d.imageTrailingPadding = o.json && !isFinite(m.imageTrailingPadding) ? String(m.imageTrailingPadding) : m.imageTrailingPadding; + if (o.oneofs) + d._imageTrailingPadding = "imageTrailingPadding"; + } + return d; + }; + + AIRichResponseLatexExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseLatexExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1374,12 +2828,44 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseMapMetadata.prototype.centerLatitude = 0; - AIRichResponseMapMetadata.prototype.centerLongitude = 0; - AIRichResponseMapMetadata.prototype.latitudeDelta = 0; - AIRichResponseMapMetadata.prototype.longitudeDelta = 0; + AIRichResponseMapMetadata.prototype.centerLatitude = null; + AIRichResponseMapMetadata.prototype.centerLongitude = null; + AIRichResponseMapMetadata.prototype.latitudeDelta = null; + AIRichResponseMapMetadata.prototype.longitudeDelta = null; AIRichResponseMapMetadata.prototype.annotations = $util.emptyArray; - AIRichResponseMapMetadata.prototype.showInfoList = false; + AIRichResponseMapMetadata.prototype.showInfoList = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapMetadata.prototype, "_centerLatitude", { + get: $util.oneOfGetter($oneOfFields = ["centerLatitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapMetadata.prototype, "_centerLongitude", { + get: $util.oneOfGetter($oneOfFields = ["centerLongitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapMetadata.prototype, "_latitudeDelta", { + get: $util.oneOfGetter($oneOfFields = ["latitudeDelta"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapMetadata.prototype, "_longitudeDelta", { + get: $util.oneOfGetter($oneOfFields = ["longitudeDelta"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapMetadata.prototype, "_showInfoList", { + get: $util.oneOfGetter($oneOfFields = ["showInfoList"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseMapMetadata.create = function create(properties) { return new AIRichResponseMapMetadata(properties); @@ -1448,6 +2934,83 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseMapMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata(); + if (d.centerLatitude != null) { + m.centerLatitude = Number(d.centerLatitude); + } + if (d.centerLongitude != null) { + m.centerLongitude = Number(d.centerLongitude); + } + if (d.latitudeDelta != null) { + m.latitudeDelta = Number(d.latitudeDelta); + } + if (d.longitudeDelta != null) { + m.longitudeDelta = Number(d.longitudeDelta); + } + if (d.annotations) { + if (!Array.isArray(d.annotations)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseMapMetadata.annotations: array expected"); + m.annotations = []; + for (var i = 0; i < d.annotations.length; ++i) { + if (typeof d.annotations[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseMapMetadata.annotations: object expected"); + m.annotations[i] = $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.fromObject(d.annotations[i]); + } + } + if (d.showInfoList != null) { + m.showInfoList = Boolean(d.showInfoList); + } + return m; + }; + + AIRichResponseMapMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.annotations = []; + } + if (m.centerLatitude != null && m.hasOwnProperty("centerLatitude")) { + d.centerLatitude = o.json && !isFinite(m.centerLatitude) ? String(m.centerLatitude) : m.centerLatitude; + if (o.oneofs) + d._centerLatitude = "centerLatitude"; + } + if (m.centerLongitude != null && m.hasOwnProperty("centerLongitude")) { + d.centerLongitude = o.json && !isFinite(m.centerLongitude) ? String(m.centerLongitude) : m.centerLongitude; + if (o.oneofs) + d._centerLongitude = "centerLongitude"; + } + if (m.latitudeDelta != null && m.hasOwnProperty("latitudeDelta")) { + d.latitudeDelta = o.json && !isFinite(m.latitudeDelta) ? String(m.latitudeDelta) : m.latitudeDelta; + if (o.oneofs) + d._latitudeDelta = "latitudeDelta"; + } + if (m.longitudeDelta != null && m.hasOwnProperty("longitudeDelta")) { + d.longitudeDelta = o.json && !isFinite(m.longitudeDelta) ? String(m.longitudeDelta) : m.longitudeDelta; + if (o.oneofs) + d._longitudeDelta = "longitudeDelta"; + } + if (m.annotations && m.annotations.length) { + d.annotations = []; + for (var j = 0; j < m.annotations.length; ++j) { + d.annotations[j] = $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.toObject(m.annotations[j], o); + } + } + if (m.showInfoList != null && m.hasOwnProperty("showInfoList")) { + d.showInfoList = m.showInfoList; + if (o.oneofs) + d._showInfoList = "showInfoList"; + } + return d; + }; + + AIRichResponseMapMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseMapMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1464,11 +3027,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseMapAnnotation.prototype.annotationNumber = 0; - AIRichResponseMapAnnotation.prototype.latitude = 0; - AIRichResponseMapAnnotation.prototype.longitude = 0; - AIRichResponseMapAnnotation.prototype.title = ""; - AIRichResponseMapAnnotation.prototype.body = ""; + AIRichResponseMapAnnotation.prototype.annotationNumber = null; + AIRichResponseMapAnnotation.prototype.latitude = null; + AIRichResponseMapAnnotation.prototype.longitude = null; + AIRichResponseMapAnnotation.prototype.title = null; + AIRichResponseMapAnnotation.prototype.body = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_annotationNumber", { + get: $util.oneOfGetter($oneOfFields = ["annotationNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_latitude", { + get: $util.oneOfGetter($oneOfFields = ["latitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_longitude", { + get: $util.oneOfGetter($oneOfFields = ["longitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseMapAnnotation.prototype, "_body", { + get: $util.oneOfGetter($oneOfFields = ["body"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseMapAnnotation.create = function create(properties) { return new AIRichResponseMapAnnotation(properties); @@ -1527,6 +3122,64 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseMapAnnotation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata.AIRichResponseMapAnnotation(); + if (d.annotationNumber != null) { + m.annotationNumber = d.annotationNumber >>> 0; + } + if (d.latitude != null) { + m.latitude = Number(d.latitude); + } + if (d.longitude != null) { + m.longitude = Number(d.longitude); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.body != null) { + m.body = String(d.body); + } + return m; + }; + + AIRichResponseMapAnnotation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.annotationNumber != null && m.hasOwnProperty("annotationNumber")) { + d.annotationNumber = m.annotationNumber; + if (o.oneofs) + d._annotationNumber = "annotationNumber"; + } + if (m.latitude != null && m.hasOwnProperty("latitude")) { + d.latitude = o.json && !isFinite(m.latitude) ? String(m.latitude) : m.latitude; + if (o.oneofs) + d._latitude = "latitude"; + } + if (m.longitude != null && m.hasOwnProperty("longitude")) { + d.longitude = o.json && !isFinite(m.longitude) ? String(m.longitude) : m.longitude; + if (o.oneofs) + d._longitude = "longitude"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.body != null && m.hasOwnProperty("body")) { + d.body = m.body; + if (o.oneofs) + d._body = "body"; + } + return d; + }; + + AIRichResponseMapAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseMapAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1556,9 +3209,9 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseSubMessage.prototype.messageType = 0; + AIRichResponseSubMessage.prototype.messageType = null; AIRichResponseSubMessage.prototype.gridImageMetadata = null; - AIRichResponseSubMessage.prototype.messageText = ""; + AIRichResponseSubMessage.prototype.messageText = null; AIRichResponseSubMessage.prototype.imageMetadata = null; AIRichResponseSubMessage.prototype.codeMetadata = null; AIRichResponseSubMessage.prototype.tableMetadata = null; @@ -1567,6 +3220,68 @@ export const proto = $root.proto = (() => { AIRichResponseSubMessage.prototype.mapMetadata = null; AIRichResponseSubMessage.prototype.contentItemsMetadata = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_messageType", { + get: $util.oneOfGetter($oneOfFields = ["messageType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_gridImageMetadata", { + get: $util.oneOfGetter($oneOfFields = ["gridImageMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_messageText", { + get: $util.oneOfGetter($oneOfFields = ["messageText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_imageMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imageMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_codeMetadata", { + get: $util.oneOfGetter($oneOfFields = ["codeMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_tableMetadata", { + get: $util.oneOfGetter($oneOfFields = ["tableMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_dynamicMetadata", { + get: $util.oneOfGetter($oneOfFields = ["dynamicMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_latexMetadata", { + get: $util.oneOfGetter($oneOfFields = ["latexMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_mapMetadata", { + get: $util.oneOfGetter($oneOfFields = ["mapMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseSubMessage.prototype, "_contentItemsMetadata", { + get: $util.oneOfGetter($oneOfFields = ["contentItemsMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + AIRichResponseSubMessage.create = function create(properties) { return new AIRichResponseSubMessage(properties); }; @@ -1654,6 +3369,165 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseSubMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseSubMessage) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseSubMessage(); + switch (d.messageType) { + default: + if (typeof d.messageType === "number") { + m.messageType = d.messageType; + break; + } + break; + case "AI_RICH_RESPONSE_UNKNOWN": + case 0: + m.messageType = 0; + break; + case "AI_RICH_RESPONSE_GRID_IMAGE": + case 1: + m.messageType = 1; + break; + case "AI_RICH_RESPONSE_TEXT": + case 2: + m.messageType = 2; + break; + case "AI_RICH_RESPONSE_INLINE_IMAGE": + case 3: + m.messageType = 3; + break; + case "AI_RICH_RESPONSE_TABLE": + case 4: + m.messageType = 4; + break; + case "AI_RICH_RESPONSE_CODE": + case 5: + m.messageType = 5; + break; + case "AI_RICH_RESPONSE_DYNAMIC": + case 6: + m.messageType = 6; + break; + case "AI_RICH_RESPONSE_MAP": + case 7: + m.messageType = 7; + break; + case "AI_RICH_RESPONSE_LATEX": + case 8: + m.messageType = 8; + break; + case "AI_RICH_RESPONSE_CONTENT_ITEMS": + case 9: + m.messageType = 9; + break; + } + if (d.gridImageMetadata != null) { + if (typeof d.gridImageMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.gridImageMetadata: object expected"); + m.gridImageMetadata = $root.proto.AIRichResponseMessage.AIRichResponseGridImageMetadata.fromObject(d.gridImageMetadata); + } + if (d.messageText != null) { + m.messageText = String(d.messageText); + } + if (d.imageMetadata != null) { + if (typeof d.imageMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.imageMetadata: object expected"); + m.imageMetadata = $root.proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.fromObject(d.imageMetadata); + } + if (d.codeMetadata != null) { + if (typeof d.codeMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.codeMetadata: object expected"); + m.codeMetadata = $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.fromObject(d.codeMetadata); + } + if (d.tableMetadata != null) { + if (typeof d.tableMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.tableMetadata: object expected"); + m.tableMetadata = $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata.fromObject(d.tableMetadata); + } + if (d.dynamicMetadata != null) { + if (typeof d.dynamicMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.dynamicMetadata: object expected"); + m.dynamicMetadata = $root.proto.AIRichResponseMessage.AIRichResponseDynamicMetadata.fromObject(d.dynamicMetadata); + } + if (d.latexMetadata != null) { + if (typeof d.latexMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.latexMetadata: object expected"); + m.latexMetadata = $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata.fromObject(d.latexMetadata); + } + if (d.mapMetadata != null) { + if (typeof d.mapMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.mapMetadata: object expected"); + m.mapMetadata = $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata.fromObject(d.mapMetadata); + } + if (d.contentItemsMetadata != null) { + if (typeof d.contentItemsMetadata !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseSubMessage.contentItemsMetadata: object expected"); + m.contentItemsMetadata = $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.fromObject(d.contentItemsMetadata); + } + return m; + }; + + AIRichResponseSubMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageType != null && m.hasOwnProperty("messageType")) { + d.messageType = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseSubMessageType[m.messageType] === undefined ? m.messageType : $root.proto.AIRichResponseMessage.AIRichResponseSubMessageType[m.messageType] : m.messageType; + if (o.oneofs) + d._messageType = "messageType"; + } + if (m.gridImageMetadata != null && m.hasOwnProperty("gridImageMetadata")) { + d.gridImageMetadata = $root.proto.AIRichResponseMessage.AIRichResponseGridImageMetadata.toObject(m.gridImageMetadata, o); + if (o.oneofs) + d._gridImageMetadata = "gridImageMetadata"; + } + if (m.messageText != null && m.hasOwnProperty("messageText")) { + d.messageText = m.messageText; + if (o.oneofs) + d._messageText = "messageText"; + } + if (m.imageMetadata != null && m.hasOwnProperty("imageMetadata")) { + d.imageMetadata = $root.proto.AIRichResponseMessage.AIRichResponseInlineImageMetadata.toObject(m.imageMetadata, o); + if (o.oneofs) + d._imageMetadata = "imageMetadata"; + } + if (m.codeMetadata != null && m.hasOwnProperty("codeMetadata")) { + d.codeMetadata = $root.proto.AIRichResponseMessage.AIRichResponseCodeMetadata.toObject(m.codeMetadata, o); + if (o.oneofs) + d._codeMetadata = "codeMetadata"; + } + if (m.tableMetadata != null && m.hasOwnProperty("tableMetadata")) { + d.tableMetadata = $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata.toObject(m.tableMetadata, o); + if (o.oneofs) + d._tableMetadata = "tableMetadata"; + } + if (m.dynamicMetadata != null && m.hasOwnProperty("dynamicMetadata")) { + d.dynamicMetadata = $root.proto.AIRichResponseMessage.AIRichResponseDynamicMetadata.toObject(m.dynamicMetadata, o); + if (o.oneofs) + d._dynamicMetadata = "dynamicMetadata"; + } + if (m.latexMetadata != null && m.hasOwnProperty("latexMetadata")) { + d.latexMetadata = $root.proto.AIRichResponseMessage.AIRichResponseLatexMetadata.toObject(m.latexMetadata, o); + if (o.oneofs) + d._latexMetadata = "latexMetadata"; + } + if (m.mapMetadata != null && m.hasOwnProperty("mapMetadata")) { + d.mapMetadata = $root.proto.AIRichResponseMessage.AIRichResponseMapMetadata.toObject(m.mapMetadata, o); + if (o.oneofs) + d._mapMetadata = "mapMetadata"; + } + if (m.contentItemsMetadata != null && m.hasOwnProperty("contentItemsMetadata")) { + d.contentItemsMetadata = $root.proto.AIRichResponseMessage.AIRichResponseContentItemsMetadata.toObject(m.contentItemsMetadata, o); + if (o.oneofs) + d._contentItemsMetadata = "contentItemsMetadata"; + } + return d; + }; + + AIRichResponseSubMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseSubMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1728,6 +3602,43 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseTableMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata(); + if (d.rows) { + if (!Array.isArray(d.rows)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseTableMetadata.rows: array expected"); + m.rows = []; + for (var i = 0; i < d.rows.length; ++i) { + if (typeof d.rows[i] !== "object") + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseTableMetadata.rows: object expected"); + m.rows[i] = $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow.fromObject(d.rows[i]); + } + } + return m; + }; + + AIRichResponseTableMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.rows = []; + } + if (m.rows && m.rows.length) { + d.rows = []; + for (var j = 0; j < m.rows.length; ++j) { + d.rows[j] = $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow.toObject(m.rows[j], o); + } + } + return d; + }; + + AIRichResponseTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1746,7 +3657,15 @@ export const proto = $root.proto = (() => { } AIRichResponseTableRow.prototype.items = $util.emptyArray; - AIRichResponseTableRow.prototype.isHeading = false; + AIRichResponseTableRow.prototype.isHeading = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseTableRow.prototype, "_isHeading", { + get: $util.oneOfGetter($oneOfFields = ["isHeading"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseTableRow.create = function create(properties) { return new AIRichResponseTableRow(properties); @@ -1791,6 +3710,49 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseTableRow.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow(); + if (d.items) { + if (!Array.isArray(d.items)) + throw TypeError(".proto.AIRichResponseMessage.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected"); + m.items = []; + for (var i = 0; i < d.items.length; ++i) { + m.items[i] = String(d.items[i]); + } + } + if (d.isHeading != null) { + m.isHeading = Boolean(d.isHeading); + } + return m; + }; + + AIRichResponseTableRow.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.items = []; + } + if (m.items && m.items.length) { + d.items = []; + for (var j = 0; j < m.items.length; ++j) { + d.items[j] = m.items[j]; + } + } + if (m.isHeading != null && m.hasOwnProperty("isHeading")) { + d.isHeading = m.isHeading; + if (o.oneofs) + d._isHeading = "isHeading"; + } + return d; + }; + + AIRichResponseTableRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseTableRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1813,7 +3775,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AIRichResponseUnifiedResponse.prototype.data = $util.newBuffer([]); + AIRichResponseUnifiedResponse.prototype.data = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AIRichResponseUnifiedResponse.prototype, "_data", { + get: $util.oneOfGetter($oneOfFields = ["data"]), + set: $util.oneOfSetter($oneOfFields) + }); AIRichResponseUnifiedResponse.create = function create(properties) { return new AIRichResponseUnifiedResponse(properties); @@ -1848,6 +3818,35 @@ export const proto = $root.proto = (() => { return m; }; + AIRichResponseUnifiedResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse) + return d; + var m = new $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse(); + if (d.data != null) { + if (typeof d.data === "string") + $util.base64.decode(d.data, m.data = $util.newBuffer($util.base64.length(d.data)), 0); + else if (d.data.length >= 0) + m.data = d.data; + } + return m; + }; + + AIRichResponseUnifiedResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.data != null && m.hasOwnProperty("data")) { + d.data = o.bytes === String ? $util.base64.encode(m.data, 0, m.data.length) : o.bytes === Array ? Array.prototype.slice.call(m.data) : m.data; + if (o.oneofs) + d._data = "data"; + } + return d; + }; + + AIRichResponseUnifiedResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AIRichResponseUnifiedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1870,10 +3869,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Account.prototype.lid = ""; - Account.prototype.username = ""; - Account.prototype.countryCode = ""; - Account.prototype.isUsernameDeleted = false; + Account.prototype.lid = null; + Account.prototype.username = null; + Account.prototype.countryCode = null; + Account.prototype.isUsernameDeleted = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Account.prototype, "_lid", { + get: $util.oneOfGetter($oneOfFields = ["lid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Account.prototype, "_username", { + get: $util.oneOfGetter($oneOfFields = ["username"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Account.prototype, "_countryCode", { + get: $util.oneOfGetter($oneOfFields = ["countryCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Account.prototype, "_isUsernameDeleted", { + get: $util.oneOfGetter($oneOfFields = ["isUsernameDeleted"]), + set: $util.oneOfSetter($oneOfFields) + }); Account.create = function create(properties) { return new Account(properties); @@ -1926,6 +3951,56 @@ export const proto = $root.proto = (() => { return m; }; + Account.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Account) + return d; + var m = new $root.proto.Account(); + if (d.lid != null) { + m.lid = String(d.lid); + } + if (d.username != null) { + m.username = String(d.username); + } + if (d.countryCode != null) { + m.countryCode = String(d.countryCode); + } + if (d.isUsernameDeleted != null) { + m.isUsernameDeleted = Boolean(d.isUsernameDeleted); + } + return m; + }; + + Account.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.lid != null && m.hasOwnProperty("lid")) { + d.lid = m.lid; + if (o.oneofs) + d._lid = "lid"; + } + if (m.username != null && m.hasOwnProperty("username")) { + d.username = m.username; + if (o.oneofs) + d._username = "username"; + } + if (m.countryCode != null && m.hasOwnProperty("countryCode")) { + d.countryCode = m.countryCode; + if (o.oneofs) + d._countryCode = "countryCode"; + } + if (m.isUsernameDeleted != null && m.hasOwnProperty("isUsernameDeleted")) { + d.isUsernameDeleted = m.isUsernameDeleted; + if (o.oneofs) + d._isUsernameDeleted = "isUsernameDeleted"; + } + return d; + }; + + Account.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Account.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -1945,8 +4020,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ActionLink.prototype.url = ""; - ActionLink.prototype.buttonTitle = ""; + ActionLink.prototype.url = null; + ActionLink.prototype.buttonTitle = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActionLink.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActionLink.prototype, "_buttonTitle", { + get: $util.oneOfGetter($oneOfFields = ["buttonTitle"]), + set: $util.oneOfSetter($oneOfFields) + }); ActionLink.create = function create(properties) { return new ActionLink(properties); @@ -1987,6 +4076,40 @@ export const proto = $root.proto = (() => { return m; }; + ActionLink.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ActionLink) + return d; + var m = new $root.proto.ActionLink(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.buttonTitle != null) { + m.buttonTitle = String(d.buttonTitle); + } + return m; + }; + + ActionLink.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.buttonTitle != null && m.hasOwnProperty("buttonTitle")) { + d.buttonTitle = m.buttonTitle; + if (o.oneofs) + d._buttonTitle = "buttonTitle"; + } + return d; + }; + + ActionLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ActionLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2006,10 +4129,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AutoDownloadSettings.prototype.downloadImages = false; - AutoDownloadSettings.prototype.downloadAudio = false; - AutoDownloadSettings.prototype.downloadVideo = false; - AutoDownloadSettings.prototype.downloadDocuments = false; + AutoDownloadSettings.prototype.downloadImages = null; + AutoDownloadSettings.prototype.downloadAudio = null; + AutoDownloadSettings.prototype.downloadVideo = null; + AutoDownloadSettings.prototype.downloadDocuments = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutoDownloadSettings.prototype, "_downloadImages", { + get: $util.oneOfGetter($oneOfFields = ["downloadImages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutoDownloadSettings.prototype, "_downloadAudio", { + get: $util.oneOfGetter($oneOfFields = ["downloadAudio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutoDownloadSettings.prototype, "_downloadVideo", { + get: $util.oneOfGetter($oneOfFields = ["downloadVideo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutoDownloadSettings.prototype, "_downloadDocuments", { + get: $util.oneOfGetter($oneOfFields = ["downloadDocuments"]), + set: $util.oneOfSetter($oneOfFields) + }); AutoDownloadSettings.create = function create(properties) { return new AutoDownloadSettings(properties); @@ -2062,6 +4211,56 @@ export const proto = $root.proto = (() => { return m; }; + AutoDownloadSettings.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AutoDownloadSettings) + return d; + var m = new $root.proto.AutoDownloadSettings(); + if (d.downloadImages != null) { + m.downloadImages = Boolean(d.downloadImages); + } + if (d.downloadAudio != null) { + m.downloadAudio = Boolean(d.downloadAudio); + } + if (d.downloadVideo != null) { + m.downloadVideo = Boolean(d.downloadVideo); + } + if (d.downloadDocuments != null) { + m.downloadDocuments = Boolean(d.downloadDocuments); + } + return m; + }; + + AutoDownloadSettings.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.downloadImages != null && m.hasOwnProperty("downloadImages")) { + d.downloadImages = m.downloadImages; + if (o.oneofs) + d._downloadImages = "downloadImages"; + } + if (m.downloadAudio != null && m.hasOwnProperty("downloadAudio")) { + d.downloadAudio = m.downloadAudio; + if (o.oneofs) + d._downloadAudio = "downloadAudio"; + } + if (m.downloadVideo != null && m.hasOwnProperty("downloadVideo")) { + d.downloadVideo = m.downloadVideo; + if (o.oneofs) + d._downloadVideo = "downloadVideo"; + } + if (m.downloadDocuments != null && m.hasOwnProperty("downloadDocuments")) { + d.downloadDocuments = m.downloadDocuments; + if (o.oneofs) + d._downloadDocuments = "downloadDocuments"; + } + return d; + }; + + AutoDownloadSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AutoDownloadSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2081,8 +4280,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AvatarUserSettings.prototype.fbid = ""; - AvatarUserSettings.prototype.password = ""; + AvatarUserSettings.prototype.fbid = null; + AvatarUserSettings.prototype.password = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AvatarUserSettings.prototype, "_fbid", { + get: $util.oneOfGetter($oneOfFields = ["fbid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AvatarUserSettings.prototype, "_password", { + get: $util.oneOfGetter($oneOfFields = ["password"]), + set: $util.oneOfSetter($oneOfFields) + }); AvatarUserSettings.create = function create(properties) { return new AvatarUserSettings(properties); @@ -2123,6 +4336,40 @@ export const proto = $root.proto = (() => { return m; }; + AvatarUserSettings.fromObject = function fromObject(d) { + if (d instanceof $root.proto.AvatarUserSettings) + return d; + var m = new $root.proto.AvatarUserSettings(); + if (d.fbid != null) { + m.fbid = String(d.fbid); + } + if (d.password != null) { + m.password = String(d.password); + } + return m; + }; + + AvatarUserSettings.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fbid != null && m.hasOwnProperty("fbid")) { + d.fbid = m.fbid; + if (o.oneofs) + d._fbid = "fbid"; + } + if (m.password != null && m.hasOwnProperty("password")) { + d.password = m.password; + if (o.oneofs) + d._password = "password"; + } + return d; + }; + + AvatarUserSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AvatarUserSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2142,11 +4389,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BizAccountLinkInfo.prototype.whatsappBizAcctFbid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - BizAccountLinkInfo.prototype.whatsappAcctNumber = ""; - BizAccountLinkInfo.prototype.issueTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - BizAccountLinkInfo.prototype.hostStorage = 0; - BizAccountLinkInfo.prototype.accountType = 0; + BizAccountLinkInfo.prototype.whatsappBizAcctFbid = null; + BizAccountLinkInfo.prototype.whatsappAcctNumber = null; + BizAccountLinkInfo.prototype.issueTime = null; + BizAccountLinkInfo.prototype.hostStorage = null; + BizAccountLinkInfo.prototype.accountType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappBizAcctFbid", { + get: $util.oneOfGetter($oneOfFields = ["whatsappBizAcctFbid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappAcctNumber", { + get: $util.oneOfGetter($oneOfFields = ["whatsappAcctNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountLinkInfo.prototype, "_issueTime", { + get: $util.oneOfGetter($oneOfFields = ["issueTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountLinkInfo.prototype, "_hostStorage", { + get: $util.oneOfGetter($oneOfFields = ["hostStorage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountLinkInfo.prototype, "_accountType", { + get: $util.oneOfGetter($oneOfFields = ["accountType"]), + set: $util.oneOfSetter($oneOfFields) + }); BizAccountLinkInfo.create = function create(properties) { return new BizAccountLinkInfo(properties); @@ -2205,6 +4484,106 @@ export const proto = $root.proto = (() => { return m; }; + BizAccountLinkInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BizAccountLinkInfo) + return d; + var m = new $root.proto.BizAccountLinkInfo(); + if (d.whatsappBizAcctFbid != null) { + if ($util.Long) + (m.whatsappBizAcctFbid = $util.Long.fromValue(d.whatsappBizAcctFbid)).unsigned = true; + else if (typeof d.whatsappBizAcctFbid === "string") + m.whatsappBizAcctFbid = parseInt(d.whatsappBizAcctFbid, 10); + else if (typeof d.whatsappBizAcctFbid === "number") + m.whatsappBizAcctFbid = d.whatsappBizAcctFbid; + else if (typeof d.whatsappBizAcctFbid === "object") + m.whatsappBizAcctFbid = new $util.LongBits(d.whatsappBizAcctFbid.low >>> 0, d.whatsappBizAcctFbid.high >>> 0).toNumber(true); + } + if (d.whatsappAcctNumber != null) { + m.whatsappAcctNumber = String(d.whatsappAcctNumber); + } + if (d.issueTime != null) { + if ($util.Long) + (m.issueTime = $util.Long.fromValue(d.issueTime)).unsigned = true; + else if (typeof d.issueTime === "string") + m.issueTime = parseInt(d.issueTime, 10); + else if (typeof d.issueTime === "number") + m.issueTime = d.issueTime; + else if (typeof d.issueTime === "object") + m.issueTime = new $util.LongBits(d.issueTime.low >>> 0, d.issueTime.high >>> 0).toNumber(true); + } + switch (d.hostStorage) { + default: + if (typeof d.hostStorage === "number") { + m.hostStorage = d.hostStorage; + break; + } + break; + case "ON_PREMISE": + case 0: + m.hostStorage = 0; + break; + case "FACEBOOK": + case 1: + m.hostStorage = 1; + break; + } + switch (d.accountType) { + default: + if (typeof d.accountType === "number") { + m.accountType = d.accountType; + break; + } + break; + case "ENTERPRISE": + case 0: + m.accountType = 0; + break; + } + return m; + }; + + BizAccountLinkInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.whatsappBizAcctFbid != null && m.hasOwnProperty("whatsappBizAcctFbid")) { + if (typeof m.whatsappBizAcctFbid === "number") + d.whatsappBizAcctFbid = o.longs === String ? String(m.whatsappBizAcctFbid) : m.whatsappBizAcctFbid; + else + d.whatsappBizAcctFbid = o.longs === String ? $util.Long.prototype.toString.call(m.whatsappBizAcctFbid) : o.longs === Number ? new $util.LongBits(m.whatsappBizAcctFbid.low >>> 0, m.whatsappBizAcctFbid.high >>> 0).toNumber(true) : m.whatsappBizAcctFbid; + if (o.oneofs) + d._whatsappBizAcctFbid = "whatsappBizAcctFbid"; + } + if (m.whatsappAcctNumber != null && m.hasOwnProperty("whatsappAcctNumber")) { + d.whatsappAcctNumber = m.whatsappAcctNumber; + if (o.oneofs) + d._whatsappAcctNumber = "whatsappAcctNumber"; + } + if (m.issueTime != null && m.hasOwnProperty("issueTime")) { + if (typeof m.issueTime === "number") + d.issueTime = o.longs === String ? String(m.issueTime) : m.issueTime; + else + d.issueTime = o.longs === String ? $util.Long.prototype.toString.call(m.issueTime) : o.longs === Number ? new $util.LongBits(m.issueTime.low >>> 0, m.issueTime.high >>> 0).toNumber(true) : m.issueTime; + if (o.oneofs) + d._issueTime = "issueTime"; + } + if (m.hostStorage != null && m.hasOwnProperty("hostStorage")) { + d.hostStorage = o.enums === String ? $root.proto.BizAccountLinkInfo.HostStorageType[m.hostStorage] === undefined ? m.hostStorage : $root.proto.BizAccountLinkInfo.HostStorageType[m.hostStorage] : m.hostStorage; + if (o.oneofs) + d._hostStorage = "hostStorage"; + } + if (m.accountType != null && m.hasOwnProperty("accountType")) { + d.accountType = o.enums === String ? $root.proto.BizAccountLinkInfo.AccountType[m.accountType] === undefined ? m.accountType : $root.proto.BizAccountLinkInfo.AccountType[m.accountType] : m.accountType; + if (o.oneofs) + d._accountType = "accountType"; + } + return d; + }; + + BizAccountLinkInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BizAccountLinkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2238,7 +4617,21 @@ export const proto = $root.proto = (() => { } BizAccountPayload.prototype.vnameCert = null; - BizAccountPayload.prototype.bizAcctLinkInfo = $util.newBuffer([]); + BizAccountPayload.prototype.bizAcctLinkInfo = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountPayload.prototype, "_vnameCert", { + get: $util.oneOfGetter($oneOfFields = ["vnameCert"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizAccountPayload.prototype, "_bizAcctLinkInfo", { + get: $util.oneOfGetter($oneOfFields = ["bizAcctLinkInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); BizAccountPayload.create = function create(properties) { return new BizAccountPayload(properties); @@ -2279,6 +4672,45 @@ export const proto = $root.proto = (() => { return m; }; + BizAccountPayload.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BizAccountPayload) + return d; + var m = new $root.proto.BizAccountPayload(); + if (d.vnameCert != null) { + if (typeof d.vnameCert !== "object") + throw TypeError(".proto.BizAccountPayload.vnameCert: object expected"); + m.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(d.vnameCert); + } + if (d.bizAcctLinkInfo != null) { + if (typeof d.bizAcctLinkInfo === "string") + $util.base64.decode(d.bizAcctLinkInfo, m.bizAcctLinkInfo = $util.newBuffer($util.base64.length(d.bizAcctLinkInfo)), 0); + else if (d.bizAcctLinkInfo.length >= 0) + m.bizAcctLinkInfo = d.bizAcctLinkInfo; + } + return m; + }; + + BizAccountPayload.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.vnameCert != null && m.hasOwnProperty("vnameCert")) { + d.vnameCert = $root.proto.VerifiedNameCertificate.toObject(m.vnameCert, o); + if (o.oneofs) + d._vnameCert = "vnameCert"; + } + if (m.bizAcctLinkInfo != null && m.hasOwnProperty("bizAcctLinkInfo")) { + d.bizAcctLinkInfo = o.bytes === String ? $util.base64.encode(m.bizAcctLinkInfo, 0, m.bizAcctLinkInfo.length) : o.bytes === Array ? Array.prototype.slice.call(m.bizAcctLinkInfo) : m.bizAcctLinkInfo; + if (o.oneofs) + d._bizAcctLinkInfo = "bizAcctLinkInfo"; + } + return d; + }; + + BizAccountPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BizAccountPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2298,14 +4730,64 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BizIdentityInfo.prototype.vlevel = 0; + BizIdentityInfo.prototype.vlevel = null; BizIdentityInfo.prototype.vnameCert = null; - BizIdentityInfo.prototype.signed = false; - BizIdentityInfo.prototype.revoked = false; - BizIdentityInfo.prototype.hostStorage = 0; - BizIdentityInfo.prototype.actualActors = 0; - BizIdentityInfo.prototype.privacyModeTs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - BizIdentityInfo.prototype.featureControls = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + BizIdentityInfo.prototype.signed = null; + BizIdentityInfo.prototype.revoked = null; + BizIdentityInfo.prototype.hostStorage = null; + BizIdentityInfo.prototype.actualActors = null; + BizIdentityInfo.prototype.privacyModeTs = null; + BizIdentityInfo.prototype.featureControls = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_vlevel", { + get: $util.oneOfGetter($oneOfFields = ["vlevel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_vnameCert", { + get: $util.oneOfGetter($oneOfFields = ["vnameCert"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_signed", { + get: $util.oneOfGetter($oneOfFields = ["signed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_revoked", { + get: $util.oneOfGetter($oneOfFields = ["revoked"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_hostStorage", { + get: $util.oneOfGetter($oneOfFields = ["hostStorage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_actualActors", { + get: $util.oneOfGetter($oneOfFields = ["actualActors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_privacyModeTs", { + get: $util.oneOfGetter($oneOfFields = ["privacyModeTs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BizIdentityInfo.prototype, "_featureControls", { + get: $util.oneOfGetter($oneOfFields = ["featureControls"]), + set: $util.oneOfSetter($oneOfFields) + }); BizIdentityInfo.create = function create(properties) { return new BizIdentityInfo(properties); @@ -2382,6 +4864,153 @@ export const proto = $root.proto = (() => { return m; }; + BizIdentityInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BizIdentityInfo) + return d; + var m = new $root.proto.BizIdentityInfo(); + switch (d.vlevel) { + default: + if (typeof d.vlevel === "number") { + m.vlevel = d.vlevel; + break; + } + break; + case "UNKNOWN": + case 0: + m.vlevel = 0; + break; + case "LOW": + case 1: + m.vlevel = 1; + break; + case "HIGH": + case 2: + m.vlevel = 2; + break; + } + if (d.vnameCert != null) { + if (typeof d.vnameCert !== "object") + throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected"); + m.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(d.vnameCert); + } + if (d.signed != null) { + m.signed = Boolean(d.signed); + } + if (d.revoked != null) { + m.revoked = Boolean(d.revoked); + } + switch (d.hostStorage) { + default: + if (typeof d.hostStorage === "number") { + m.hostStorage = d.hostStorage; + break; + } + break; + case "ON_PREMISE": + case 0: + m.hostStorage = 0; + break; + case "FACEBOOK": + case 1: + m.hostStorage = 1; + break; + } + switch (d.actualActors) { + default: + if (typeof d.actualActors === "number") { + m.actualActors = d.actualActors; + break; + } + break; + case "SELF": + case 0: + m.actualActors = 0; + break; + case "BSP": + case 1: + m.actualActors = 1; + break; + } + if (d.privacyModeTs != null) { + if ($util.Long) + (m.privacyModeTs = $util.Long.fromValue(d.privacyModeTs)).unsigned = true; + else if (typeof d.privacyModeTs === "string") + m.privacyModeTs = parseInt(d.privacyModeTs, 10); + else if (typeof d.privacyModeTs === "number") + m.privacyModeTs = d.privacyModeTs; + else if (typeof d.privacyModeTs === "object") + m.privacyModeTs = new $util.LongBits(d.privacyModeTs.low >>> 0, d.privacyModeTs.high >>> 0).toNumber(true); + } + if (d.featureControls != null) { + if ($util.Long) + (m.featureControls = $util.Long.fromValue(d.featureControls)).unsigned = true; + else if (typeof d.featureControls === "string") + m.featureControls = parseInt(d.featureControls, 10); + else if (typeof d.featureControls === "number") + m.featureControls = d.featureControls; + else if (typeof d.featureControls === "object") + m.featureControls = new $util.LongBits(d.featureControls.low >>> 0, d.featureControls.high >>> 0).toNumber(true); + } + return m; + }; + + BizIdentityInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.vlevel != null && m.hasOwnProperty("vlevel")) { + d.vlevel = o.enums === String ? $root.proto.BizIdentityInfo.VerifiedLevelValue[m.vlevel] === undefined ? m.vlevel : $root.proto.BizIdentityInfo.VerifiedLevelValue[m.vlevel] : m.vlevel; + if (o.oneofs) + d._vlevel = "vlevel"; + } + if (m.vnameCert != null && m.hasOwnProperty("vnameCert")) { + d.vnameCert = $root.proto.VerifiedNameCertificate.toObject(m.vnameCert, o); + if (o.oneofs) + d._vnameCert = "vnameCert"; + } + if (m.signed != null && m.hasOwnProperty("signed")) { + d.signed = m.signed; + if (o.oneofs) + d._signed = "signed"; + } + if (m.revoked != null && m.hasOwnProperty("revoked")) { + d.revoked = m.revoked; + if (o.oneofs) + d._revoked = "revoked"; + } + if (m.hostStorage != null && m.hasOwnProperty("hostStorage")) { + d.hostStorage = o.enums === String ? $root.proto.BizIdentityInfo.HostStorageType[m.hostStorage] === undefined ? m.hostStorage : $root.proto.BizIdentityInfo.HostStorageType[m.hostStorage] : m.hostStorage; + if (o.oneofs) + d._hostStorage = "hostStorage"; + } + if (m.actualActors != null && m.hasOwnProperty("actualActors")) { + d.actualActors = o.enums === String ? $root.proto.BizIdentityInfo.ActualActorsType[m.actualActors] === undefined ? m.actualActors : $root.proto.BizIdentityInfo.ActualActorsType[m.actualActors] : m.actualActors; + if (o.oneofs) + d._actualActors = "actualActors"; + } + if (m.privacyModeTs != null && m.hasOwnProperty("privacyModeTs")) { + if (typeof m.privacyModeTs === "number") + d.privacyModeTs = o.longs === String ? String(m.privacyModeTs) : m.privacyModeTs; + else + d.privacyModeTs = o.longs === String ? $util.Long.prototype.toString.call(m.privacyModeTs) : o.longs === Number ? new $util.LongBits(m.privacyModeTs.low >>> 0, m.privacyModeTs.high >>> 0).toNumber(true) : m.privacyModeTs; + if (o.oneofs) + d._privacyModeTs = "privacyModeTs"; + } + if (m.featureControls != null && m.hasOwnProperty("featureControls")) { + if (typeof m.featureControls === "number") + d.featureControls = o.longs === String ? String(m.featureControls) : m.featureControls; + else + d.featureControls = o.longs === String ? $util.Long.prototype.toString.call(m.featureControls) : o.longs === Number ? new $util.LongBits(m.featureControls.low >>> 0, m.featureControls.high >>> 0).toNumber(true) : m.featureControls; + if (o.oneofs) + d._featureControls = "featureControls"; + } + return d; + }; + + BizIdentityInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BizIdentityInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2423,8 +5052,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotAgeCollectionMetadata.prototype.ageCollectionEligible = false; - BotAgeCollectionMetadata.prototype.shouldTriggerAgeCollectionOnClient = false; + BotAgeCollectionMetadata.prototype.ageCollectionEligible = null; + BotAgeCollectionMetadata.prototype.shouldTriggerAgeCollectionOnClient = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAgeCollectionMetadata.prototype, "_ageCollectionEligible", { + get: $util.oneOfGetter($oneOfFields = ["ageCollectionEligible"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAgeCollectionMetadata.prototype, "_shouldTriggerAgeCollectionOnClient", { + get: $util.oneOfGetter($oneOfFields = ["shouldTriggerAgeCollectionOnClient"]), + set: $util.oneOfSetter($oneOfFields) + }); BotAgeCollectionMetadata.create = function create(properties) { return new BotAgeCollectionMetadata(properties); @@ -2465,6 +5108,40 @@ export const proto = $root.proto = (() => { return m; }; + BotAgeCollectionMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotAgeCollectionMetadata) + return d; + var m = new $root.proto.BotAgeCollectionMetadata(); + if (d.ageCollectionEligible != null) { + m.ageCollectionEligible = Boolean(d.ageCollectionEligible); + } + if (d.shouldTriggerAgeCollectionOnClient != null) { + m.shouldTriggerAgeCollectionOnClient = Boolean(d.shouldTriggerAgeCollectionOnClient); + } + return m; + }; + + BotAgeCollectionMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.ageCollectionEligible != null && m.hasOwnProperty("ageCollectionEligible")) { + d.ageCollectionEligible = m.ageCollectionEligible; + if (o.oneofs) + d._ageCollectionEligible = "ageCollectionEligible"; + } + if (m.shouldTriggerAgeCollectionOnClient != null && m.hasOwnProperty("shouldTriggerAgeCollectionOnClient")) { + d.shouldTriggerAgeCollectionOnClient = m.shouldTriggerAgeCollectionOnClient; + if (o.oneofs) + d._shouldTriggerAgeCollectionOnClient = "shouldTriggerAgeCollectionOnClient"; + } + return d; + }; + + BotAgeCollectionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotAgeCollectionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2484,11 +5161,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotAvatarMetadata.prototype.sentiment = 0; - BotAvatarMetadata.prototype.behaviorGraph = ""; - BotAvatarMetadata.prototype.action = 0; - BotAvatarMetadata.prototype.intensity = 0; - BotAvatarMetadata.prototype.wordCount = 0; + BotAvatarMetadata.prototype.sentiment = null; + BotAvatarMetadata.prototype.behaviorGraph = null; + BotAvatarMetadata.prototype.action = null; + BotAvatarMetadata.prototype.intensity = null; + BotAvatarMetadata.prototype.wordCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAvatarMetadata.prototype, "_sentiment", { + get: $util.oneOfGetter($oneOfFields = ["sentiment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAvatarMetadata.prototype, "_behaviorGraph", { + get: $util.oneOfGetter($oneOfFields = ["behaviorGraph"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAvatarMetadata.prototype, "_action", { + get: $util.oneOfGetter($oneOfFields = ["action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAvatarMetadata.prototype, "_intensity", { + get: $util.oneOfGetter($oneOfFields = ["intensity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotAvatarMetadata.prototype, "_wordCount", { + get: $util.oneOfGetter($oneOfFields = ["wordCount"]), + set: $util.oneOfSetter($oneOfFields) + }); BotAvatarMetadata.create = function create(properties) { return new BotAvatarMetadata(properties); @@ -2547,6 +5256,64 @@ export const proto = $root.proto = (() => { return m; }; + BotAvatarMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotAvatarMetadata) + return d; + var m = new $root.proto.BotAvatarMetadata(); + if (d.sentiment != null) { + m.sentiment = d.sentiment >>> 0; + } + if (d.behaviorGraph != null) { + m.behaviorGraph = String(d.behaviorGraph); + } + if (d.action != null) { + m.action = d.action >>> 0; + } + if (d.intensity != null) { + m.intensity = d.intensity >>> 0; + } + if (d.wordCount != null) { + m.wordCount = d.wordCount >>> 0; + } + return m; + }; + + BotAvatarMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.sentiment != null && m.hasOwnProperty("sentiment")) { + d.sentiment = m.sentiment; + if (o.oneofs) + d._sentiment = "sentiment"; + } + if (m.behaviorGraph != null && m.hasOwnProperty("behaviorGraph")) { + d.behaviorGraph = m.behaviorGraph; + if (o.oneofs) + d._behaviorGraph = "behaviorGraph"; + } + if (m.action != null && m.hasOwnProperty("action")) { + d.action = m.action; + if (o.oneofs) + d._action = "action"; + } + if (m.intensity != null && m.hasOwnProperty("intensity")) { + d.intensity = m.intensity; + if (o.oneofs) + d._intensity = "intensity"; + } + if (m.wordCount != null && m.hasOwnProperty("wordCount")) { + d.wordCount = m.wordCount; + if (o.oneofs) + d._wordCount = "wordCount"; + } + return d; + }; + + BotAvatarMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotAvatarMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2577,8 +5344,10 @@ export const proto = $root.proto = (() => { if (!w) w = $Writer.create(); if (m.capabilities != null && m.capabilities.length) { + w.uint32(10).fork(); for (var i = 0; i < m.capabilities.length; ++i) - w.uint32(8).int32(m.capabilities[i]); + w.int32(m.capabilities[i]); + w.ldelim(); } return w; }; @@ -2611,6 +5380,191 @@ export const proto = $root.proto = (() => { return m; }; + BotCapabilityMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotCapabilityMetadata) + return d; + var m = new $root.proto.BotCapabilityMetadata(); + if (d.capabilities) { + if (!Array.isArray(d.capabilities)) + throw TypeError(".proto.BotCapabilityMetadata.capabilities: array expected"); + m.capabilities = []; + for (var i = 0; i < d.capabilities.length; ++i) { + switch (d.capabilities[i]) { + default: + if (typeof d.capabilities[i] === "number") { + m.capabilities[i] = d.capabilities[i]; + break; + } + case "UNKNOWN": + case 0: + m.capabilities[i] = 0; + break; + case "PROGRESS_INDICATOR": + case 1: + m.capabilities[i] = 1; + break; + case "RICH_RESPONSE_HEADING": + case 2: + m.capabilities[i] = 2; + break; + case "RICH_RESPONSE_NESTED_LIST": + case 3: + m.capabilities[i] = 3; + break; + case "AI_MEMORY": + case 4: + m.capabilities[i] = 4; + break; + case "RICH_RESPONSE_THREAD_SURFING": + case 5: + m.capabilities[i] = 5; + break; + case "RICH_RESPONSE_TABLE": + case 6: + m.capabilities[i] = 6; + break; + case "RICH_RESPONSE_CODE": + case 7: + m.capabilities[i] = 7; + break; + case "RICH_RESPONSE_STRUCTURED_RESPONSE": + case 8: + m.capabilities[i] = 8; + break; + case "RICH_RESPONSE_INLINE_IMAGE": + case 9: + m.capabilities[i] = 9; + break; + case "WA_IG_1P_PLUGIN_RANKING_CONTROL": + case 10: + m.capabilities[i] = 10; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_1": + case 11: + m.capabilities[i] = 11; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_2": + case 12: + m.capabilities[i] = 12; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_3": + case 13: + m.capabilities[i] = 13; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_4": + case 14: + m.capabilities[i] = 14; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_5": + case 15: + m.capabilities[i] = 15; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_6": + case 16: + m.capabilities[i] = 16; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_7": + case 17: + m.capabilities[i] = 17; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_8": + case 18: + m.capabilities[i] = 18; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_9": + case 19: + m.capabilities[i] = 19; + break; + case "WA_IG_1P_PLUGIN_RANKING_UPDATE_10": + case 20: + m.capabilities[i] = 20; + break; + case "RICH_RESPONSE_SUB_HEADING": + case 21: + m.capabilities[i] = 21; + break; + case "RICH_RESPONSE_GRID_IMAGE": + case 22: + m.capabilities[i] = 22; + break; + case "AI_STUDIO_UGC_MEMORY": + case 23: + m.capabilities[i] = 23; + break; + case "RICH_RESPONSE_LATEX": + case 24: + m.capabilities[i] = 24; + break; + case "RICH_RESPONSE_MAPS": + case 25: + m.capabilities[i] = 25; + break; + case "RICH_RESPONSE_INLINE_REELS": + case 26: + m.capabilities[i] = 26; + break; + case "AGENTIC_PLANNING": + case 27: + m.capabilities[i] = 27; + break; + case "ACCOUNT_LINKING": + case 28: + m.capabilities[i] = 28; + break; + case "STREAMING_DISAGGREGATION": + case 29: + m.capabilities[i] = 29; + break; + case "RICH_RESPONSE_GRID_IMAGE_3P": + case 30: + m.capabilities[i] = 30; + break; + case "RICH_RESPONSE_LATEX_INLINE": + case 31: + m.capabilities[i] = 31; + break; + case "QUERY_PLAN": + case 32: + m.capabilities[i] = 32; + break; + case "PROACTIVE_MESSAGE": + case 33: + m.capabilities[i] = 33; + break; + case "RICH_RESPONSE_UNIFIED_RESPONSE": + case 34: + m.capabilities[i] = 34; + break; + case "PROMOTION_MESSAGE": + case 35: + m.capabilities[i] = 35; + break; + } + } + } + return m; + }; + + BotCapabilityMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.capabilities = []; + } + if (m.capabilities && m.capabilities.length) { + d.capabilities = []; + for (var j = 0; j < m.capabilities.length; ++j) { + d.capabilities[j] = o.enums === String ? $root.proto.BotCapabilityMetadata.BotCapabilityType[m.capabilities[j]] === undefined ? m.capabilities[j] : $root.proto.BotCapabilityMetadata.BotCapabilityType[m.capabilities[j]] : m.capabilities[j]; + } + } + return d; + }; + + BotCapabilityMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotCapabilityMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2671,7 +5625,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotImagineMetadata.prototype.imagineType = 0; + BotImagineMetadata.prototype.imagineType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotImagineMetadata.prototype, "_imagineType", { + get: $util.oneOfGetter($oneOfFields = ["imagineType"]), + set: $util.oneOfSetter($oneOfFields) + }); BotImagineMetadata.create = function create(properties) { return new BotImagineMetadata(properties); @@ -2706,6 +5668,57 @@ export const proto = $root.proto = (() => { return m; }; + BotImagineMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotImagineMetadata) + return d; + var m = new $root.proto.BotImagineMetadata(); + switch (d.imagineType) { + default: + if (typeof d.imagineType === "number") { + m.imagineType = d.imagineType; + break; + } + break; + case "UNKNOWN": + case 0: + m.imagineType = 0; + break; + case "IMAGINE": + case 1: + m.imagineType = 1; + break; + case "MEMU": + case 2: + m.imagineType = 2; + break; + case "FLASH": + case 3: + m.imagineType = 3; + break; + case "EDIT": + case 4: + m.imagineType = 4; + break; + } + return m; + }; + + BotImagineMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.imagineType != null && m.hasOwnProperty("imagineType")) { + d.imagineType = o.enums === String ? $root.proto.BotImagineMetadata.ImagineType[m.imagineType] === undefined ? m.imagineType : $root.proto.BotImagineMetadata.ImagineType[m.imagineType] : m.imagineType; + if (o.oneofs) + d._imagineType = "imagineType"; + } + return d; + }; + + BotImagineMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotImagineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2735,7 +5748,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotLinkedAccount.prototype.type = 0; + BotLinkedAccount.prototype.type = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotLinkedAccount.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); BotLinkedAccount.create = function create(properties) { return new BotLinkedAccount(properties); @@ -2770,6 +5791,41 @@ export const proto = $root.proto = (() => { return m; }; + BotLinkedAccount.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotLinkedAccount) + return d; + var m = new $root.proto.BotLinkedAccount(); + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "BOT_LINKED_ACCOUNT_TYPE_1P": + case 0: + m.type = 0; + break; + } + return m; + }; + + BotLinkedAccount.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.BotLinkedAccount.BotLinkedAccountType[m.type] === undefined ? m.type : $root.proto.BotLinkedAccount.BotLinkedAccountType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + return d; + }; + + BotLinkedAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotLinkedAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2797,8 +5853,22 @@ export const proto = $root.proto = (() => { } BotLinkedAccountsMetadata.prototype.accounts = $util.emptyArray; - BotLinkedAccountsMetadata.prototype.acAuthTokens = $util.newBuffer([]); - BotLinkedAccountsMetadata.prototype.acErrorCode = 0; + BotLinkedAccountsMetadata.prototype.acAuthTokens = null; + BotLinkedAccountsMetadata.prototype.acErrorCode = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotLinkedAccountsMetadata.prototype, "_acAuthTokens", { + get: $util.oneOfGetter($oneOfFields = ["acAuthTokens"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotLinkedAccountsMetadata.prototype, "_acErrorCode", { + get: $util.oneOfGetter($oneOfFields = ["acErrorCode"]), + set: $util.oneOfSetter($oneOfFields) + }); BotLinkedAccountsMetadata.create = function create(properties) { return new BotLinkedAccountsMetadata(properties); @@ -2849,6 +5919,62 @@ export const proto = $root.proto = (() => { return m; }; + BotLinkedAccountsMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotLinkedAccountsMetadata) + return d; + var m = new $root.proto.BotLinkedAccountsMetadata(); + if (d.accounts) { + if (!Array.isArray(d.accounts)) + throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected"); + m.accounts = []; + for (var i = 0; i < d.accounts.length; ++i) { + if (typeof d.accounts[i] !== "object") + throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: object expected"); + m.accounts[i] = $root.proto.BotLinkedAccount.fromObject(d.accounts[i]); + } + } + if (d.acAuthTokens != null) { + if (typeof d.acAuthTokens === "string") + $util.base64.decode(d.acAuthTokens, m.acAuthTokens = $util.newBuffer($util.base64.length(d.acAuthTokens)), 0); + else if (d.acAuthTokens.length >= 0) + m.acAuthTokens = d.acAuthTokens; + } + if (d.acErrorCode != null) { + m.acErrorCode = d.acErrorCode | 0; + } + return m; + }; + + BotLinkedAccountsMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.accounts = []; + } + if (m.accounts && m.accounts.length) { + d.accounts = []; + for (var j = 0; j < m.accounts.length; ++j) { + d.accounts[j] = $root.proto.BotLinkedAccount.toObject(m.accounts[j], o); + } + } + if (m.acAuthTokens != null && m.hasOwnProperty("acAuthTokens")) { + d.acAuthTokens = o.bytes === String ? $util.base64.encode(m.acAuthTokens, 0, m.acAuthTokens.length) : o.bytes === Array ? Array.prototype.slice.call(m.acAuthTokens) : m.acAuthTokens; + if (o.oneofs) + d._acAuthTokens = "acAuthTokens"; + } + if (m.acErrorCode != null && m.hasOwnProperty("acErrorCode")) { + d.acErrorCode = m.acErrorCode; + if (o.oneofs) + d._acErrorCode = "acErrorCode"; + } + return d; + }; + + BotLinkedAccountsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotLinkedAccountsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2868,13 +5994,57 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotMediaMetadata.prototype.fileSha256 = ""; - BotMediaMetadata.prototype.mediaKey = ""; - BotMediaMetadata.prototype.fileEncSha256 = ""; - BotMediaMetadata.prototype.directPath = ""; - BotMediaMetadata.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - BotMediaMetadata.prototype.mimetype = ""; - BotMediaMetadata.prototype.orientationType = 1; + BotMediaMetadata.prototype.fileSha256 = null; + BotMediaMetadata.prototype.mediaKey = null; + BotMediaMetadata.prototype.fileEncSha256 = null; + BotMediaMetadata.prototype.directPath = null; + BotMediaMetadata.prototype.mediaKeyTimestamp = null; + BotMediaMetadata.prototype.mimetype = null; + BotMediaMetadata.prototype.orientationType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMediaMetadata.prototype, "_orientationType", { + get: $util.oneOfGetter($oneOfFields = ["orientationType"]), + set: $util.oneOfSetter($oneOfFields) + }); BotMediaMetadata.create = function create(properties) { return new BotMediaMetadata(properties); @@ -2945,6 +6115,107 @@ export const proto = $root.proto = (() => { return m; }; + BotMediaMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotMediaMetadata) + return d; + var m = new $root.proto.BotMediaMetadata(); + if (d.fileSha256 != null) { + m.fileSha256 = String(d.fileSha256); + } + if (d.mediaKey != null) { + m.mediaKey = String(d.mediaKey); + } + if (d.fileEncSha256 != null) { + m.fileEncSha256 = String(d.fileEncSha256); + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + switch (d.orientationType) { + default: + if (typeof d.orientationType === "number") { + m.orientationType = d.orientationType; + break; + } + break; + case "CENTER": + case 1: + m.orientationType = 1; + break; + case "LEFT": + case 2: + m.orientationType = 2; + break; + case "RIGHT": + case 3: + m.orientationType = 3; + break; + } + return m; + }; + + BotMediaMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.orientationType != null && m.hasOwnProperty("orientationType")) { + d.orientationType = o.enums === String ? $root.proto.BotMediaMetadata.OrientationType[m.orientationType] === undefined ? m.orientationType : $root.proto.BotMediaMetadata.OrientationType[m.orientationType] : m.orientationType; + if (o.oneofs) + d._orientationType = "orientationType"; + } + return d; + }; + + BotMediaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotMediaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -2972,8 +6243,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotMemoryFact.prototype.fact = ""; - BotMemoryFact.prototype.factId = ""; + BotMemoryFact.prototype.fact = null; + BotMemoryFact.prototype.factId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMemoryFact.prototype, "_fact", { + get: $util.oneOfGetter($oneOfFields = ["fact"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMemoryFact.prototype, "_factId", { + get: $util.oneOfGetter($oneOfFields = ["factId"]), + set: $util.oneOfSetter($oneOfFields) + }); BotMemoryFact.create = function create(properties) { return new BotMemoryFact(properties); @@ -3014,6 +6299,40 @@ export const proto = $root.proto = (() => { return m; }; + BotMemoryFact.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotMemoryFact) + return d; + var m = new $root.proto.BotMemoryFact(); + if (d.fact != null) { + m.fact = String(d.fact); + } + if (d.factId != null) { + m.factId = String(d.factId); + } + return m; + }; + + BotMemoryFact.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fact != null && m.hasOwnProperty("fact")) { + d.fact = m.fact; + if (o.oneofs) + d._fact = "fact"; + } + if (m.factId != null && m.hasOwnProperty("factId")) { + d.factId = m.factId; + if (o.oneofs) + d._factId = "factId"; + } + return d; + }; + + BotMemoryFact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotMemoryFact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3037,7 +6356,15 @@ export const proto = $root.proto = (() => { BotMemoryMetadata.prototype.addedFacts = $util.emptyArray; BotMemoryMetadata.prototype.removedFacts = $util.emptyArray; - BotMemoryMetadata.prototype.disclaimer = ""; + BotMemoryMetadata.prototype.disclaimer = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMemoryMetadata.prototype, "_disclaimer", { + get: $util.oneOfGetter($oneOfFields = ["disclaimer"]), + set: $util.oneOfSetter($oneOfFields) + }); BotMemoryMetadata.create = function create(properties) { return new BotMemoryMetadata(properties); @@ -3092,6 +6419,68 @@ export const proto = $root.proto = (() => { return m; }; + BotMemoryMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotMemoryMetadata) + return d; + var m = new $root.proto.BotMemoryMetadata(); + if (d.addedFacts) { + if (!Array.isArray(d.addedFacts)) + throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected"); + m.addedFacts = []; + for (var i = 0; i < d.addedFacts.length; ++i) { + if (typeof d.addedFacts[i] !== "object") + throw TypeError(".proto.BotMemoryMetadata.addedFacts: object expected"); + m.addedFacts[i] = $root.proto.BotMemoryFact.fromObject(d.addedFacts[i]); + } + } + if (d.removedFacts) { + if (!Array.isArray(d.removedFacts)) + throw TypeError(".proto.BotMemoryMetadata.removedFacts: array expected"); + m.removedFacts = []; + for (var i = 0; i < d.removedFacts.length; ++i) { + if (typeof d.removedFacts[i] !== "object") + throw TypeError(".proto.BotMemoryMetadata.removedFacts: object expected"); + m.removedFacts[i] = $root.proto.BotMemoryFact.fromObject(d.removedFacts[i]); + } + } + if (d.disclaimer != null) { + m.disclaimer = String(d.disclaimer); + } + return m; + }; + + BotMemoryMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.addedFacts = []; + d.removedFacts = []; + } + if (m.addedFacts && m.addedFacts.length) { + d.addedFacts = []; + for (var j = 0; j < m.addedFacts.length; ++j) { + d.addedFacts[j] = $root.proto.BotMemoryFact.toObject(m.addedFacts[j], o); + } + } + if (m.removedFacts && m.removedFacts.length) { + d.removedFacts = []; + for (var j = 0; j < m.removedFacts.length; ++j) { + d.removedFacts[j] = $root.proto.BotMemoryFact.toObject(m.removedFacts[j], o); + } + } + if (m.disclaimer != null && m.hasOwnProperty("disclaimer")) { + d.disclaimer = m.disclaimer; + if (o.oneofs) + d._disclaimer = "disclaimer"; + } + return d; + }; + + BotMemoryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotMemoryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3151,6 +6540,43 @@ export const proto = $root.proto = (() => { return m; }; + BotMemuMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotMemuMetadata) + return d; + var m = new $root.proto.BotMemuMetadata(); + if (d.faceImages) { + if (!Array.isArray(d.faceImages)) + throw TypeError(".proto.BotMemuMetadata.faceImages: array expected"); + m.faceImages = []; + for (var i = 0; i < d.faceImages.length; ++i) { + if (typeof d.faceImages[i] !== "object") + throw TypeError(".proto.BotMemuMetadata.faceImages: object expected"); + m.faceImages[i] = $root.proto.BotMediaMetadata.fromObject(d.faceImages[i]); + } + } + return m; + }; + + BotMemuMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.faceImages = []; + } + if (m.faceImages && m.faceImages.length) { + d.faceImages = []; + for (var j = 0; j < m.faceImages.length; ++j) { + d.faceImages[j] = $root.proto.BotMediaMetadata.toObject(m.faceImages[j], o); + } + } + return d; + }; + + BotMemuMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotMemuMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3171,16 +6597,16 @@ export const proto = $root.proto = (() => { } BotMetadata.prototype.avatarMetadata = null; - BotMetadata.prototype.personaId = ""; + BotMetadata.prototype.personaId = null; BotMetadata.prototype.pluginMetadata = null; BotMetadata.prototype.suggestedPromptMetadata = null; - BotMetadata.prototype.invokerJid = ""; + BotMetadata.prototype.invokerJid = null; BotMetadata.prototype.sessionMetadata = null; BotMetadata.prototype.memuMetadata = null; - BotMetadata.prototype.timezone = ""; + BotMetadata.prototype.timezone = null; BotMetadata.prototype.reminderMetadata = null; BotMetadata.prototype.modelMetadata = null; - BotMetadata.prototype.messageDisclaimerText = ""; + BotMetadata.prototype.messageDisclaimerText = null; BotMetadata.prototype.progressIndicatorMetadata = null; BotMetadata.prototype.capabilityMetadata = null; BotMetadata.prototype.imagineMetadata = null; @@ -3189,12 +6615,158 @@ export const proto = $root.proto = (() => { BotMetadata.prototype.botMetricsMetadata = null; BotMetadata.prototype.botLinkedAccountsMetadata = null; BotMetadata.prototype.richResponseSourcesMetadata = null; - BotMetadata.prototype.aiConversationContext = $util.newBuffer([]); + BotMetadata.prototype.aiConversationContext = null; BotMetadata.prototype.botPromotionMessageMetadata = null; BotMetadata.prototype.botModeSelectionMetadata = null; BotMetadata.prototype.botQuotaMetadata = null; BotMetadata.prototype.botAgeCollectionMetadata = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_avatarMetadata", { + get: $util.oneOfGetter($oneOfFields = ["avatarMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_personaId", { + get: $util.oneOfGetter($oneOfFields = ["personaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_pluginMetadata", { + get: $util.oneOfGetter($oneOfFields = ["pluginMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_suggestedPromptMetadata", { + get: $util.oneOfGetter($oneOfFields = ["suggestedPromptMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_invokerJid", { + get: $util.oneOfGetter($oneOfFields = ["invokerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_sessionMetadata", { + get: $util.oneOfGetter($oneOfFields = ["sessionMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_memuMetadata", { + get: $util.oneOfGetter($oneOfFields = ["memuMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_timezone", { + get: $util.oneOfGetter($oneOfFields = ["timezone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_reminderMetadata", { + get: $util.oneOfGetter($oneOfFields = ["reminderMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_modelMetadata", { + get: $util.oneOfGetter($oneOfFields = ["modelMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_messageDisclaimerText", { + get: $util.oneOfGetter($oneOfFields = ["messageDisclaimerText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_progressIndicatorMetadata", { + get: $util.oneOfGetter($oneOfFields = ["progressIndicatorMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_capabilityMetadata", { + get: $util.oneOfGetter($oneOfFields = ["capabilityMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_imagineMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imagineMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_memoryMetadata", { + get: $util.oneOfGetter($oneOfFields = ["memoryMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_renderingMetadata", { + get: $util.oneOfGetter($oneOfFields = ["renderingMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_botMetricsMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botMetricsMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_botLinkedAccountsMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botLinkedAccountsMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_richResponseSourcesMetadata", { + get: $util.oneOfGetter($oneOfFields = ["richResponseSourcesMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_aiConversationContext", { + get: $util.oneOfGetter($oneOfFields = ["aiConversationContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_botPromotionMessageMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botPromotionMessageMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_botModeSelectionMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botModeSelectionMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_botQuotaMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botQuotaMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetadata.prototype, "_botAgeCollectionMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botAgeCollectionMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + BotMetadata.create = function create(properties) { return new BotMetadata(properties); }; @@ -3366,6 +6938,257 @@ export const proto = $root.proto = (() => { return m; }; + BotMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotMetadata) + return d; + var m = new $root.proto.BotMetadata(); + if (d.avatarMetadata != null) { + if (typeof d.avatarMetadata !== "object") + throw TypeError(".proto.BotMetadata.avatarMetadata: object expected"); + m.avatarMetadata = $root.proto.BotAvatarMetadata.fromObject(d.avatarMetadata); + } + if (d.personaId != null) { + m.personaId = String(d.personaId); + } + if (d.pluginMetadata != null) { + if (typeof d.pluginMetadata !== "object") + throw TypeError(".proto.BotMetadata.pluginMetadata: object expected"); + m.pluginMetadata = $root.proto.BotPluginMetadata.fromObject(d.pluginMetadata); + } + if (d.suggestedPromptMetadata != null) { + if (typeof d.suggestedPromptMetadata !== "object") + throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected"); + m.suggestedPromptMetadata = $root.proto.BotSuggestedPromptMetadata.fromObject(d.suggestedPromptMetadata); + } + if (d.invokerJid != null) { + m.invokerJid = String(d.invokerJid); + } + if (d.sessionMetadata != null) { + if (typeof d.sessionMetadata !== "object") + throw TypeError(".proto.BotMetadata.sessionMetadata: object expected"); + m.sessionMetadata = $root.proto.BotSessionMetadata.fromObject(d.sessionMetadata); + } + if (d.memuMetadata != null) { + if (typeof d.memuMetadata !== "object") + throw TypeError(".proto.BotMetadata.memuMetadata: object expected"); + m.memuMetadata = $root.proto.BotMemuMetadata.fromObject(d.memuMetadata); + } + if (d.timezone != null) { + m.timezone = String(d.timezone); + } + if (d.reminderMetadata != null) { + if (typeof d.reminderMetadata !== "object") + throw TypeError(".proto.BotMetadata.reminderMetadata: object expected"); + m.reminderMetadata = $root.proto.BotReminderMetadata.fromObject(d.reminderMetadata); + } + if (d.modelMetadata != null) { + if (typeof d.modelMetadata !== "object") + throw TypeError(".proto.BotMetadata.modelMetadata: object expected"); + m.modelMetadata = $root.proto.BotModelMetadata.fromObject(d.modelMetadata); + } + if (d.messageDisclaimerText != null) { + m.messageDisclaimerText = String(d.messageDisclaimerText); + } + if (d.progressIndicatorMetadata != null) { + if (typeof d.progressIndicatorMetadata !== "object") + throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected"); + m.progressIndicatorMetadata = $root.proto.BotProgressIndicatorMetadata.fromObject(d.progressIndicatorMetadata); + } + if (d.capabilityMetadata != null) { + if (typeof d.capabilityMetadata !== "object") + throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected"); + m.capabilityMetadata = $root.proto.BotCapabilityMetadata.fromObject(d.capabilityMetadata); + } + if (d.imagineMetadata != null) { + if (typeof d.imagineMetadata !== "object") + throw TypeError(".proto.BotMetadata.imagineMetadata: object expected"); + m.imagineMetadata = $root.proto.BotImagineMetadata.fromObject(d.imagineMetadata); + } + if (d.memoryMetadata != null) { + if (typeof d.memoryMetadata !== "object") + throw TypeError(".proto.BotMetadata.memoryMetadata: object expected"); + m.memoryMetadata = $root.proto.BotMemoryMetadata.fromObject(d.memoryMetadata); + } + if (d.renderingMetadata != null) { + if (typeof d.renderingMetadata !== "object") + throw TypeError(".proto.BotMetadata.renderingMetadata: object expected"); + m.renderingMetadata = $root.proto.BotRenderingMetadata.fromObject(d.renderingMetadata); + } + if (d.botMetricsMetadata != null) { + if (typeof d.botMetricsMetadata !== "object") + throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected"); + m.botMetricsMetadata = $root.proto.BotMetricsMetadata.fromObject(d.botMetricsMetadata); + } + if (d.botLinkedAccountsMetadata != null) { + if (typeof d.botLinkedAccountsMetadata !== "object") + throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected"); + m.botLinkedAccountsMetadata = $root.proto.BotLinkedAccountsMetadata.fromObject(d.botLinkedAccountsMetadata); + } + if (d.richResponseSourcesMetadata != null) { + if (typeof d.richResponseSourcesMetadata !== "object") + throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected"); + m.richResponseSourcesMetadata = $root.proto.BotSourcesMetadata.fromObject(d.richResponseSourcesMetadata); + } + if (d.aiConversationContext != null) { + if (typeof d.aiConversationContext === "string") + $util.base64.decode(d.aiConversationContext, m.aiConversationContext = $util.newBuffer($util.base64.length(d.aiConversationContext)), 0); + else if (d.aiConversationContext.length >= 0) + m.aiConversationContext = d.aiConversationContext; + } + if (d.botPromotionMessageMetadata != null) { + if (typeof d.botPromotionMessageMetadata !== "object") + throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected"); + m.botPromotionMessageMetadata = $root.proto.BotPromotionMessageMetadata.fromObject(d.botPromotionMessageMetadata); + } + if (d.botModeSelectionMetadata != null) { + if (typeof d.botModeSelectionMetadata !== "object") + throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected"); + m.botModeSelectionMetadata = $root.proto.BotModeSelectionMetadata.fromObject(d.botModeSelectionMetadata); + } + if (d.botQuotaMetadata != null) { + if (typeof d.botQuotaMetadata !== "object") + throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected"); + m.botQuotaMetadata = $root.proto.BotQuotaMetadata.fromObject(d.botQuotaMetadata); + } + if (d.botAgeCollectionMetadata != null) { + if (typeof d.botAgeCollectionMetadata !== "object") + throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected"); + m.botAgeCollectionMetadata = $root.proto.BotAgeCollectionMetadata.fromObject(d.botAgeCollectionMetadata); + } + return m; + }; + + BotMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.avatarMetadata != null && m.hasOwnProperty("avatarMetadata")) { + d.avatarMetadata = $root.proto.BotAvatarMetadata.toObject(m.avatarMetadata, o); + if (o.oneofs) + d._avatarMetadata = "avatarMetadata"; + } + if (m.personaId != null && m.hasOwnProperty("personaId")) { + d.personaId = m.personaId; + if (o.oneofs) + d._personaId = "personaId"; + } + if (m.pluginMetadata != null && m.hasOwnProperty("pluginMetadata")) { + d.pluginMetadata = $root.proto.BotPluginMetadata.toObject(m.pluginMetadata, o); + if (o.oneofs) + d._pluginMetadata = "pluginMetadata"; + } + if (m.suggestedPromptMetadata != null && m.hasOwnProperty("suggestedPromptMetadata")) { + d.suggestedPromptMetadata = $root.proto.BotSuggestedPromptMetadata.toObject(m.suggestedPromptMetadata, o); + if (o.oneofs) + d._suggestedPromptMetadata = "suggestedPromptMetadata"; + } + if (m.invokerJid != null && m.hasOwnProperty("invokerJid")) { + d.invokerJid = m.invokerJid; + if (o.oneofs) + d._invokerJid = "invokerJid"; + } + if (m.sessionMetadata != null && m.hasOwnProperty("sessionMetadata")) { + d.sessionMetadata = $root.proto.BotSessionMetadata.toObject(m.sessionMetadata, o); + if (o.oneofs) + d._sessionMetadata = "sessionMetadata"; + } + if (m.memuMetadata != null && m.hasOwnProperty("memuMetadata")) { + d.memuMetadata = $root.proto.BotMemuMetadata.toObject(m.memuMetadata, o); + if (o.oneofs) + d._memuMetadata = "memuMetadata"; + } + if (m.timezone != null && m.hasOwnProperty("timezone")) { + d.timezone = m.timezone; + if (o.oneofs) + d._timezone = "timezone"; + } + if (m.reminderMetadata != null && m.hasOwnProperty("reminderMetadata")) { + d.reminderMetadata = $root.proto.BotReminderMetadata.toObject(m.reminderMetadata, o); + if (o.oneofs) + d._reminderMetadata = "reminderMetadata"; + } + if (m.modelMetadata != null && m.hasOwnProperty("modelMetadata")) { + d.modelMetadata = $root.proto.BotModelMetadata.toObject(m.modelMetadata, o); + if (o.oneofs) + d._modelMetadata = "modelMetadata"; + } + if (m.messageDisclaimerText != null && m.hasOwnProperty("messageDisclaimerText")) { + d.messageDisclaimerText = m.messageDisclaimerText; + if (o.oneofs) + d._messageDisclaimerText = "messageDisclaimerText"; + } + if (m.progressIndicatorMetadata != null && m.hasOwnProperty("progressIndicatorMetadata")) { + d.progressIndicatorMetadata = $root.proto.BotProgressIndicatorMetadata.toObject(m.progressIndicatorMetadata, o); + if (o.oneofs) + d._progressIndicatorMetadata = "progressIndicatorMetadata"; + } + if (m.capabilityMetadata != null && m.hasOwnProperty("capabilityMetadata")) { + d.capabilityMetadata = $root.proto.BotCapabilityMetadata.toObject(m.capabilityMetadata, o); + if (o.oneofs) + d._capabilityMetadata = "capabilityMetadata"; + } + if (m.imagineMetadata != null && m.hasOwnProperty("imagineMetadata")) { + d.imagineMetadata = $root.proto.BotImagineMetadata.toObject(m.imagineMetadata, o); + if (o.oneofs) + d._imagineMetadata = "imagineMetadata"; + } + if (m.memoryMetadata != null && m.hasOwnProperty("memoryMetadata")) { + d.memoryMetadata = $root.proto.BotMemoryMetadata.toObject(m.memoryMetadata, o); + if (o.oneofs) + d._memoryMetadata = "memoryMetadata"; + } + if (m.renderingMetadata != null && m.hasOwnProperty("renderingMetadata")) { + d.renderingMetadata = $root.proto.BotRenderingMetadata.toObject(m.renderingMetadata, o); + if (o.oneofs) + d._renderingMetadata = "renderingMetadata"; + } + if (m.botMetricsMetadata != null && m.hasOwnProperty("botMetricsMetadata")) { + d.botMetricsMetadata = $root.proto.BotMetricsMetadata.toObject(m.botMetricsMetadata, o); + if (o.oneofs) + d._botMetricsMetadata = "botMetricsMetadata"; + } + if (m.botLinkedAccountsMetadata != null && m.hasOwnProperty("botLinkedAccountsMetadata")) { + d.botLinkedAccountsMetadata = $root.proto.BotLinkedAccountsMetadata.toObject(m.botLinkedAccountsMetadata, o); + if (o.oneofs) + d._botLinkedAccountsMetadata = "botLinkedAccountsMetadata"; + } + if (m.richResponseSourcesMetadata != null && m.hasOwnProperty("richResponseSourcesMetadata")) { + d.richResponseSourcesMetadata = $root.proto.BotSourcesMetadata.toObject(m.richResponseSourcesMetadata, o); + if (o.oneofs) + d._richResponseSourcesMetadata = "richResponseSourcesMetadata"; + } + if (m.aiConversationContext != null && m.hasOwnProperty("aiConversationContext")) { + d.aiConversationContext = o.bytes === String ? $util.base64.encode(m.aiConversationContext, 0, m.aiConversationContext.length) : o.bytes === Array ? Array.prototype.slice.call(m.aiConversationContext) : m.aiConversationContext; + if (o.oneofs) + d._aiConversationContext = "aiConversationContext"; + } + if (m.botPromotionMessageMetadata != null && m.hasOwnProperty("botPromotionMessageMetadata")) { + d.botPromotionMessageMetadata = $root.proto.BotPromotionMessageMetadata.toObject(m.botPromotionMessageMetadata, o); + if (o.oneofs) + d._botPromotionMessageMetadata = "botPromotionMessageMetadata"; + } + if (m.botModeSelectionMetadata != null && m.hasOwnProperty("botModeSelectionMetadata")) { + d.botModeSelectionMetadata = $root.proto.BotModeSelectionMetadata.toObject(m.botModeSelectionMetadata, o); + if (o.oneofs) + d._botModeSelectionMetadata = "botModeSelectionMetadata"; + } + if (m.botQuotaMetadata != null && m.hasOwnProperty("botQuotaMetadata")) { + d.botQuotaMetadata = $root.proto.BotQuotaMetadata.toObject(m.botQuotaMetadata, o); + if (o.oneofs) + d._botQuotaMetadata = "botQuotaMetadata"; + } + if (m.botAgeCollectionMetadata != null && m.hasOwnProperty("botAgeCollectionMetadata")) { + d.botAgeCollectionMetadata = $root.proto.BotAgeCollectionMetadata.toObject(m.botAgeCollectionMetadata, o); + if (o.oneofs) + d._botAgeCollectionMetadata = "botAgeCollectionMetadata"; + } + return d; + }; + + BotMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3414,9 +7237,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotMetricsMetadata.prototype.destinationId = ""; - BotMetricsMetadata.prototype.destinationEntryPoint = 1; - BotMetricsMetadata.prototype.threadOrigin = 1; + BotMetricsMetadata.prototype.destinationId = null; + BotMetricsMetadata.prototype.destinationEntryPoint = null; + BotMetricsMetadata.prototype.threadOrigin = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetricsMetadata.prototype, "_destinationId", { + get: $util.oneOfGetter($oneOfFields = ["destinationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetricsMetadata.prototype, "_destinationEntryPoint", { + get: $util.oneOfGetter($oneOfFields = ["destinationEntryPoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotMetricsMetadata.prototype, "_threadOrigin", { + get: $util.oneOfGetter($oneOfFields = ["threadOrigin"]), + set: $util.oneOfSetter($oneOfFields) + }); BotMetricsMetadata.create = function create(properties) { return new BotMetricsMetadata(properties); @@ -3463,6 +7306,170 @@ export const proto = $root.proto = (() => { return m; }; + BotMetricsMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotMetricsMetadata) + return d; + var m = new $root.proto.BotMetricsMetadata(); + if (d.destinationId != null) { + m.destinationId = String(d.destinationId); + } + switch (d.destinationEntryPoint) { + default: + if (typeof d.destinationEntryPoint === "number") { + m.destinationEntryPoint = d.destinationEntryPoint; + break; + } + break; + case "FAVICON": + case 1: + m.destinationEntryPoint = 1; + break; + case "CHATLIST": + case 2: + m.destinationEntryPoint = 2; + break; + case "AISEARCH_NULL_STATE_PAPER_PLANE": + case 3: + m.destinationEntryPoint = 3; + break; + case "AISEARCH_NULL_STATE_SUGGESTION": + case 4: + m.destinationEntryPoint = 4; + break; + case "AISEARCH_TYPE_AHEAD_SUGGESTION": + case 5: + m.destinationEntryPoint = 5; + break; + case "AISEARCH_TYPE_AHEAD_PAPER_PLANE": + case 6: + m.destinationEntryPoint = 6; + break; + case "AISEARCH_TYPE_AHEAD_RESULT_CHATLIST": + case 7: + m.destinationEntryPoint = 7; + break; + case "AISEARCH_TYPE_AHEAD_RESULT_MESSAGES": + case 8: + m.destinationEntryPoint = 8; + break; + case "AIVOICE_SEARCH_BAR": + case 9: + m.destinationEntryPoint = 9; + break; + case "AIVOICE_FAVICON": + case 10: + m.destinationEntryPoint = 10; + break; + case "AISTUDIO": + case 11: + m.destinationEntryPoint = 11; + break; + case "DEEPLINK": + case 12: + m.destinationEntryPoint = 12; + break; + case "NOTIFICATION": + case 13: + m.destinationEntryPoint = 13; + break; + case "PROFILE_MESSAGE_BUTTON": + case 14: + m.destinationEntryPoint = 14; + break; + case "FORWARD": + case 15: + m.destinationEntryPoint = 15; + break; + case "APP_SHORTCUT": + case 16: + m.destinationEntryPoint = 16; + break; + case "FF_FAMILY": + case 17: + m.destinationEntryPoint = 17; + break; + case "AI_TAB": + case 18: + m.destinationEntryPoint = 18; + break; + case "AI_HOME": + case 19: + m.destinationEntryPoint = 19; + break; + case "AI_DEEPLINK_IMMERSIVE": + case 20: + m.destinationEntryPoint = 20; + break; + case "AI_DEEPLINK": + case 21: + m.destinationEntryPoint = 21; + break; + case "META_AI_CHAT_SHORTCUT_AI_STUDIO": + case 22: + m.destinationEntryPoint = 22; + break; + case "UGC_CHAT_SHORTCUT_AI_STUDIO": + case 23: + m.destinationEntryPoint = 23; + break; + case "NEW_CHAT_AI_STUDIO": + case 24: + m.destinationEntryPoint = 24; + break; + } + switch (d.threadOrigin) { + default: + if (typeof d.threadOrigin === "number") { + m.threadOrigin = d.threadOrigin; + break; + } + break; + case "AI_TAB_THREAD": + case 1: + m.threadOrigin = 1; + break; + case "AI_HOME_THREAD": + case 2: + m.threadOrigin = 2; + break; + case "AI_DEEPLINK_IMMERSIVE_THREAD": + case 3: + m.threadOrigin = 3; + break; + case "AI_DEEPLINK_THREAD": + case 4: + m.threadOrigin = 4; + break; + } + return m; + }; + + BotMetricsMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.destinationId != null && m.hasOwnProperty("destinationId")) { + d.destinationId = m.destinationId; + if (o.oneofs) + d._destinationId = "destinationId"; + } + if (m.destinationEntryPoint != null && m.hasOwnProperty("destinationEntryPoint")) { + d.destinationEntryPoint = o.enums === String ? $root.proto.BotMetricsEntryPoint[m.destinationEntryPoint] === undefined ? m.destinationEntryPoint : $root.proto.BotMetricsEntryPoint[m.destinationEntryPoint] : m.destinationEntryPoint; + if (o.oneofs) + d._destinationEntryPoint = "destinationEntryPoint"; + } + if (m.threadOrigin != null && m.hasOwnProperty("threadOrigin")) { + d.threadOrigin = o.enums === String ? $root.proto.BotMetricsThreadEntryPoint[m.threadOrigin] === undefined ? m.threadOrigin : $root.proto.BotMetricsThreadEntryPoint[m.threadOrigin] : m.threadOrigin; + if (o.oneofs) + d._threadOrigin = "threadOrigin"; + } + return d; + }; + + BotMetricsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotMetricsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3502,8 +7509,10 @@ export const proto = $root.proto = (() => { if (!w) w = $Writer.create(); if (m.mode != null && m.mode.length) { + w.uint32(10).fork(); for (var i = 0; i < m.mode.length; ++i) - w.uint32(8).int32(m.mode[i]); + w.int32(m.mode[i]); + w.ldelim(); } return w; }; @@ -3536,6 +7545,55 @@ export const proto = $root.proto = (() => { return m; }; + BotModeSelectionMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotModeSelectionMetadata) + return d; + var m = new $root.proto.BotModeSelectionMetadata(); + if (d.mode) { + if (!Array.isArray(d.mode)) + throw TypeError(".proto.BotModeSelectionMetadata.mode: array expected"); + m.mode = []; + for (var i = 0; i < d.mode.length; ++i) { + switch (d.mode[i]) { + default: + if (typeof d.mode[i] === "number") { + m.mode[i] = d.mode[i]; + break; + } + case "UNKNOWN_MODE": + case 0: + m.mode[i] = 0; + break; + case "REASONING_MODE": + case 1: + m.mode[i] = 1; + break; + } + } + } + return m; + }; + + BotModeSelectionMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.mode = []; + } + if (m.mode && m.mode.length) { + d.mode = []; + for (var j = 0; j < m.mode.length; ++j) { + d.mode[j] = o.enums === String ? $root.proto.BotModeSelectionMetadata.BotUserSelectionMode[m.mode[j]] === undefined ? m.mode[j] : $root.proto.BotModeSelectionMetadata.BotUserSelectionMode[m.mode[j]] : m.mode[j]; + } + } + return d; + }; + + BotModeSelectionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotModeSelectionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3562,8 +7620,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotModelMetadata.prototype.modelType = 0; - BotModelMetadata.prototype.premiumModelStatus = 0; + BotModelMetadata.prototype.modelType = null; + BotModelMetadata.prototype.premiumModelStatus = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotModelMetadata.prototype, "_modelType", { + get: $util.oneOfGetter($oneOfFields = ["modelType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotModelMetadata.prototype, "_premiumModelStatus", { + get: $util.oneOfGetter($oneOfFields = ["premiumModelStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); BotModelMetadata.create = function create(properties) { return new BotModelMetadata(properties); @@ -3604,6 +7676,74 @@ export const proto = $root.proto = (() => { return m; }; + BotModelMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotModelMetadata) + return d; + var m = new $root.proto.BotModelMetadata(); + switch (d.modelType) { + default: + if (typeof d.modelType === "number") { + m.modelType = d.modelType; + break; + } + break; + case "UNKNOWN_TYPE": + case 0: + m.modelType = 0; + break; + case "LLAMA_PROD": + case 1: + m.modelType = 1; + break; + case "LLAMA_PROD_PREMIUM": + case 2: + m.modelType = 2; + break; + } + switch (d.premiumModelStatus) { + default: + if (typeof d.premiumModelStatus === "number") { + m.premiumModelStatus = d.premiumModelStatus; + break; + } + break; + case "UNKNOWN_STATUS": + case 0: + m.premiumModelStatus = 0; + break; + case "AVAILABLE": + case 1: + m.premiumModelStatus = 1; + break; + case "QUOTA_EXCEED_LIMIT": + case 2: + m.premiumModelStatus = 2; + break; + } + return m; + }; + + BotModelMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.modelType != null && m.hasOwnProperty("modelType")) { + d.modelType = o.enums === String ? $root.proto.BotModelMetadata.ModelType[m.modelType] === undefined ? m.modelType : $root.proto.BotModelMetadata.ModelType[m.modelType] : m.modelType; + if (o.oneofs) + d._modelType = "modelType"; + } + if (m.premiumModelStatus != null && m.hasOwnProperty("premiumModelStatus")) { + d.premiumModelStatus = o.enums === String ? $root.proto.BotModelMetadata.PremiumModelStatus[m.premiumModelStatus] === undefined ? m.premiumModelStatus : $root.proto.BotModelMetadata.PremiumModelStatus[m.premiumModelStatus] : m.premiumModelStatus; + if (o.oneofs) + d._premiumModelStatus = "premiumModelStatus"; + } + return d; + }; + + BotModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3639,18 +7779,92 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPluginMetadata.prototype.provider = 0; - BotPluginMetadata.prototype.pluginType = 0; - BotPluginMetadata.prototype.thumbnailCdnUrl = ""; - BotPluginMetadata.prototype.profilePhotoCdnUrl = ""; - BotPluginMetadata.prototype.searchProviderUrl = ""; - BotPluginMetadata.prototype.referenceIndex = 0; - BotPluginMetadata.prototype.expectedLinksCount = 0; - BotPluginMetadata.prototype.searchQuery = ""; + BotPluginMetadata.prototype.provider = null; + BotPluginMetadata.prototype.pluginType = null; + BotPluginMetadata.prototype.thumbnailCdnUrl = null; + BotPluginMetadata.prototype.profilePhotoCdnUrl = null; + BotPluginMetadata.prototype.searchProviderUrl = null; + BotPluginMetadata.prototype.referenceIndex = null; + BotPluginMetadata.prototype.expectedLinksCount = null; + BotPluginMetadata.prototype.searchQuery = null; BotPluginMetadata.prototype.parentPluginMessageKey = null; - BotPluginMetadata.prototype.deprecatedField = 0; - BotPluginMetadata.prototype.parentPluginType = 0; - BotPluginMetadata.prototype.faviconCdnUrl = ""; + BotPluginMetadata.prototype.deprecatedField = null; + BotPluginMetadata.prototype.parentPluginType = null; + BotPluginMetadata.prototype.faviconCdnUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_provider", { + get: $util.oneOfGetter($oneOfFields = ["provider"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_pluginType", { + get: $util.oneOfGetter($oneOfFields = ["pluginType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_thumbnailCdnUrl", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailCdnUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_profilePhotoCdnUrl", { + get: $util.oneOfGetter($oneOfFields = ["profilePhotoCdnUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_searchProviderUrl", { + get: $util.oneOfGetter($oneOfFields = ["searchProviderUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_referenceIndex", { + get: $util.oneOfGetter($oneOfFields = ["referenceIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_expectedLinksCount", { + get: $util.oneOfGetter($oneOfFields = ["expectedLinksCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_searchQuery", { + get: $util.oneOfGetter($oneOfFields = ["searchQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_parentPluginMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["parentPluginMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_deprecatedField", { + get: $util.oneOfGetter($oneOfFields = ["deprecatedField"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_parentPluginType", { + get: $util.oneOfGetter($oneOfFields = ["parentPluginType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPluginMetadata.prototype, "_faviconCdnUrl", { + get: $util.oneOfGetter($oneOfFields = ["faviconCdnUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); BotPluginMetadata.create = function create(properties) { return new BotPluginMetadata(properties); @@ -3751,6 +7965,194 @@ export const proto = $root.proto = (() => { return m; }; + BotPluginMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotPluginMetadata) + return d; + var m = new $root.proto.BotPluginMetadata(); + switch (d.provider) { + default: + if (typeof d.provider === "number") { + m.provider = d.provider; + break; + } + break; + case "UNKNOWN": + case 0: + m.provider = 0; + break; + case "BING": + case 1: + m.provider = 1; + break; + case "GOOGLE": + case 2: + m.provider = 2; + break; + case "SUPPORT": + case 3: + m.provider = 3; + break; + } + switch (d.pluginType) { + default: + if (typeof d.pluginType === "number") { + m.pluginType = d.pluginType; + break; + } + break; + case "UNKNOWN_PLUGIN": + case 0: + m.pluginType = 0; + break; + case "REELS": + case 1: + m.pluginType = 1; + break; + case "SEARCH": + case 2: + m.pluginType = 2; + break; + } + if (d.thumbnailCdnUrl != null) { + m.thumbnailCdnUrl = String(d.thumbnailCdnUrl); + } + if (d.profilePhotoCdnUrl != null) { + m.profilePhotoCdnUrl = String(d.profilePhotoCdnUrl); + } + if (d.searchProviderUrl != null) { + m.searchProviderUrl = String(d.searchProviderUrl); + } + if (d.referenceIndex != null) { + m.referenceIndex = d.referenceIndex >>> 0; + } + if (d.expectedLinksCount != null) { + m.expectedLinksCount = d.expectedLinksCount >>> 0; + } + if (d.searchQuery != null) { + m.searchQuery = String(d.searchQuery); + } + if (d.parentPluginMessageKey != null) { + if (typeof d.parentPluginMessageKey !== "object") + throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected"); + m.parentPluginMessageKey = $root.proto.MessageKey.fromObject(d.parentPluginMessageKey); + } + switch (d.deprecatedField) { + default: + if (typeof d.deprecatedField === "number") { + m.deprecatedField = d.deprecatedField; + break; + } + break; + case "UNKNOWN_PLUGIN": + case 0: + m.deprecatedField = 0; + break; + case "REELS": + case 1: + m.deprecatedField = 1; + break; + case "SEARCH": + case 2: + m.deprecatedField = 2; + break; + } + switch (d.parentPluginType) { + default: + if (typeof d.parentPluginType === "number") { + m.parentPluginType = d.parentPluginType; + break; + } + break; + case "UNKNOWN_PLUGIN": + case 0: + m.parentPluginType = 0; + break; + case "REELS": + case 1: + m.parentPluginType = 1; + break; + case "SEARCH": + case 2: + m.parentPluginType = 2; + break; + } + if (d.faviconCdnUrl != null) { + m.faviconCdnUrl = String(d.faviconCdnUrl); + } + return m; + }; + + BotPluginMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.provider != null && m.hasOwnProperty("provider")) { + d.provider = o.enums === String ? $root.proto.BotPluginMetadata.SearchProvider[m.provider] === undefined ? m.provider : $root.proto.BotPluginMetadata.SearchProvider[m.provider] : m.provider; + if (o.oneofs) + d._provider = "provider"; + } + if (m.pluginType != null && m.hasOwnProperty("pluginType")) { + d.pluginType = o.enums === String ? $root.proto.BotPluginMetadata.PluginType[m.pluginType] === undefined ? m.pluginType : $root.proto.BotPluginMetadata.PluginType[m.pluginType] : m.pluginType; + if (o.oneofs) + d._pluginType = "pluginType"; + } + if (m.thumbnailCdnUrl != null && m.hasOwnProperty("thumbnailCdnUrl")) { + d.thumbnailCdnUrl = m.thumbnailCdnUrl; + if (o.oneofs) + d._thumbnailCdnUrl = "thumbnailCdnUrl"; + } + if (m.profilePhotoCdnUrl != null && m.hasOwnProperty("profilePhotoCdnUrl")) { + d.profilePhotoCdnUrl = m.profilePhotoCdnUrl; + if (o.oneofs) + d._profilePhotoCdnUrl = "profilePhotoCdnUrl"; + } + if (m.searchProviderUrl != null && m.hasOwnProperty("searchProviderUrl")) { + d.searchProviderUrl = m.searchProviderUrl; + if (o.oneofs) + d._searchProviderUrl = "searchProviderUrl"; + } + if (m.referenceIndex != null && m.hasOwnProperty("referenceIndex")) { + d.referenceIndex = m.referenceIndex; + if (o.oneofs) + d._referenceIndex = "referenceIndex"; + } + if (m.expectedLinksCount != null && m.hasOwnProperty("expectedLinksCount")) { + d.expectedLinksCount = m.expectedLinksCount; + if (o.oneofs) + d._expectedLinksCount = "expectedLinksCount"; + } + if (m.searchQuery != null && m.hasOwnProperty("searchQuery")) { + d.searchQuery = m.searchQuery; + if (o.oneofs) + d._searchQuery = "searchQuery"; + } + if (m.parentPluginMessageKey != null && m.hasOwnProperty("parentPluginMessageKey")) { + d.parentPluginMessageKey = $root.proto.MessageKey.toObject(m.parentPluginMessageKey, o); + if (o.oneofs) + d._parentPluginMessageKey = "parentPluginMessageKey"; + } + if (m.deprecatedField != null && m.hasOwnProperty("deprecatedField")) { + d.deprecatedField = o.enums === String ? $root.proto.BotPluginMetadata.PluginType[m.deprecatedField] === undefined ? m.deprecatedField : $root.proto.BotPluginMetadata.PluginType[m.deprecatedField] : m.deprecatedField; + if (o.oneofs) + d._deprecatedField = "deprecatedField"; + } + if (m.parentPluginType != null && m.hasOwnProperty("parentPluginType")) { + d.parentPluginType = o.enums === String ? $root.proto.BotPluginMetadata.PluginType[m.parentPluginType] === undefined ? m.parentPluginType : $root.proto.BotPluginMetadata.PluginType[m.parentPluginType] : m.parentPluginType; + if (o.oneofs) + d._parentPluginType = "parentPluginType"; + } + if (m.faviconCdnUrl != null && m.hasOwnProperty("faviconCdnUrl")) { + d.faviconCdnUrl = m.faviconCdnUrl; + if (o.oneofs) + d._faviconCdnUrl = "faviconCdnUrl"; + } + return d; + }; + + BotPluginMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPluginMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3788,9 +8190,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotProgressIndicatorMetadata.prototype.progressDescription = ""; + BotProgressIndicatorMetadata.prototype.progressDescription = null; BotProgressIndicatorMetadata.prototype.stepsMetadata = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotProgressIndicatorMetadata.prototype, "_progressDescription", { + get: $util.oneOfGetter($oneOfFields = ["progressDescription"]), + set: $util.oneOfSetter($oneOfFields) + }); + BotProgressIndicatorMetadata.create = function create(properties) { return new BotProgressIndicatorMetadata(properties); }; @@ -3834,6 +8244,51 @@ export const proto = $root.proto = (() => { return m; }; + BotProgressIndicatorMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotProgressIndicatorMetadata) + return d; + var m = new $root.proto.BotProgressIndicatorMetadata(); + if (d.progressDescription != null) { + m.progressDescription = String(d.progressDescription); + } + if (d.stepsMetadata) { + if (!Array.isArray(d.stepsMetadata)) + throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected"); + m.stepsMetadata = []; + for (var i = 0; i < d.stepsMetadata.length; ++i) { + if (typeof d.stepsMetadata[i] !== "object") + throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: object expected"); + m.stepsMetadata[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.fromObject(d.stepsMetadata[i]); + } + } + return m; + }; + + BotProgressIndicatorMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.stepsMetadata = []; + } + if (m.progressDescription != null && m.hasOwnProperty("progressDescription")) { + d.progressDescription = m.progressDescription; + if (o.oneofs) + d._progressDescription = "progressDescription"; + } + if (m.stepsMetadata && m.stepsMetadata.length) { + d.stepsMetadata = []; + for (var j = 0; j < m.stepsMetadata.length; ++j) { + d.stepsMetadata[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.toObject(m.stepsMetadata[j], o); + } + } + return d; + }; + + BotProgressIndicatorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotProgressIndicatorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3852,14 +8307,46 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPlanningStepMetadata.prototype.statusTitle = ""; - BotPlanningStepMetadata.prototype.statusBody = ""; + BotPlanningStepMetadata.prototype.statusTitle = null; + BotPlanningStepMetadata.prototype.statusBody = null; BotPlanningStepMetadata.prototype.sourcesMetadata = $util.emptyArray; - BotPlanningStepMetadata.prototype.status = 0; - BotPlanningStepMetadata.prototype.isReasoning = false; - BotPlanningStepMetadata.prototype.isEnhancedSearch = false; + BotPlanningStepMetadata.prototype.status = null; + BotPlanningStepMetadata.prototype.isReasoning = null; + BotPlanningStepMetadata.prototype.isEnhancedSearch = null; BotPlanningStepMetadata.prototype.sections = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepMetadata.prototype, "_statusTitle", { + get: $util.oneOfGetter($oneOfFields = ["statusTitle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepMetadata.prototype, "_statusBody", { + get: $util.oneOfGetter($oneOfFields = ["statusBody"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepMetadata.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepMetadata.prototype, "_isReasoning", { + get: $util.oneOfGetter($oneOfFields = ["isReasoning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepMetadata.prototype, "_isEnhancedSearch", { + get: $util.oneOfGetter($oneOfFields = ["isEnhancedSearch"]), + set: $util.oneOfSetter($oneOfFields) + }); + BotPlanningStepMetadata.create = function create(properties) { return new BotPlanningStepMetadata(properties); }; @@ -3937,6 +8424,121 @@ export const proto = $root.proto = (() => { return m; }; + BotPlanningStepMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata) + return d; + var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata(); + if (d.statusTitle != null) { + m.statusTitle = String(d.statusTitle); + } + if (d.statusBody != null) { + m.statusBody = String(d.statusBody); + } + if (d.sourcesMetadata) { + if (!Array.isArray(d.sourcesMetadata)) + throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected"); + m.sourcesMetadata = []; + for (var i = 0; i < d.sourcesMetadata.length; ++i) { + if (typeof d.sourcesMetadata[i] !== "object") + throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: object expected"); + m.sourcesMetadata[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.fromObject(d.sourcesMetadata[i]); + } + } + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "UNKNOWN": + case 0: + m.status = 0; + break; + case "PLANNED": + case 1: + m.status = 1; + break; + case "EXECUTING": + case 2: + m.status = 2; + break; + case "FINISHED": + case 3: + m.status = 3; + break; + } + if (d.isReasoning != null) { + m.isReasoning = Boolean(d.isReasoning); + } + if (d.isEnhancedSearch != null) { + m.isEnhancedSearch = Boolean(d.isEnhancedSearch); + } + if (d.sections) { + if (!Array.isArray(d.sections)) + throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sections: array expected"); + m.sections = []; + for (var i = 0; i < d.sections.length; ++i) { + if (typeof d.sections[i] !== "object") + throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sections: object expected"); + m.sections[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.fromObject(d.sections[i]); + } + } + return m; + }; + + BotPlanningStepMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.sourcesMetadata = []; + d.sections = []; + } + if (m.statusTitle != null && m.hasOwnProperty("statusTitle")) { + d.statusTitle = m.statusTitle; + if (o.oneofs) + d._statusTitle = "statusTitle"; + } + if (m.statusBody != null && m.hasOwnProperty("statusBody")) { + d.statusBody = m.statusBody; + if (o.oneofs) + d._statusBody = "statusBody"; + } + if (m.sourcesMetadata && m.sourcesMetadata.length) { + d.sourcesMetadata = []; + for (var j = 0; j < m.sourcesMetadata.length; ++j) { + d.sourcesMetadata[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.toObject(m.sourcesMetadata[j], o); + } + } + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.PlanningStepStatus[m.status] === undefined ? m.status : $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.PlanningStepStatus[m.status] : m.status; + if (o.oneofs) + d._status = "status"; + } + if (m.isReasoning != null && m.hasOwnProperty("isReasoning")) { + d.isReasoning = m.isReasoning; + if (o.oneofs) + d._isReasoning = "isReasoning"; + } + if (m.isEnhancedSearch != null && m.hasOwnProperty("isEnhancedSearch")) { + d.isEnhancedSearch = m.isEnhancedSearch; + if (o.oneofs) + d._isEnhancedSearch = "isEnhancedSearch"; + } + if (m.sections && m.sections.length) { + d.sections = []; + for (var j = 0; j < m.sections.length; ++j) { + d.sections[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.toObject(m.sections[j], o); + } + } + return d; + }; + + BotPlanningStepMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPlanningStepMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -3953,10 +8555,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPlanningSearchSourceMetadata.prototype.title = ""; - BotPlanningSearchSourceMetadata.prototype.provider = 0; - BotPlanningSearchSourceMetadata.prototype.sourceUrl = ""; - BotPlanningSearchSourceMetadata.prototype.favIconUrl = ""; + BotPlanningSearchSourceMetadata.prototype.title = null; + BotPlanningSearchSourceMetadata.prototype.provider = null; + BotPlanningSearchSourceMetadata.prototype.sourceUrl = null; + BotPlanningSearchSourceMetadata.prototype.favIconUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_provider", { + get: $util.oneOfGetter($oneOfFields = ["provider"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_sourceUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourceMetadata.prototype, "_favIconUrl", { + get: $util.oneOfGetter($oneOfFields = ["favIconUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); BotPlanningSearchSourceMetadata.create = function create(properties) { return new BotPlanningSearchSourceMetadata(properties); @@ -4009,6 +8637,77 @@ export const proto = $root.proto = (() => { return m; }; + BotPlanningSearchSourceMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata) + return d; + var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata(); + if (d.title != null) { + m.title = String(d.title); + } + switch (d.provider) { + default: + if (typeof d.provider === "number") { + m.provider = d.provider; + break; + } + break; + case "UNKNOWN_PROVIDER": + case 0: + m.provider = 0; + break; + case "OTHER": + case 1: + m.provider = 1; + break; + case "GOOGLE": + case 2: + m.provider = 2; + break; + case "BING": + case 3: + m.provider = 3; + break; + } + if (d.sourceUrl != null) { + m.sourceUrl = String(d.sourceUrl); + } + if (d.favIconUrl != null) { + m.favIconUrl = String(d.favIconUrl); + } + return m; + }; + + BotPlanningSearchSourceMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.provider != null && m.hasOwnProperty("provider")) { + d.provider = o.enums === String ? $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[m.provider] === undefined ? m.provider : $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[m.provider] : m.provider; + if (o.oneofs) + d._provider = "provider"; + } + if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) { + d.sourceUrl = m.sourceUrl; + if (o.oneofs) + d._sourceUrl = "sourceUrl"; + } + if (m.favIconUrl != null && m.hasOwnProperty("favIconUrl")) { + d.favIconUrl = m.favIconUrl; + if (o.oneofs) + d._favIconUrl = "favIconUrl"; + } + return d; + }; + + BotPlanningSearchSourceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPlanningSearchSourceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4028,9 +8727,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPlanningSearchSourcesMetadata.prototype.sourceTitle = ""; - BotPlanningSearchSourcesMetadata.prototype.provider = 0; - BotPlanningSearchSourcesMetadata.prototype.sourceUrl = ""; + BotPlanningSearchSourcesMetadata.prototype.sourceTitle = null; + BotPlanningSearchSourcesMetadata.prototype.provider = null; + BotPlanningSearchSourcesMetadata.prototype.sourceUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourcesMetadata.prototype, "_sourceTitle", { + get: $util.oneOfGetter($oneOfFields = ["sourceTitle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourcesMetadata.prototype, "_provider", { + get: $util.oneOfGetter($oneOfFields = ["provider"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningSearchSourcesMetadata.prototype, "_sourceUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); BotPlanningSearchSourcesMetadata.create = function create(properties) { return new BotPlanningSearchSourcesMetadata(properties); @@ -4077,6 +8796,69 @@ export const proto = $root.proto = (() => { return m; }; + BotPlanningSearchSourcesMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata) + return d; + var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata(); + if (d.sourceTitle != null) { + m.sourceTitle = String(d.sourceTitle); + } + switch (d.provider) { + default: + if (typeof d.provider === "number") { + m.provider = d.provider; + break; + } + break; + case "UNKNOWN": + case 0: + m.provider = 0; + break; + case "OTHER": + case 1: + m.provider = 1; + break; + case "GOOGLE": + case 2: + m.provider = 2; + break; + case "BING": + case 3: + m.provider = 3; + break; + } + if (d.sourceUrl != null) { + m.sourceUrl = String(d.sourceUrl); + } + return m; + }; + + BotPlanningSearchSourcesMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.sourceTitle != null && m.hasOwnProperty("sourceTitle")) { + d.sourceTitle = m.sourceTitle; + if (o.oneofs) + d._sourceTitle = "sourceTitle"; + } + if (m.provider != null && m.hasOwnProperty("provider")) { + d.provider = o.enums === String ? $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[m.provider] === undefined ? m.provider : $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[m.provider] : m.provider; + if (o.oneofs) + d._provider = "provider"; + } + if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) { + d.sourceUrl = m.sourceUrl; + if (o.oneofs) + d._sourceUrl = "sourceUrl"; + } + return d; + }; + + BotPlanningSearchSourcesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPlanningSearchSourcesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4106,10 +8888,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPlanningStepSectionMetadata.prototype.sectionTitle = ""; - BotPlanningStepSectionMetadata.prototype.sectionBody = ""; + BotPlanningStepSectionMetadata.prototype.sectionTitle = null; + BotPlanningStepSectionMetadata.prototype.sectionBody = null; BotPlanningStepSectionMetadata.prototype.sourcesMetadata = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepSectionMetadata.prototype, "_sectionTitle", { + get: $util.oneOfGetter($oneOfFields = ["sectionTitle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPlanningStepSectionMetadata.prototype, "_sectionBody", { + get: $util.oneOfGetter($oneOfFields = ["sectionBody"]), + set: $util.oneOfSetter($oneOfFields) + }); + BotPlanningStepSectionMetadata.create = function create(properties) { return new BotPlanningStepSectionMetadata(properties); }; @@ -4159,6 +8955,59 @@ export const proto = $root.proto = (() => { return m; }; + BotPlanningStepSectionMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata) + return d; + var m = new $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata(); + if (d.sectionTitle != null) { + m.sectionTitle = String(d.sectionTitle); + } + if (d.sectionBody != null) { + m.sectionBody = String(d.sectionBody); + } + if (d.sourcesMetadata) { + if (!Array.isArray(d.sourcesMetadata)) + throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected"); + m.sourcesMetadata = []; + for (var i = 0; i < d.sourcesMetadata.length; ++i) { + if (typeof d.sourcesMetadata[i] !== "object") + throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: object expected"); + m.sourcesMetadata[i] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.fromObject(d.sourcesMetadata[i]); + } + } + return m; + }; + + BotPlanningStepSectionMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.sourcesMetadata = []; + } + if (m.sectionTitle != null && m.hasOwnProperty("sectionTitle")) { + d.sectionTitle = m.sectionTitle; + if (o.oneofs) + d._sectionTitle = "sectionTitle"; + } + if (m.sectionBody != null && m.hasOwnProperty("sectionBody")) { + d.sectionBody = m.sectionBody; + if (o.oneofs) + d._sectionBody = "sectionBody"; + } + if (m.sourcesMetadata && m.sourcesMetadata.length) { + d.sourcesMetadata = []; + for (var j = 0; j < m.sourcesMetadata.length; ++j) { + d.sourcesMetadata[j] = $root.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.toObject(m.sourcesMetadata[j], o); + } + } + return d; + }; + + BotPlanningStepSectionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPlanningStepSectionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4202,8 +9051,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPromotionMessageMetadata.prototype.promotionType = 0; - BotPromotionMessageMetadata.prototype.buttonTitle = ""; + BotPromotionMessageMetadata.prototype.promotionType = null; + BotPromotionMessageMetadata.prototype.buttonTitle = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPromotionMessageMetadata.prototype, "_promotionType", { + get: $util.oneOfGetter($oneOfFields = ["promotionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPromotionMessageMetadata.prototype, "_buttonTitle", { + get: $util.oneOfGetter($oneOfFields = ["buttonTitle"]), + set: $util.oneOfSetter($oneOfFields) + }); BotPromotionMessageMetadata.create = function create(properties) { return new BotPromotionMessageMetadata(properties); @@ -4244,6 +9107,53 @@ export const proto = $root.proto = (() => { return m; }; + BotPromotionMessageMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotPromotionMessageMetadata) + return d; + var m = new $root.proto.BotPromotionMessageMetadata(); + switch (d.promotionType) { + default: + if (typeof d.promotionType === "number") { + m.promotionType = d.promotionType; + break; + } + break; + case "UNKNOWN_TYPE": + case 0: + m.promotionType = 0; + break; + case "C50": + case 1: + m.promotionType = 1; + break; + } + if (d.buttonTitle != null) { + m.buttonTitle = String(d.buttonTitle); + } + return m; + }; + + BotPromotionMessageMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.promotionType != null && m.hasOwnProperty("promotionType")) { + d.promotionType = o.enums === String ? $root.proto.BotPromotionMessageMetadata.BotPromotionType[m.promotionType] === undefined ? m.promotionType : $root.proto.BotPromotionMessageMetadata.BotPromotionType[m.promotionType] : m.promotionType; + if (o.oneofs) + d._promotionType = "promotionType"; + } + if (m.buttonTitle != null && m.hasOwnProperty("buttonTitle")) { + d.buttonTitle = m.buttonTitle; + if (o.oneofs) + d._buttonTitle = "buttonTitle"; + } + return d; + }; + + BotPromotionMessageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPromotionMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4270,8 +9180,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotPromptSuggestion.prototype.prompt = ""; - BotPromptSuggestion.prototype.promptId = ""; + BotPromptSuggestion.prototype.prompt = null; + BotPromptSuggestion.prototype.promptId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPromptSuggestion.prototype, "_prompt", { + get: $util.oneOfGetter($oneOfFields = ["prompt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotPromptSuggestion.prototype, "_promptId", { + get: $util.oneOfGetter($oneOfFields = ["promptId"]), + set: $util.oneOfSetter($oneOfFields) + }); BotPromptSuggestion.create = function create(properties) { return new BotPromptSuggestion(properties); @@ -4312,6 +9236,40 @@ export const proto = $root.proto = (() => { return m; }; + BotPromptSuggestion.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotPromptSuggestion) + return d; + var m = new $root.proto.BotPromptSuggestion(); + if (d.prompt != null) { + m.prompt = String(d.prompt); + } + if (d.promptId != null) { + m.promptId = String(d.promptId); + } + return m; + }; + + BotPromptSuggestion.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.prompt != null && m.hasOwnProperty("prompt")) { + d.prompt = m.prompt; + if (o.oneofs) + d._prompt = "prompt"; + } + if (m.promptId != null && m.hasOwnProperty("promptId")) { + d.promptId = m.promptId; + if (o.oneofs) + d._promptId = "promptId"; + } + return d; + }; + + BotPromptSuggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPromptSuggestion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4371,6 +9329,43 @@ export const proto = $root.proto = (() => { return m; }; + BotPromptSuggestions.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotPromptSuggestions) + return d; + var m = new $root.proto.BotPromptSuggestions(); + if (d.suggestions) { + if (!Array.isArray(d.suggestions)) + throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected"); + m.suggestions = []; + for (var i = 0; i < d.suggestions.length; ++i) { + if (typeof d.suggestions[i] !== "object") + throw TypeError(".proto.BotPromptSuggestions.suggestions: object expected"); + m.suggestions[i] = $root.proto.BotPromptSuggestion.fromObject(d.suggestions[i]); + } + } + return m; + }; + + BotPromptSuggestions.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.suggestions = []; + } + if (m.suggestions && m.suggestions.length) { + d.suggestions = []; + for (var j = 0; j < m.suggestions.length; ++j) { + d.suggestions[j] = $root.proto.BotPromptSuggestion.toObject(m.suggestions[j], o); + } + } + return d; + }; + + BotPromptSuggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotPromptSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4430,6 +9425,43 @@ export const proto = $root.proto = (() => { return m; }; + BotQuotaMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotQuotaMetadata) + return d; + var m = new $root.proto.BotQuotaMetadata(); + if (d.botFeatureQuotaMetadata) { + if (!Array.isArray(d.botFeatureQuotaMetadata)) + throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected"); + m.botFeatureQuotaMetadata = []; + for (var i = 0; i < d.botFeatureQuotaMetadata.length; ++i) { + if (typeof d.botFeatureQuotaMetadata[i] !== "object") + throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: object expected"); + m.botFeatureQuotaMetadata[i] = $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.fromObject(d.botFeatureQuotaMetadata[i]); + } + } + return m; + }; + + BotQuotaMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.botFeatureQuotaMetadata = []; + } + if (m.botFeatureQuotaMetadata && m.botFeatureQuotaMetadata.length) { + d.botFeatureQuotaMetadata = []; + for (var j = 0; j < m.botFeatureQuotaMetadata.length; ++j) { + d.botFeatureQuotaMetadata[j] = $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.toObject(m.botFeatureQuotaMetadata[j], o); + } + } + return d; + }; + + BotQuotaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotQuotaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4446,9 +9478,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotFeatureQuotaMetadata.prototype.featureType = 0; - BotFeatureQuotaMetadata.prototype.remainingQuota = 0; - BotFeatureQuotaMetadata.prototype.expirationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + BotFeatureQuotaMetadata.prototype.featureType = null; + BotFeatureQuotaMetadata.prototype.remainingQuota = null; + BotFeatureQuotaMetadata.prototype.expirationTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeatureQuotaMetadata.prototype, "_featureType", { + get: $util.oneOfGetter($oneOfFields = ["featureType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeatureQuotaMetadata.prototype, "_remainingQuota", { + get: $util.oneOfGetter($oneOfFields = ["remainingQuota"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeatureQuotaMetadata.prototype, "_expirationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["expirationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); BotFeatureQuotaMetadata.create = function create(properties) { return new BotFeatureQuotaMetadata(properties); @@ -4495,6 +9547,71 @@ export const proto = $root.proto = (() => { return m; }; + BotFeatureQuotaMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata) + return d; + var m = new $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata(); + switch (d.featureType) { + default: + if (typeof d.featureType === "number") { + m.featureType = d.featureType; + break; + } + break; + case "UNKNOWN_FEATURE": + case 0: + m.featureType = 0; + break; + case "REASONING_FEATURE": + case 1: + m.featureType = 1; + break; + } + if (d.remainingQuota != null) { + m.remainingQuota = d.remainingQuota >>> 0; + } + if (d.expirationTimestamp != null) { + if ($util.Long) + (m.expirationTimestamp = $util.Long.fromValue(d.expirationTimestamp)).unsigned = true; + else if (typeof d.expirationTimestamp === "string") + m.expirationTimestamp = parseInt(d.expirationTimestamp, 10); + else if (typeof d.expirationTimestamp === "number") + m.expirationTimestamp = d.expirationTimestamp; + else if (typeof d.expirationTimestamp === "object") + m.expirationTimestamp = new $util.LongBits(d.expirationTimestamp.low >>> 0, d.expirationTimestamp.high >>> 0).toNumber(true); + } + return m; + }; + + BotFeatureQuotaMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.featureType != null && m.hasOwnProperty("featureType")) { + d.featureType = o.enums === String ? $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[m.featureType] === undefined ? m.featureType : $root.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[m.featureType] : m.featureType; + if (o.oneofs) + d._featureType = "featureType"; + } + if (m.remainingQuota != null && m.hasOwnProperty("remainingQuota")) { + d.remainingQuota = m.remainingQuota; + if (o.oneofs) + d._remainingQuota = "remainingQuota"; + } + if (m.expirationTimestamp != null && m.hasOwnProperty("expirationTimestamp")) { + if (typeof m.expirationTimestamp === "number") + d.expirationTimestamp = o.longs === String ? String(m.expirationTimestamp) : m.expirationTimestamp; + else + d.expirationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expirationTimestamp) : o.longs === Number ? new $util.LongBits(m.expirationTimestamp.low >>> 0, m.expirationTimestamp.high >>> 0).toNumber(true) : m.expirationTimestamp; + if (o.oneofs) + d._expirationTimestamp = "expirationTimestamp"; + } + return d; + }; + + BotFeatureQuotaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotFeatureQuotaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4525,10 +9642,42 @@ export const proto = $root.proto = (() => { } BotReminderMetadata.prototype.requestMessageKey = null; - BotReminderMetadata.prototype.action = 1; - BotReminderMetadata.prototype.name = ""; - BotReminderMetadata.prototype.nextTriggerTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - BotReminderMetadata.prototype.frequency = 1; + BotReminderMetadata.prototype.action = null; + BotReminderMetadata.prototype.name = null; + BotReminderMetadata.prototype.nextTriggerTimestamp = null; + BotReminderMetadata.prototype.frequency = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotReminderMetadata.prototype, "_requestMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["requestMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotReminderMetadata.prototype, "_action", { + get: $util.oneOfGetter($oneOfFields = ["action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotReminderMetadata.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotReminderMetadata.prototype, "_nextTriggerTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["nextTriggerTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotReminderMetadata.prototype, "_frequency", { + get: $util.oneOfGetter($oneOfFields = ["frequency"]), + set: $util.oneOfSetter($oneOfFields) + }); BotReminderMetadata.create = function create(properties) { return new BotReminderMetadata(properties); @@ -4587,6 +9736,122 @@ export const proto = $root.proto = (() => { return m; }; + BotReminderMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotReminderMetadata) + return d; + var m = new $root.proto.BotReminderMetadata(); + if (d.requestMessageKey != null) { + if (typeof d.requestMessageKey !== "object") + throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected"); + m.requestMessageKey = $root.proto.MessageKey.fromObject(d.requestMessageKey); + } + switch (d.action) { + default: + if (typeof d.action === "number") { + m.action = d.action; + break; + } + break; + case "NOTIFY": + case 1: + m.action = 1; + break; + case "CREATE": + case 2: + m.action = 2; + break; + case "DELETE": + case 3: + m.action = 3; + break; + case "UPDATE": + case 4: + m.action = 4; + break; + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.nextTriggerTimestamp != null) { + if ($util.Long) + (m.nextTriggerTimestamp = $util.Long.fromValue(d.nextTriggerTimestamp)).unsigned = true; + else if (typeof d.nextTriggerTimestamp === "string") + m.nextTriggerTimestamp = parseInt(d.nextTriggerTimestamp, 10); + else if (typeof d.nextTriggerTimestamp === "number") + m.nextTriggerTimestamp = d.nextTriggerTimestamp; + else if (typeof d.nextTriggerTimestamp === "object") + m.nextTriggerTimestamp = new $util.LongBits(d.nextTriggerTimestamp.low >>> 0, d.nextTriggerTimestamp.high >>> 0).toNumber(true); + } + switch (d.frequency) { + default: + if (typeof d.frequency === "number") { + m.frequency = d.frequency; + break; + } + break; + case "ONCE": + case 1: + m.frequency = 1; + break; + case "DAILY": + case 2: + m.frequency = 2; + break; + case "WEEKLY": + case 3: + m.frequency = 3; + break; + case "BIWEEKLY": + case 4: + m.frequency = 4; + break; + case "MONTHLY": + case 5: + m.frequency = 5; + break; + } + return m; + }; + + BotReminderMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.requestMessageKey != null && m.hasOwnProperty("requestMessageKey")) { + d.requestMessageKey = $root.proto.MessageKey.toObject(m.requestMessageKey, o); + if (o.oneofs) + d._requestMessageKey = "requestMessageKey"; + } + if (m.action != null && m.hasOwnProperty("action")) { + d.action = o.enums === String ? $root.proto.BotReminderMetadata.ReminderAction[m.action] === undefined ? m.action : $root.proto.BotReminderMetadata.ReminderAction[m.action] : m.action; + if (o.oneofs) + d._action = "action"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.nextTriggerTimestamp != null && m.hasOwnProperty("nextTriggerTimestamp")) { + if (typeof m.nextTriggerTimestamp === "number") + d.nextTriggerTimestamp = o.longs === String ? String(m.nextTriggerTimestamp) : m.nextTriggerTimestamp; + else + d.nextTriggerTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.nextTriggerTimestamp) : o.longs === Number ? new $util.LongBits(m.nextTriggerTimestamp.low >>> 0, m.nextTriggerTimestamp.high >>> 0).toNumber(true) : m.nextTriggerTimestamp; + if (o.oneofs) + d._nextTriggerTimestamp = "nextTriggerTimestamp"; + } + if (m.frequency != null && m.hasOwnProperty("frequency")) { + d.frequency = o.enums === String ? $root.proto.BotReminderMetadata.ReminderFrequency[m.frequency] === undefined ? m.frequency : $root.proto.BotReminderMetadata.ReminderFrequency[m.frequency] : m.frequency; + if (o.oneofs) + d._frequency = "frequency"; + } + return d; + }; + + BotReminderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotReminderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4665,6 +9930,43 @@ export const proto = $root.proto = (() => { return m; }; + BotRenderingMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotRenderingMetadata) + return d; + var m = new $root.proto.BotRenderingMetadata(); + if (d.keywords) { + if (!Array.isArray(d.keywords)) + throw TypeError(".proto.BotRenderingMetadata.keywords: array expected"); + m.keywords = []; + for (var i = 0; i < d.keywords.length; ++i) { + if (typeof d.keywords[i] !== "object") + throw TypeError(".proto.BotRenderingMetadata.keywords: object expected"); + m.keywords[i] = $root.proto.BotRenderingMetadata.Keyword.fromObject(d.keywords[i]); + } + } + return m; + }; + + BotRenderingMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.keywords = []; + } + if (m.keywords && m.keywords.length) { + d.keywords = []; + for (var j = 0; j < m.keywords.length; ++j) { + d.keywords[j] = $root.proto.BotRenderingMetadata.Keyword.toObject(m.keywords[j], o); + } + } + return d; + }; + + BotRenderingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotRenderingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4682,9 +9984,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Keyword.prototype.value = ""; + Keyword.prototype.value = null; Keyword.prototype.associatedPrompts = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Keyword.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + Keyword.create = function create(properties) { return new Keyword(properties); }; @@ -4728,6 +10038,49 @@ export const proto = $root.proto = (() => { return m; }; + Keyword.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotRenderingMetadata.Keyword) + return d; + var m = new $root.proto.BotRenderingMetadata.Keyword(); + if (d.value != null) { + m.value = String(d.value); + } + if (d.associatedPrompts) { + if (!Array.isArray(d.associatedPrompts)) + throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected"); + m.associatedPrompts = []; + for (var i = 0; i < d.associatedPrompts.length; ++i) { + m.associatedPrompts[i] = String(d.associatedPrompts[i]); + } + } + return m; + }; + + Keyword.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.associatedPrompts = []; + } + if (m.value != null && m.hasOwnProperty("value")) { + d.value = m.value; + if (o.oneofs) + d._value = "value"; + } + if (m.associatedPrompts && m.associatedPrompts.length) { + d.associatedPrompts = []; + for (var j = 0; j < m.associatedPrompts.length; ++j) { + d.associatedPrompts[j] = m.associatedPrompts[j]; + } + } + return d; + }; + + Keyword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Keyword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4750,8 +10103,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotSessionMetadata.prototype.sessionId = ""; - BotSessionMetadata.prototype.sessionSource = 0; + BotSessionMetadata.prototype.sessionId = null; + BotSessionMetadata.prototype.sessionSource = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSessionMetadata.prototype, "_sessionId", { + get: $util.oneOfGetter($oneOfFields = ["sessionId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSessionMetadata.prototype, "_sessionSource", { + get: $util.oneOfGetter($oneOfFields = ["sessionSource"]), + set: $util.oneOfSetter($oneOfFields) + }); BotSessionMetadata.create = function create(properties) { return new BotSessionMetadata(properties); @@ -4792,6 +10159,73 @@ export const proto = $root.proto = (() => { return m; }; + BotSessionMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotSessionMetadata) + return d; + var m = new $root.proto.BotSessionMetadata(); + if (d.sessionId != null) { + m.sessionId = String(d.sessionId); + } + switch (d.sessionSource) { + default: + if (typeof d.sessionSource === "number") { + m.sessionSource = d.sessionSource; + break; + } + break; + case "NONE": + case 0: + m.sessionSource = 0; + break; + case "NULL_STATE": + case 1: + m.sessionSource = 1; + break; + case "TYPEAHEAD": + case 2: + m.sessionSource = 2; + break; + case "USER_INPUT": + case 3: + m.sessionSource = 3; + break; + case "EMU_FLASH": + case 4: + m.sessionSource = 4; + break; + case "EMU_FLASH_FOLLOWUP": + case 5: + m.sessionSource = 5; + break; + case "VOICE": + case 6: + m.sessionSource = 6; + break; + } + return m; + }; + + BotSessionMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.sessionId != null && m.hasOwnProperty("sessionId")) { + d.sessionId = m.sessionId; + if (o.oneofs) + d._sessionId = "sessionId"; + } + if (m.sessionSource != null && m.hasOwnProperty("sessionSource")) { + d.sessionSource = o.enums === String ? $root.proto.BotSessionSource[m.sessionSource] === undefined ? m.sessionSource : $root.proto.BotSessionSource[m.sessionSource] : m.sessionSource; + if (o.oneofs) + d._sessionSource = "sessionSource"; + } + return d; + }; + + BotSessionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotSessionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4863,6 +10297,43 @@ export const proto = $root.proto = (() => { return m; }; + BotSourcesMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotSourcesMetadata) + return d; + var m = new $root.proto.BotSourcesMetadata(); + if (d.sources) { + if (!Array.isArray(d.sources)) + throw TypeError(".proto.BotSourcesMetadata.sources: array expected"); + m.sources = []; + for (var i = 0; i < d.sources.length; ++i) { + if (typeof d.sources[i] !== "object") + throw TypeError(".proto.BotSourcesMetadata.sources: object expected"); + m.sources[i] = $root.proto.BotSourcesMetadata.BotSourceItem.fromObject(d.sources[i]); + } + } + return m; + }; + + BotSourcesMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.sources = []; + } + if (m.sources && m.sources.length) { + d.sources = []; + for (var j = 0; j < m.sources.length; ++j) { + d.sources[j] = $root.proto.BotSourcesMetadata.BotSourceItem.toObject(m.sources[j], o); + } + } + return d; + }; + + BotSourcesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotSourcesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4879,12 +10350,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotSourceItem.prototype.provider = 0; - BotSourceItem.prototype.thumbnailCdnUrl = ""; - BotSourceItem.prototype.sourceProviderUrl = ""; - BotSourceItem.prototype.sourceQuery = ""; - BotSourceItem.prototype.faviconCdnUrl = ""; - BotSourceItem.prototype.citationNumber = 0; + BotSourceItem.prototype.provider = null; + BotSourceItem.prototype.thumbnailCdnUrl = null; + BotSourceItem.prototype.sourceProviderUrl = null; + BotSourceItem.prototype.sourceQuery = null; + BotSourceItem.prototype.faviconCdnUrl = null; + BotSourceItem.prototype.citationNumber = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSourceItem.prototype, "_provider", { + get: $util.oneOfGetter($oneOfFields = ["provider"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSourceItem.prototype, "_thumbnailCdnUrl", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailCdnUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSourceItem.prototype, "_sourceProviderUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceProviderUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSourceItem.prototype, "_sourceQuery", { + get: $util.oneOfGetter($oneOfFields = ["sourceQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSourceItem.prototype, "_faviconCdnUrl", { + get: $util.oneOfGetter($oneOfFields = ["faviconCdnUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSourceItem.prototype, "_citationNumber", { + get: $util.oneOfGetter($oneOfFields = ["citationNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); BotSourceItem.create = function create(properties) { return new BotSourceItem(properties); @@ -4949,6 +10458,93 @@ export const proto = $root.proto = (() => { return m; }; + BotSourceItem.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotSourcesMetadata.BotSourceItem) + return d; + var m = new $root.proto.BotSourcesMetadata.BotSourceItem(); + switch (d.provider) { + default: + if (typeof d.provider === "number") { + m.provider = d.provider; + break; + } + break; + case "UNKNOWN": + case 0: + m.provider = 0; + break; + case "BING": + case 1: + m.provider = 1; + break; + case "GOOGLE": + case 2: + m.provider = 2; + break; + case "SUPPORT": + case 3: + m.provider = 3; + break; + } + if (d.thumbnailCdnUrl != null) { + m.thumbnailCdnUrl = String(d.thumbnailCdnUrl); + } + if (d.sourceProviderUrl != null) { + m.sourceProviderUrl = String(d.sourceProviderUrl); + } + if (d.sourceQuery != null) { + m.sourceQuery = String(d.sourceQuery); + } + if (d.faviconCdnUrl != null) { + m.faviconCdnUrl = String(d.faviconCdnUrl); + } + if (d.citationNumber != null) { + m.citationNumber = d.citationNumber >>> 0; + } + return m; + }; + + BotSourceItem.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.provider != null && m.hasOwnProperty("provider")) { + d.provider = o.enums === String ? $root.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[m.provider] === undefined ? m.provider : $root.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[m.provider] : m.provider; + if (o.oneofs) + d._provider = "provider"; + } + if (m.thumbnailCdnUrl != null && m.hasOwnProperty("thumbnailCdnUrl")) { + d.thumbnailCdnUrl = m.thumbnailCdnUrl; + if (o.oneofs) + d._thumbnailCdnUrl = "thumbnailCdnUrl"; + } + if (m.sourceProviderUrl != null && m.hasOwnProperty("sourceProviderUrl")) { + d.sourceProviderUrl = m.sourceProviderUrl; + if (o.oneofs) + d._sourceProviderUrl = "sourceProviderUrl"; + } + if (m.sourceQuery != null && m.hasOwnProperty("sourceQuery")) { + d.sourceQuery = m.sourceQuery; + if (o.oneofs) + d._sourceQuery = "sourceQuery"; + } + if (m.faviconCdnUrl != null && m.hasOwnProperty("faviconCdnUrl")) { + d.faviconCdnUrl = m.faviconCdnUrl; + if (o.oneofs) + d._faviconCdnUrl = "faviconCdnUrl"; + } + if (m.citationNumber != null && m.hasOwnProperty("citationNumber")) { + d.citationNumber = m.citationNumber; + if (o.oneofs) + d._citationNumber = "citationNumber"; + } + return d; + }; + + BotSourceItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotSourceItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -4982,9 +10578,29 @@ export const proto = $root.proto = (() => { } BotSuggestedPromptMetadata.prototype.suggestedPrompts = $util.emptyArray; - BotSuggestedPromptMetadata.prototype.selectedPromptIndex = 0; + BotSuggestedPromptMetadata.prototype.selectedPromptIndex = null; BotSuggestedPromptMetadata.prototype.promptSuggestions = null; - BotSuggestedPromptMetadata.prototype.selectedPromptId = ""; + BotSuggestedPromptMetadata.prototype.selectedPromptId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSuggestedPromptMetadata.prototype, "_selectedPromptIndex", { + get: $util.oneOfGetter($oneOfFields = ["selectedPromptIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSuggestedPromptMetadata.prototype, "_promptSuggestions", { + get: $util.oneOfGetter($oneOfFields = ["promptSuggestions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotSuggestedPromptMetadata.prototype, "_selectedPromptId", { + get: $util.oneOfGetter($oneOfFields = ["selectedPromptId"]), + set: $util.oneOfSetter($oneOfFields) + }); BotSuggestedPromptMetadata.create = function create(properties) { return new BotSuggestedPromptMetadata(properties); @@ -5041,6 +10657,67 @@ export const proto = $root.proto = (() => { return m; }; + BotSuggestedPromptMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.BotSuggestedPromptMetadata) + return d; + var m = new $root.proto.BotSuggestedPromptMetadata(); + if (d.suggestedPrompts) { + if (!Array.isArray(d.suggestedPrompts)) + throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected"); + m.suggestedPrompts = []; + for (var i = 0; i < d.suggestedPrompts.length; ++i) { + m.suggestedPrompts[i] = String(d.suggestedPrompts[i]); + } + } + if (d.selectedPromptIndex != null) { + m.selectedPromptIndex = d.selectedPromptIndex >>> 0; + } + if (d.promptSuggestions != null) { + if (typeof d.promptSuggestions !== "object") + throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected"); + m.promptSuggestions = $root.proto.BotPromptSuggestions.fromObject(d.promptSuggestions); + } + if (d.selectedPromptId != null) { + m.selectedPromptId = String(d.selectedPromptId); + } + return m; + }; + + BotSuggestedPromptMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.suggestedPrompts = []; + } + if (m.suggestedPrompts && m.suggestedPrompts.length) { + d.suggestedPrompts = []; + for (var j = 0; j < m.suggestedPrompts.length; ++j) { + d.suggestedPrompts[j] = m.suggestedPrompts[j]; + } + } + if (m.selectedPromptIndex != null && m.hasOwnProperty("selectedPromptIndex")) { + d.selectedPromptIndex = m.selectedPromptIndex; + if (o.oneofs) + d._selectedPromptIndex = "selectedPromptIndex"; + } + if (m.promptSuggestions != null && m.hasOwnProperty("promptSuggestions")) { + d.promptSuggestions = $root.proto.BotPromptSuggestions.toObject(m.promptSuggestions, o); + if (o.oneofs) + d._promptSuggestions = "promptSuggestions"; + } + if (m.selectedPromptId != null && m.hasOwnProperty("selectedPromptId")) { + d.selectedPromptId = m.selectedPromptId; + if (o.oneofs) + d._selectedPromptId = "selectedPromptId"; + } + return d; + }; + + BotSuggestedPromptMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotSuggestedPromptMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5061,21 +10738,107 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CallLogRecord.prototype.callResult = 0; - CallLogRecord.prototype.isDndMode = false; - CallLogRecord.prototype.silenceReason = 0; - CallLogRecord.prototype.duration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - CallLogRecord.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - CallLogRecord.prototype.isIncoming = false; - CallLogRecord.prototype.isVideo = false; - CallLogRecord.prototype.isCallLink = false; - CallLogRecord.prototype.callLinkToken = ""; - CallLogRecord.prototype.scheduledCallId = ""; - CallLogRecord.prototype.callId = ""; - CallLogRecord.prototype.callCreatorJid = ""; - CallLogRecord.prototype.groupJid = ""; + CallLogRecord.prototype.callResult = null; + CallLogRecord.prototype.isDndMode = null; + CallLogRecord.prototype.silenceReason = null; + CallLogRecord.prototype.duration = null; + CallLogRecord.prototype.startTime = null; + CallLogRecord.prototype.isIncoming = null; + CallLogRecord.prototype.isVideo = null; + CallLogRecord.prototype.isCallLink = null; + CallLogRecord.prototype.callLinkToken = null; + CallLogRecord.prototype.scheduledCallId = null; + CallLogRecord.prototype.callId = null; + CallLogRecord.prototype.callCreatorJid = null; + CallLogRecord.prototype.groupJid = null; CallLogRecord.prototype.participants = $util.emptyArray; - CallLogRecord.prototype.callType = 0; + CallLogRecord.prototype.callType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_callResult", { + get: $util.oneOfGetter($oneOfFields = ["callResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_isDndMode", { + get: $util.oneOfGetter($oneOfFields = ["isDndMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_silenceReason", { + get: $util.oneOfGetter($oneOfFields = ["silenceReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_duration", { + get: $util.oneOfGetter($oneOfFields = ["duration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_isIncoming", { + get: $util.oneOfGetter($oneOfFields = ["isIncoming"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_isVideo", { + get: $util.oneOfGetter($oneOfFields = ["isVideo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_isCallLink", { + get: $util.oneOfGetter($oneOfFields = ["isCallLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_callLinkToken", { + get: $util.oneOfGetter($oneOfFields = ["callLinkToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_scheduledCallId", { + get: $util.oneOfGetter($oneOfFields = ["scheduledCallId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_callId", { + get: $util.oneOfGetter($oneOfFields = ["callId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_callCreatorJid", { + get: $util.oneOfGetter($oneOfFields = ["callCreatorJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_groupJid", { + get: $util.oneOfGetter($oneOfFields = ["groupJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogRecord.prototype, "_callType", { + get: $util.oneOfGetter($oneOfFields = ["callType"]), + set: $util.oneOfSetter($oneOfFields) + }); CallLogRecord.create = function create(properties) { return new CallLogRecord(properties); @@ -5198,6 +10961,262 @@ export const proto = $root.proto = (() => { return m; }; + CallLogRecord.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CallLogRecord) + return d; + var m = new $root.proto.CallLogRecord(); + switch (d.callResult) { + default: + if (typeof d.callResult === "number") { + m.callResult = d.callResult; + break; + } + break; + case "CONNECTED": + case 0: + m.callResult = 0; + break; + case "REJECTED": + case 1: + m.callResult = 1; + break; + case "CANCELLED": + case 2: + m.callResult = 2; + break; + case "ACCEPTEDELSEWHERE": + case 3: + m.callResult = 3; + break; + case "MISSED": + case 4: + m.callResult = 4; + break; + case "INVALID": + case 5: + m.callResult = 5; + break; + case "UNAVAILABLE": + case 6: + m.callResult = 6; + break; + case "UPCOMING": + case 7: + m.callResult = 7; + break; + case "FAILED": + case 8: + m.callResult = 8; + break; + case "ABANDONED": + case 9: + m.callResult = 9; + break; + case "ONGOING": + case 10: + m.callResult = 10; + break; + } + if (d.isDndMode != null) { + m.isDndMode = Boolean(d.isDndMode); + } + switch (d.silenceReason) { + default: + if (typeof d.silenceReason === "number") { + m.silenceReason = d.silenceReason; + break; + } + break; + case "NONE": + case 0: + m.silenceReason = 0; + break; + case "SCHEDULED": + case 1: + m.silenceReason = 1; + break; + case "PRIVACY": + case 2: + m.silenceReason = 2; + break; + case "LIGHTWEIGHT": + case 3: + m.silenceReason = 3; + break; + } + if (d.duration != null) { + if ($util.Long) + (m.duration = $util.Long.fromValue(d.duration)).unsigned = false; + else if (typeof d.duration === "string") + m.duration = parseInt(d.duration, 10); + else if (typeof d.duration === "number") + m.duration = d.duration; + else if (typeof d.duration === "object") + m.duration = new $util.LongBits(d.duration.low >>> 0, d.duration.high >>> 0).toNumber(); + } + if (d.startTime != null) { + if ($util.Long) + (m.startTime = $util.Long.fromValue(d.startTime)).unsigned = false; + else if (typeof d.startTime === "string") + m.startTime = parseInt(d.startTime, 10); + else if (typeof d.startTime === "number") + m.startTime = d.startTime; + else if (typeof d.startTime === "object") + m.startTime = new $util.LongBits(d.startTime.low >>> 0, d.startTime.high >>> 0).toNumber(); + } + if (d.isIncoming != null) { + m.isIncoming = Boolean(d.isIncoming); + } + if (d.isVideo != null) { + m.isVideo = Boolean(d.isVideo); + } + if (d.isCallLink != null) { + m.isCallLink = Boolean(d.isCallLink); + } + if (d.callLinkToken != null) { + m.callLinkToken = String(d.callLinkToken); + } + if (d.scheduledCallId != null) { + m.scheduledCallId = String(d.scheduledCallId); + } + if (d.callId != null) { + m.callId = String(d.callId); + } + if (d.callCreatorJid != null) { + m.callCreatorJid = String(d.callCreatorJid); + } + if (d.groupJid != null) { + m.groupJid = String(d.groupJid); + } + if (d.participants) { + if (!Array.isArray(d.participants)) + throw TypeError(".proto.CallLogRecord.participants: array expected"); + m.participants = []; + for (var i = 0; i < d.participants.length; ++i) { + if (typeof d.participants[i] !== "object") + throw TypeError(".proto.CallLogRecord.participants: object expected"); + m.participants[i] = $root.proto.CallLogRecord.ParticipantInfo.fromObject(d.participants[i]); + } + } + switch (d.callType) { + default: + if (typeof d.callType === "number") { + m.callType = d.callType; + break; + } + break; + case "REGULAR": + case 0: + m.callType = 0; + break; + case "SCHEDULED_CALL": + case 1: + m.callType = 1; + break; + case "VOICE_CHAT": + case 2: + m.callType = 2; + break; + } + return m; + }; + + CallLogRecord.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.participants = []; + } + if (m.callResult != null && m.hasOwnProperty("callResult")) { + d.callResult = o.enums === String ? $root.proto.CallLogRecord.CallResult[m.callResult] === undefined ? m.callResult : $root.proto.CallLogRecord.CallResult[m.callResult] : m.callResult; + if (o.oneofs) + d._callResult = "callResult"; + } + if (m.isDndMode != null && m.hasOwnProperty("isDndMode")) { + d.isDndMode = m.isDndMode; + if (o.oneofs) + d._isDndMode = "isDndMode"; + } + if (m.silenceReason != null && m.hasOwnProperty("silenceReason")) { + d.silenceReason = o.enums === String ? $root.proto.CallLogRecord.SilenceReason[m.silenceReason] === undefined ? m.silenceReason : $root.proto.CallLogRecord.SilenceReason[m.silenceReason] : m.silenceReason; + if (o.oneofs) + d._silenceReason = "silenceReason"; + } + if (m.duration != null && m.hasOwnProperty("duration")) { + if (typeof m.duration === "number") + d.duration = o.longs === String ? String(m.duration) : m.duration; + else + d.duration = o.longs === String ? $util.Long.prototype.toString.call(m.duration) : o.longs === Number ? new $util.LongBits(m.duration.low >>> 0, m.duration.high >>> 0).toNumber() : m.duration; + if (o.oneofs) + d._duration = "duration"; + } + if (m.startTime != null && m.hasOwnProperty("startTime")) { + if (typeof m.startTime === "number") + d.startTime = o.longs === String ? String(m.startTime) : m.startTime; + else + d.startTime = o.longs === String ? $util.Long.prototype.toString.call(m.startTime) : o.longs === Number ? new $util.LongBits(m.startTime.low >>> 0, m.startTime.high >>> 0).toNumber() : m.startTime; + if (o.oneofs) + d._startTime = "startTime"; + } + if (m.isIncoming != null && m.hasOwnProperty("isIncoming")) { + d.isIncoming = m.isIncoming; + if (o.oneofs) + d._isIncoming = "isIncoming"; + } + if (m.isVideo != null && m.hasOwnProperty("isVideo")) { + d.isVideo = m.isVideo; + if (o.oneofs) + d._isVideo = "isVideo"; + } + if (m.isCallLink != null && m.hasOwnProperty("isCallLink")) { + d.isCallLink = m.isCallLink; + if (o.oneofs) + d._isCallLink = "isCallLink"; + } + if (m.callLinkToken != null && m.hasOwnProperty("callLinkToken")) { + d.callLinkToken = m.callLinkToken; + if (o.oneofs) + d._callLinkToken = "callLinkToken"; + } + if (m.scheduledCallId != null && m.hasOwnProperty("scheduledCallId")) { + d.scheduledCallId = m.scheduledCallId; + if (o.oneofs) + d._scheduledCallId = "scheduledCallId"; + } + if (m.callId != null && m.hasOwnProperty("callId")) { + d.callId = m.callId; + if (o.oneofs) + d._callId = "callId"; + } + if (m.callCreatorJid != null && m.hasOwnProperty("callCreatorJid")) { + d.callCreatorJid = m.callCreatorJid; + if (o.oneofs) + d._callCreatorJid = "callCreatorJid"; + } + if (m.groupJid != null && m.hasOwnProperty("groupJid")) { + d.groupJid = m.groupJid; + if (o.oneofs) + d._groupJid = "groupJid"; + } + if (m.participants && m.participants.length) { + d.participants = []; + for (var j = 0; j < m.participants.length; ++j) { + d.participants[j] = $root.proto.CallLogRecord.ParticipantInfo.toObject(m.participants[j], o); + } + } + if (m.callType != null && m.hasOwnProperty("callType")) { + d.callType = o.enums === String ? $root.proto.CallLogRecord.CallType[m.callType] === undefined ? m.callType : $root.proto.CallLogRecord.CallType[m.callType] : m.callType; + if (o.oneofs) + d._callType = "callType"; + } + return d; + }; + + CallLogRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CallLogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5238,8 +11257,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ParticipantInfo.prototype.userJid = ""; - ParticipantInfo.prototype.callResult = 0; + ParticipantInfo.prototype.userJid = null; + ParticipantInfo.prototype.callResult = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ParticipantInfo.prototype, "_userJid", { + get: $util.oneOfGetter($oneOfFields = ["userJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ParticipantInfo.prototype, "_callResult", { + get: $util.oneOfGetter($oneOfFields = ["callResult"]), + set: $util.oneOfSetter($oneOfFields) + }); ParticipantInfo.create = function create(properties) { return new ParticipantInfo(properties); @@ -5280,6 +11313,89 @@ export const proto = $root.proto = (() => { return m; }; + ParticipantInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CallLogRecord.ParticipantInfo) + return d; + var m = new $root.proto.CallLogRecord.ParticipantInfo(); + if (d.userJid != null) { + m.userJid = String(d.userJid); + } + switch (d.callResult) { + default: + if (typeof d.callResult === "number") { + m.callResult = d.callResult; + break; + } + break; + case "CONNECTED": + case 0: + m.callResult = 0; + break; + case "REJECTED": + case 1: + m.callResult = 1; + break; + case "CANCELLED": + case 2: + m.callResult = 2; + break; + case "ACCEPTEDELSEWHERE": + case 3: + m.callResult = 3; + break; + case "MISSED": + case 4: + m.callResult = 4; + break; + case "INVALID": + case 5: + m.callResult = 5; + break; + case "UNAVAILABLE": + case 6: + m.callResult = 6; + break; + case "UPCOMING": + case 7: + m.callResult = 7; + break; + case "FAILED": + case 8: + m.callResult = 8; + break; + case "ABANDONED": + case 9: + m.callResult = 9; + break; + case "ONGOING": + case 10: + m.callResult = 10; + break; + } + return m; + }; + + ParticipantInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.userJid != null && m.hasOwnProperty("userJid")) { + d.userJid = m.userJid; + if (o.oneofs) + d._userJid = "userJid"; + } + if (m.callResult != null && m.hasOwnProperty("callResult")) { + d.callResult = o.enums === String ? $root.proto.CallLogRecord.CallResult[m.callResult] === undefined ? m.callResult : $root.proto.CallLogRecord.CallResult[m.callResult] : m.callResult; + if (o.oneofs) + d._callResult = "callResult"; + } + return d; + }; + + ParticipantInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ParticipantInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5314,6 +11430,20 @@ export const proto = $root.proto = (() => { CertChain.prototype.leaf = null; CertChain.prototype.intermediate = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CertChain.prototype, "_leaf", { + get: $util.oneOfGetter($oneOfFields = ["leaf"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CertChain.prototype, "_intermediate", { + get: $util.oneOfGetter($oneOfFields = ["intermediate"]), + set: $util.oneOfSetter($oneOfFields) + }); + CertChain.create = function create(properties) { return new CertChain(properties); }; @@ -5353,6 +11483,44 @@ export const proto = $root.proto = (() => { return m; }; + CertChain.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CertChain) + return d; + var m = new $root.proto.CertChain(); + if (d.leaf != null) { + if (typeof d.leaf !== "object") + throw TypeError(".proto.CertChain.leaf: object expected"); + m.leaf = $root.proto.CertChain.NoiseCertificate.fromObject(d.leaf); + } + if (d.intermediate != null) { + if (typeof d.intermediate !== "object") + throw TypeError(".proto.CertChain.intermediate: object expected"); + m.intermediate = $root.proto.CertChain.NoiseCertificate.fromObject(d.intermediate); + } + return m; + }; + + CertChain.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.leaf != null && m.hasOwnProperty("leaf")) { + d.leaf = $root.proto.CertChain.NoiseCertificate.toObject(m.leaf, o); + if (o.oneofs) + d._leaf = "leaf"; + } + if (m.intermediate != null && m.hasOwnProperty("intermediate")) { + d.intermediate = $root.proto.CertChain.NoiseCertificate.toObject(m.intermediate, o); + if (o.oneofs) + d._intermediate = "intermediate"; + } + return d; + }; + + CertChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CertChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5369,8 +11537,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NoiseCertificate.prototype.details = $util.newBuffer([]); - NoiseCertificate.prototype.signature = $util.newBuffer([]); + NoiseCertificate.prototype.details = null; + NoiseCertificate.prototype.signature = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoiseCertificate.prototype, "_details", { + get: $util.oneOfGetter($oneOfFields = ["details"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoiseCertificate.prototype, "_signature", { + get: $util.oneOfGetter($oneOfFields = ["signature"]), + set: $util.oneOfSetter($oneOfFields) + }); NoiseCertificate.create = function create(properties) { return new NoiseCertificate(properties); @@ -5411,6 +11593,46 @@ export const proto = $root.proto = (() => { return m; }; + NoiseCertificate.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CertChain.NoiseCertificate) + return d; + var m = new $root.proto.CertChain.NoiseCertificate(); + if (d.details != null) { + if (typeof d.details === "string") + $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); + else if (d.details.length >= 0) + m.details = d.details; + } + if (d.signature != null) { + if (typeof d.signature === "string") + $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0); + else if (d.signature.length >= 0) + m.signature = d.signature; + } + return m; + }; + + NoiseCertificate.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.details != null && m.hasOwnProperty("details")) { + d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; + if (o.oneofs) + d._details = "details"; + } + if (m.signature != null && m.hasOwnProperty("signature")) { + d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature; + if (o.oneofs) + d._signature = "signature"; + } + return d; + }; + + NoiseCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NoiseCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5427,11 +11649,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Details.prototype.serial = 0; - Details.prototype.issuerSerial = 0; - Details.prototype.key = $util.newBuffer([]); - Details.prototype.notBefore = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Details.prototype.notAfter = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Details.prototype.serial = null; + Details.prototype.issuerSerial = null; + Details.prototype.key = null; + Details.prototype.notBefore = null; + Details.prototype.notAfter = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_serial", { + get: $util.oneOfGetter($oneOfFields = ["serial"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_issuerSerial", { + get: $util.oneOfGetter($oneOfFields = ["issuerSerial"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_notBefore", { + get: $util.oneOfGetter($oneOfFields = ["notBefore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_notAfter", { + get: $util.oneOfGetter($oneOfFields = ["notAfter"]), + set: $util.oneOfSetter($oneOfFields) + }); Details.create = function create(properties) { return new Details(properties); @@ -5490,6 +11744,87 @@ export const proto = $root.proto = (() => { return m; }; + Details.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CertChain.NoiseCertificate.Details) + return d; + var m = new $root.proto.CertChain.NoiseCertificate.Details(); + if (d.serial != null) { + m.serial = d.serial >>> 0; + } + if (d.issuerSerial != null) { + m.issuerSerial = d.issuerSerial >>> 0; + } + if (d.key != null) { + if (typeof d.key === "string") + $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0); + else if (d.key.length >= 0) + m.key = d.key; + } + if (d.notBefore != null) { + if ($util.Long) + (m.notBefore = $util.Long.fromValue(d.notBefore)).unsigned = true; + else if (typeof d.notBefore === "string") + m.notBefore = parseInt(d.notBefore, 10); + else if (typeof d.notBefore === "number") + m.notBefore = d.notBefore; + else if (typeof d.notBefore === "object") + m.notBefore = new $util.LongBits(d.notBefore.low >>> 0, d.notBefore.high >>> 0).toNumber(true); + } + if (d.notAfter != null) { + if ($util.Long) + (m.notAfter = $util.Long.fromValue(d.notAfter)).unsigned = true; + else if (typeof d.notAfter === "string") + m.notAfter = parseInt(d.notAfter, 10); + else if (typeof d.notAfter === "number") + m.notAfter = d.notAfter; + else if (typeof d.notAfter === "object") + m.notAfter = new $util.LongBits(d.notAfter.low >>> 0, d.notAfter.high >>> 0).toNumber(true); + } + return m; + }; + + Details.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.serial != null && m.hasOwnProperty("serial")) { + d.serial = m.serial; + if (o.oneofs) + d._serial = "serial"; + } + if (m.issuerSerial != null && m.hasOwnProperty("issuerSerial")) { + d.issuerSerial = m.issuerSerial; + if (o.oneofs) + d._issuerSerial = "issuerSerial"; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key; + if (o.oneofs) + d._key = "key"; + } + if (m.notBefore != null && m.hasOwnProperty("notBefore")) { + if (typeof m.notBefore === "number") + d.notBefore = o.longs === String ? String(m.notBefore) : m.notBefore; + else + d.notBefore = o.longs === String ? $util.Long.prototype.toString.call(m.notBefore) : o.longs === Number ? new $util.LongBits(m.notBefore.low >>> 0, m.notBefore.high >>> 0).toNumber(true) : m.notBefore; + if (o.oneofs) + d._notBefore = "notBefore"; + } + if (m.notAfter != null && m.hasOwnProperty("notAfter")) { + if (typeof m.notAfter === "number") + d.notAfter = o.longs === String ? String(m.notAfter) : m.notAfter; + else + d.notAfter = o.longs === String ? $util.Long.prototype.toString.call(m.notAfter) : o.longs === Number ? new $util.LongBits(m.notAfter.low >>> 0, m.notAfter.high >>> 0).toNumber(true) : m.notAfter; + if (o.oneofs) + d._notAfter = "notAfter"; + } + return d; + }; + + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5515,9 +11850,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ChatLockSettings.prototype.hideLockedChats = false; + ChatLockSettings.prototype.hideLockedChats = null; ChatLockSettings.prototype.secretCode = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChatLockSettings.prototype, "_hideLockedChats", { + get: $util.oneOfGetter($oneOfFields = ["hideLockedChats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChatLockSettings.prototype, "_secretCode", { + get: $util.oneOfGetter($oneOfFields = ["secretCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + ChatLockSettings.create = function create(properties) { return new ChatLockSettings(properties); }; @@ -5557,6 +11906,42 @@ export const proto = $root.proto = (() => { return m; }; + ChatLockSettings.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ChatLockSettings) + return d; + var m = new $root.proto.ChatLockSettings(); + if (d.hideLockedChats != null) { + m.hideLockedChats = Boolean(d.hideLockedChats); + } + if (d.secretCode != null) { + if (typeof d.secretCode !== "object") + throw TypeError(".proto.ChatLockSettings.secretCode: object expected"); + m.secretCode = $root.proto.UserPassword.fromObject(d.secretCode); + } + return m; + }; + + ChatLockSettings.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.hideLockedChats != null && m.hasOwnProperty("hideLockedChats")) { + d.hideLockedChats = m.hideLockedChats; + if (o.oneofs) + d._hideLockedChats = "hideLockedChats"; + } + if (m.secretCode != null && m.hasOwnProperty("secretCode")) { + d.secretCode = $root.proto.UserPassword.toObject(m.secretCode, o); + if (o.oneofs) + d._secretCode = "secretCode"; + } + return d; + }; + + ChatLockSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ChatLockSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5578,6 +11963,14 @@ export const proto = $root.proto = (() => { ChatRowOpaqueData.prototype.draftMessage = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChatRowOpaqueData.prototype, "_draftMessage", { + get: $util.oneOfGetter($oneOfFields = ["draftMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + ChatRowOpaqueData.create = function create(properties) { return new ChatRowOpaqueData(properties); }; @@ -5611,6 +12004,34 @@ export const proto = $root.proto = (() => { return m; }; + ChatRowOpaqueData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ChatRowOpaqueData) + return d; + var m = new $root.proto.ChatRowOpaqueData(); + if (d.draftMessage != null) { + if (typeof d.draftMessage !== "object") + throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected"); + m.draftMessage = $root.proto.ChatRowOpaqueData.DraftMessage.fromObject(d.draftMessage); + } + return m; + }; + + ChatRowOpaqueData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.draftMessage != null && m.hasOwnProperty("draftMessage")) { + d.draftMessage = $root.proto.ChatRowOpaqueData.DraftMessage.toObject(m.draftMessage, o); + if (o.oneofs) + d._draftMessage = "draftMessage"; + } + return d; + }; + + ChatRowOpaqueData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ChatRowOpaqueData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5627,11 +12048,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DraftMessage.prototype.text = ""; - DraftMessage.prototype.omittedUrl = ""; + DraftMessage.prototype.text = null; + DraftMessage.prototype.omittedUrl = null; DraftMessage.prototype.ctwaContextLinkData = null; DraftMessage.prototype.ctwaContext = null; - DraftMessage.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DraftMessage.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DraftMessage.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DraftMessage.prototype, "_omittedUrl", { + get: $util.oneOfGetter($oneOfFields = ["omittedUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DraftMessage.prototype, "_ctwaContextLinkData", { + get: $util.oneOfGetter($oneOfFields = ["ctwaContextLinkData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DraftMessage.prototype, "_ctwaContext", { + get: $util.oneOfGetter($oneOfFields = ["ctwaContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DraftMessage.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); DraftMessage.create = function create(properties) { return new DraftMessage(properties); @@ -5690,6 +12143,78 @@ export const proto = $root.proto = (() => { return m; }; + DraftMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ChatRowOpaqueData.DraftMessage) + return d; + var m = new $root.proto.ChatRowOpaqueData.DraftMessage(); + if (d.text != null) { + m.text = String(d.text); + } + if (d.omittedUrl != null) { + m.omittedUrl = String(d.omittedUrl); + } + if (d.ctwaContextLinkData != null) { + if (typeof d.ctwaContextLinkData !== "object") + throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected"); + m.ctwaContextLinkData = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(d.ctwaContextLinkData); + } + if (d.ctwaContext != null) { + if (typeof d.ctwaContext !== "object") + throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected"); + m.ctwaContext = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(d.ctwaContext); + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + DraftMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.omittedUrl != null && m.hasOwnProperty("omittedUrl")) { + d.omittedUrl = m.omittedUrl; + if (o.oneofs) + d._omittedUrl = "omittedUrl"; + } + if (m.ctwaContextLinkData != null && m.hasOwnProperty("ctwaContextLinkData")) { + d.ctwaContextLinkData = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(m.ctwaContextLinkData, o); + if (o.oneofs) + d._ctwaContextLinkData = "ctwaContextLinkData"; + } + if (m.ctwaContext != null && m.hasOwnProperty("ctwaContext")) { + d.ctwaContext = $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(m.ctwaContext, o); + if (o.oneofs) + d._ctwaContext = "ctwaContext"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + DraftMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DraftMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5706,18 +12231,92 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CtwaContextData.prototype.conversionSource = ""; - CtwaContextData.prototype.conversionData = $util.newBuffer([]); - CtwaContextData.prototype.sourceUrl = ""; - CtwaContextData.prototype.sourceId = ""; - CtwaContextData.prototype.sourceType = ""; - CtwaContextData.prototype.title = ""; - CtwaContextData.prototype.description = ""; - CtwaContextData.prototype.thumbnail = ""; - CtwaContextData.prototype.thumbnailUrl = ""; - CtwaContextData.prototype.mediaType = 0; - CtwaContextData.prototype.mediaUrl = ""; - CtwaContextData.prototype.isSuspiciousLink = false; + CtwaContextData.prototype.conversionSource = null; + CtwaContextData.prototype.conversionData = null; + CtwaContextData.prototype.sourceUrl = null; + CtwaContextData.prototype.sourceId = null; + CtwaContextData.prototype.sourceType = null; + CtwaContextData.prototype.title = null; + CtwaContextData.prototype.description = null; + CtwaContextData.prototype.thumbnail = null; + CtwaContextData.prototype.thumbnailUrl = null; + CtwaContextData.prototype.mediaType = null; + CtwaContextData.prototype.mediaUrl = null; + CtwaContextData.prototype.isSuspiciousLink = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_conversionSource", { + get: $util.oneOfGetter($oneOfFields = ["conversionSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_conversionData", { + get: $util.oneOfGetter($oneOfFields = ["conversionData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_sourceUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_sourceId", { + get: $util.oneOfGetter($oneOfFields = ["sourceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_sourceType", { + get: $util.oneOfGetter($oneOfFields = ["sourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_thumbnail", { + get: $util.oneOfGetter($oneOfFields = ["thumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_thumbnailUrl", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_mediaType", { + get: $util.oneOfGetter($oneOfFields = ["mediaType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_mediaUrl", { + get: $util.oneOfGetter($oneOfFields = ["mediaUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextData.prototype, "_isSuspiciousLink", { + get: $util.oneOfGetter($oneOfFields = ["isSuspiciousLink"]), + set: $util.oneOfSetter($oneOfFields) + }); CtwaContextData.create = function create(properties) { return new CtwaContextData(properties); @@ -5818,6 +12417,140 @@ export const proto = $root.proto = (() => { return m; }; + CtwaContextData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData) + return d; + var m = new $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData(); + if (d.conversionSource != null) { + m.conversionSource = String(d.conversionSource); + } + if (d.conversionData != null) { + if (typeof d.conversionData === "string") + $util.base64.decode(d.conversionData, m.conversionData = $util.newBuffer($util.base64.length(d.conversionData)), 0); + else if (d.conversionData.length >= 0) + m.conversionData = d.conversionData; + } + if (d.sourceUrl != null) { + m.sourceUrl = String(d.sourceUrl); + } + if (d.sourceId != null) { + m.sourceId = String(d.sourceId); + } + if (d.sourceType != null) { + m.sourceType = String(d.sourceType); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.thumbnail != null) { + m.thumbnail = String(d.thumbnail); + } + if (d.thumbnailUrl != null) { + m.thumbnailUrl = String(d.thumbnailUrl); + } + switch (d.mediaType) { + default: + if (typeof d.mediaType === "number") { + m.mediaType = d.mediaType; + break; + } + break; + case "NONE": + case 0: + m.mediaType = 0; + break; + case "IMAGE": + case 1: + m.mediaType = 1; + break; + case "VIDEO": + case 2: + m.mediaType = 2; + break; + } + if (d.mediaUrl != null) { + m.mediaUrl = String(d.mediaUrl); + } + if (d.isSuspiciousLink != null) { + m.isSuspiciousLink = Boolean(d.isSuspiciousLink); + } + return m; + }; + + CtwaContextData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.conversionSource != null && m.hasOwnProperty("conversionSource")) { + d.conversionSource = m.conversionSource; + if (o.oneofs) + d._conversionSource = "conversionSource"; + } + if (m.conversionData != null && m.hasOwnProperty("conversionData")) { + d.conversionData = o.bytes === String ? $util.base64.encode(m.conversionData, 0, m.conversionData.length) : o.bytes === Array ? Array.prototype.slice.call(m.conversionData) : m.conversionData; + if (o.oneofs) + d._conversionData = "conversionData"; + } + if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) { + d.sourceUrl = m.sourceUrl; + if (o.oneofs) + d._sourceUrl = "sourceUrl"; + } + if (m.sourceId != null && m.hasOwnProperty("sourceId")) { + d.sourceId = m.sourceId; + if (o.oneofs) + d._sourceId = "sourceId"; + } + if (m.sourceType != null && m.hasOwnProperty("sourceType")) { + d.sourceType = m.sourceType; + if (o.oneofs) + d._sourceType = "sourceType"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) { + d.thumbnail = m.thumbnail; + if (o.oneofs) + d._thumbnail = "thumbnail"; + } + if (m.thumbnailUrl != null && m.hasOwnProperty("thumbnailUrl")) { + d.thumbnailUrl = m.thumbnailUrl; + if (o.oneofs) + d._thumbnailUrl = "thumbnailUrl"; + } + if (m.mediaType != null && m.hasOwnProperty("mediaType")) { + d.mediaType = o.enums === String ? $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[m.mediaType] : m.mediaType; + if (o.oneofs) + d._mediaType = "mediaType"; + } + if (m.mediaUrl != null && m.hasOwnProperty("mediaUrl")) { + d.mediaUrl = m.mediaUrl; + if (o.oneofs) + d._mediaUrl = "mediaUrl"; + } + if (m.isSuspiciousLink != null && m.hasOwnProperty("isSuspiciousLink")) { + d.isSuspiciousLink = m.isSuspiciousLink; + if (o.oneofs) + d._isSuspiciousLink = "isSuspiciousLink"; + } + return d; + }; + + CtwaContextData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CtwaContextData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5845,10 +12578,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CtwaContextLinkData.prototype.context = ""; - CtwaContextLinkData.prototype.sourceUrl = ""; - CtwaContextLinkData.prototype.icebreaker = ""; - CtwaContextLinkData.prototype.phone = ""; + CtwaContextLinkData.prototype.context = null; + CtwaContextLinkData.prototype.sourceUrl = null; + CtwaContextLinkData.prototype.icebreaker = null; + CtwaContextLinkData.prototype.phone = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextLinkData.prototype, "_context", { + get: $util.oneOfGetter($oneOfFields = ["context"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextLinkData.prototype, "_sourceUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextLinkData.prototype, "_icebreaker", { + get: $util.oneOfGetter($oneOfFields = ["icebreaker"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaContextLinkData.prototype, "_phone", { + get: $util.oneOfGetter($oneOfFields = ["phone"]), + set: $util.oneOfSetter($oneOfFields) + }); CtwaContextLinkData.create = function create(properties) { return new CtwaContextLinkData(properties); @@ -5901,6 +12660,56 @@ export const proto = $root.proto = (() => { return m; }; + CtwaContextLinkData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData) + return d; + var m = new $root.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData(); + if (d.context != null) { + m.context = String(d.context); + } + if (d.sourceUrl != null) { + m.sourceUrl = String(d.sourceUrl); + } + if (d.icebreaker != null) { + m.icebreaker = String(d.icebreaker); + } + if (d.phone != null) { + m.phone = String(d.phone); + } + return m; + }; + + CtwaContextLinkData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.context != null && m.hasOwnProperty("context")) { + d.context = m.context; + if (o.oneofs) + d._context = "context"; + } + if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) { + d.sourceUrl = m.sourceUrl; + if (o.oneofs) + d._sourceUrl = "sourceUrl"; + } + if (m.icebreaker != null && m.hasOwnProperty("icebreaker")) { + d.icebreaker = m.icebreaker; + if (o.oneofs) + d._icebreaker = "icebreaker"; + } + if (m.phone != null && m.hasOwnProperty("phone")) { + d.phone = m.phone; + if (o.oneofs) + d._phone = "phone"; + } + return d; + }; + + CtwaContextLinkData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CtwaContextLinkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -5938,10 +12747,14 @@ export const proto = $root.proto = (() => { Citation.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(10).string(m.title); - w.uint32(18).string(m.subtitle); - w.uint32(26).string(m.cmsId); - w.uint32(34).string(m.imageUrl); + if (m.title != null && Object.hasOwnProperty.call(m, "title")) + w.uint32(10).string(m.title); + if (m.subtitle != null && Object.hasOwnProperty.call(m, "subtitle")) + w.uint32(18).string(m.subtitle); + if (m.cmsId != null && Object.hasOwnProperty.call(m, "cmsId")) + w.uint32(26).string(m.cmsId); + if (m.imageUrl != null && Object.hasOwnProperty.call(m, "imageUrl")) + w.uint32(34).string(m.imageUrl); return w; }; @@ -5975,17 +12788,57 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("title")) - throw $util.ProtocolError("missing required 'title'", { instance: m }); - if (!m.hasOwnProperty("subtitle")) - throw $util.ProtocolError("missing required 'subtitle'", { instance: m }); - if (!m.hasOwnProperty("cmsId")) - throw $util.ProtocolError("missing required 'cmsId'", { instance: m }); - if (!m.hasOwnProperty("imageUrl")) - throw $util.ProtocolError("missing required 'imageUrl'", { instance: m }); return m; }; + Citation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Citation) + return d; + var m = new $root.proto.Citation(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.subtitle != null) { + m.subtitle = String(d.subtitle); + } + if (d.cmsId != null) { + m.cmsId = String(d.cmsId); + } + if (d.imageUrl != null) { + m.imageUrl = String(d.imageUrl); + } + return m; + }; + + Citation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.title = ""; + d.subtitle = ""; + d.cmsId = ""; + d.imageUrl = ""; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + } + if (m.subtitle != null && m.hasOwnProperty("subtitle")) { + d.subtitle = m.subtitle; + } + if (m.cmsId != null && m.hasOwnProperty("cmsId")) { + d.cmsId = m.cmsId; + } + if (m.imageUrl != null && m.hasOwnProperty("imageUrl")) { + d.imageUrl = m.imageUrl; + } + return d; + }; + + Citation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Citation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6005,8 +12858,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ClientPairingProps.prototype.isChatDbLidMigrated = false; - ClientPairingProps.prototype.isSyncdPureLidSession = false; + ClientPairingProps.prototype.isChatDbLidMigrated = null; + ClientPairingProps.prototype.isSyncdPureLidSession = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPairingProps.prototype, "_isChatDbLidMigrated", { + get: $util.oneOfGetter($oneOfFields = ["isChatDbLidMigrated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPairingProps.prototype, "_isSyncdPureLidSession", { + get: $util.oneOfGetter($oneOfFields = ["isSyncdPureLidSession"]), + set: $util.oneOfSetter($oneOfFields) + }); ClientPairingProps.create = function create(properties) { return new ClientPairingProps(properties); @@ -6047,6 +12914,40 @@ export const proto = $root.proto = (() => { return m; }; + ClientPairingProps.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPairingProps) + return d; + var m = new $root.proto.ClientPairingProps(); + if (d.isChatDbLidMigrated != null) { + m.isChatDbLidMigrated = Boolean(d.isChatDbLidMigrated); + } + if (d.isSyncdPureLidSession != null) { + m.isSyncdPureLidSession = Boolean(d.isSyncdPureLidSession); + } + return m; + }; + + ClientPairingProps.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isChatDbLidMigrated != null && m.hasOwnProperty("isChatDbLidMigrated")) { + d.isChatDbLidMigrated = m.isChatDbLidMigrated; + if (o.oneofs) + d._isChatDbLidMigrated = "isChatDbLidMigrated"; + } + if (m.isSyncdPureLidSession != null && m.hasOwnProperty("isSyncdPureLidSession")) { + d.isSyncdPureLidSession = m.isSyncdPureLidSession; + if (o.oneofs) + d._isSyncdPureLidSession = "isSyncdPureLidSession"; + } + return d; + }; + + ClientPairingProps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ClientPairingProps.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6067,36 +12968,212 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ClientPayload.prototype.username = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ClientPayload.prototype.passive = false; + ClientPayload.prototype.username = null; + ClientPayload.prototype.passive = null; ClientPayload.prototype.userAgent = null; ClientPayload.prototype.webInfo = null; - ClientPayload.prototype.pushName = ""; - ClientPayload.prototype.sessionId = 0; - ClientPayload.prototype.shortConnect = false; - ClientPayload.prototype.connectType = 0; - ClientPayload.prototype.connectReason = 0; + ClientPayload.prototype.pushName = null; + ClientPayload.prototype.sessionId = null; + ClientPayload.prototype.shortConnect = null; + ClientPayload.prototype.connectType = null; + ClientPayload.prototype.connectReason = null; ClientPayload.prototype.shards = $util.emptyArray; ClientPayload.prototype.dnsSource = null; - ClientPayload.prototype.connectAttemptCount = 0; - ClientPayload.prototype.device = 0; + ClientPayload.prototype.connectAttemptCount = null; + ClientPayload.prototype.device = null; ClientPayload.prototype.devicePairingData = null; - ClientPayload.prototype.product = 0; - ClientPayload.prototype.fbCat = $util.newBuffer([]); - ClientPayload.prototype.fbUserAgent = $util.newBuffer([]); - ClientPayload.prototype.oc = false; - ClientPayload.prototype.lc = 0; - ClientPayload.prototype.iosAppExtension = 0; - ClientPayload.prototype.fbAppId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ClientPayload.prototype.fbDeviceId = $util.newBuffer([]); - ClientPayload.prototype.pull = false; - ClientPayload.prototype.paddingBytes = $util.newBuffer([]); - ClientPayload.prototype.yearClass = 0; - ClientPayload.prototype.memClass = 0; + ClientPayload.prototype.product = null; + ClientPayload.prototype.fbCat = null; + ClientPayload.prototype.fbUserAgent = null; + ClientPayload.prototype.oc = null; + ClientPayload.prototype.lc = null; + ClientPayload.prototype.iosAppExtension = null; + ClientPayload.prototype.fbAppId = null; + ClientPayload.prototype.fbDeviceId = null; + ClientPayload.prototype.pull = null; + ClientPayload.prototype.paddingBytes = null; + ClientPayload.prototype.yearClass = null; + ClientPayload.prototype.memClass = null; ClientPayload.prototype.interopData = null; - ClientPayload.prototype.trafficAnonymization = 0; - ClientPayload.prototype.lidDbMigrated = false; - ClientPayload.prototype.accountType = 0; + ClientPayload.prototype.trafficAnonymization = null; + ClientPayload.prototype.lidDbMigrated = null; + ClientPayload.prototype.accountType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_username", { + get: $util.oneOfGetter($oneOfFields = ["username"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_passive", { + get: $util.oneOfGetter($oneOfFields = ["passive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_userAgent", { + get: $util.oneOfGetter($oneOfFields = ["userAgent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_webInfo", { + get: $util.oneOfGetter($oneOfFields = ["webInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_pushName", { + get: $util.oneOfGetter($oneOfFields = ["pushName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_sessionId", { + get: $util.oneOfGetter($oneOfFields = ["sessionId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_shortConnect", { + get: $util.oneOfGetter($oneOfFields = ["shortConnect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_connectType", { + get: $util.oneOfGetter($oneOfFields = ["connectType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_connectReason", { + get: $util.oneOfGetter($oneOfFields = ["connectReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_dnsSource", { + get: $util.oneOfGetter($oneOfFields = ["dnsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_connectAttemptCount", { + get: $util.oneOfGetter($oneOfFields = ["connectAttemptCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_device", { + get: $util.oneOfGetter($oneOfFields = ["device"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_devicePairingData", { + get: $util.oneOfGetter($oneOfFields = ["devicePairingData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_product", { + get: $util.oneOfGetter($oneOfFields = ["product"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_fbCat", { + get: $util.oneOfGetter($oneOfFields = ["fbCat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_fbUserAgent", { + get: $util.oneOfGetter($oneOfFields = ["fbUserAgent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_oc", { + get: $util.oneOfGetter($oneOfFields = ["oc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_lc", { + get: $util.oneOfGetter($oneOfFields = ["lc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_iosAppExtension", { + get: $util.oneOfGetter($oneOfFields = ["iosAppExtension"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_fbAppId", { + get: $util.oneOfGetter($oneOfFields = ["fbAppId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_fbDeviceId", { + get: $util.oneOfGetter($oneOfFields = ["fbDeviceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_pull", { + get: $util.oneOfGetter($oneOfFields = ["pull"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_paddingBytes", { + get: $util.oneOfGetter($oneOfFields = ["paddingBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_yearClass", { + get: $util.oneOfGetter($oneOfFields = ["yearClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_memClass", { + get: $util.oneOfGetter($oneOfFields = ["memClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_interopData", { + get: $util.oneOfGetter($oneOfFields = ["interopData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_trafficAnonymization", { + get: $util.oneOfGetter($oneOfFields = ["trafficAnonymization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_lidDbMigrated", { + get: $util.oneOfGetter($oneOfFields = ["lidDbMigrated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientPayload.prototype, "_accountType", { + get: $util.oneOfGetter($oneOfFields = ["accountType"]), + set: $util.oneOfSetter($oneOfFields) + }); ClientPayload.create = function create(properties) { return new ClientPayload(properties); @@ -6124,8 +13201,10 @@ export const proto = $root.proto = (() => { if (m.connectReason != null && Object.hasOwnProperty.call(m, "connectReason")) w.uint32(104).int32(m.connectReason); if (m.shards != null && m.shards.length) { + w.uint32(114).fork(); for (var i = 0; i < m.shards.length; ++i) - w.uint32(112).int32(m.shards[i]); + w.int32(m.shards[i]); + w.ldelim(); } if (m.dnsSource != null && Object.hasOwnProperty.call(m, "dnsSource")) $root.proto.ClientPayload.DNSSource.encode(m.dnsSource, w.uint32(122).fork()).ldelim(); @@ -6314,6 +13393,481 @@ export const proto = $root.proto = (() => { return m; }; + ClientPayload.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload) + return d; + var m = new $root.proto.ClientPayload(); + if (d.username != null) { + if ($util.Long) + (m.username = $util.Long.fromValue(d.username)).unsigned = true; + else if (typeof d.username === "string") + m.username = parseInt(d.username, 10); + else if (typeof d.username === "number") + m.username = d.username; + else if (typeof d.username === "object") + m.username = new $util.LongBits(d.username.low >>> 0, d.username.high >>> 0).toNumber(true); + } + if (d.passive != null) { + m.passive = Boolean(d.passive); + } + if (d.userAgent != null) { + if (typeof d.userAgent !== "object") + throw TypeError(".proto.ClientPayload.userAgent: object expected"); + m.userAgent = $root.proto.ClientPayload.UserAgent.fromObject(d.userAgent); + } + if (d.webInfo != null) { + if (typeof d.webInfo !== "object") + throw TypeError(".proto.ClientPayload.webInfo: object expected"); + m.webInfo = $root.proto.ClientPayload.WebInfo.fromObject(d.webInfo); + } + if (d.pushName != null) { + m.pushName = String(d.pushName); + } + if (d.sessionId != null) { + m.sessionId = d.sessionId | 0; + } + if (d.shortConnect != null) { + m.shortConnect = Boolean(d.shortConnect); + } + switch (d.connectType) { + default: + if (typeof d.connectType === "number") { + m.connectType = d.connectType; + break; + } + break; + case "CELLULAR_UNKNOWN": + case 0: + m.connectType = 0; + break; + case "WIFI_UNKNOWN": + case 1: + m.connectType = 1; + break; + case "CELLULAR_EDGE": + case 100: + m.connectType = 100; + break; + case "CELLULAR_IDEN": + case 101: + m.connectType = 101; + break; + case "CELLULAR_UMTS": + case 102: + m.connectType = 102; + break; + case "CELLULAR_EVDO": + case 103: + m.connectType = 103; + break; + case "CELLULAR_GPRS": + case 104: + m.connectType = 104; + break; + case "CELLULAR_HSDPA": + case 105: + m.connectType = 105; + break; + case "CELLULAR_HSUPA": + case 106: + m.connectType = 106; + break; + case "CELLULAR_HSPA": + case 107: + m.connectType = 107; + break; + case "CELLULAR_CDMA": + case 108: + m.connectType = 108; + break; + case "CELLULAR_1XRTT": + case 109: + m.connectType = 109; + break; + case "CELLULAR_EHRPD": + case 110: + m.connectType = 110; + break; + case "CELLULAR_LTE": + case 111: + m.connectType = 111; + break; + case "CELLULAR_HSPAP": + case 112: + m.connectType = 112; + break; + } + switch (d.connectReason) { + default: + if (typeof d.connectReason === "number") { + m.connectReason = d.connectReason; + break; + } + break; + case "PUSH": + case 0: + m.connectReason = 0; + break; + case "USER_ACTIVATED": + case 1: + m.connectReason = 1; + break; + case "SCHEDULED": + case 2: + m.connectReason = 2; + break; + case "ERROR_RECONNECT": + case 3: + m.connectReason = 3; + break; + case "NETWORK_SWITCH": + case 4: + m.connectReason = 4; + break; + case "PING_RECONNECT": + case 5: + m.connectReason = 5; + break; + case "UNKNOWN": + case 6: + m.connectReason = 6; + break; + } + if (d.shards) { + if (!Array.isArray(d.shards)) + throw TypeError(".proto.ClientPayload.shards: array expected"); + m.shards = []; + for (var i = 0; i < d.shards.length; ++i) { + m.shards[i] = d.shards[i] | 0; + } + } + if (d.dnsSource != null) { + if (typeof d.dnsSource !== "object") + throw TypeError(".proto.ClientPayload.dnsSource: object expected"); + m.dnsSource = $root.proto.ClientPayload.DNSSource.fromObject(d.dnsSource); + } + if (d.connectAttemptCount != null) { + m.connectAttemptCount = d.connectAttemptCount >>> 0; + } + if (d.device != null) { + m.device = d.device >>> 0; + } + if (d.devicePairingData != null) { + if (typeof d.devicePairingData !== "object") + throw TypeError(".proto.ClientPayload.devicePairingData: object expected"); + m.devicePairingData = $root.proto.ClientPayload.DevicePairingRegistrationData.fromObject(d.devicePairingData); + } + switch (d.product) { + default: + if (typeof d.product === "number") { + m.product = d.product; + break; + } + break; + case "WHATSAPP": + case 0: + m.product = 0; + break; + case "MESSENGER": + case 1: + m.product = 1; + break; + case "INTEROP": + case 2: + m.product = 2; + break; + case "INTEROP_MSGR": + case 3: + m.product = 3; + break; + case "WHATSAPP_LID": + case 4: + m.product = 4; + break; + } + if (d.fbCat != null) { + if (typeof d.fbCat === "string") + $util.base64.decode(d.fbCat, m.fbCat = $util.newBuffer($util.base64.length(d.fbCat)), 0); + else if (d.fbCat.length >= 0) + m.fbCat = d.fbCat; + } + if (d.fbUserAgent != null) { + if (typeof d.fbUserAgent === "string") + $util.base64.decode(d.fbUserAgent, m.fbUserAgent = $util.newBuffer($util.base64.length(d.fbUserAgent)), 0); + else if (d.fbUserAgent.length >= 0) + m.fbUserAgent = d.fbUserAgent; + } + if (d.oc != null) { + m.oc = Boolean(d.oc); + } + if (d.lc != null) { + m.lc = d.lc | 0; + } + switch (d.iosAppExtension) { + default: + if (typeof d.iosAppExtension === "number") { + m.iosAppExtension = d.iosAppExtension; + break; + } + break; + case "SHARE_EXTENSION": + case 0: + m.iosAppExtension = 0; + break; + case "SERVICE_EXTENSION": + case 1: + m.iosAppExtension = 1; + break; + case "INTENTS_EXTENSION": + case 2: + m.iosAppExtension = 2; + break; + } + if (d.fbAppId != null) { + if ($util.Long) + (m.fbAppId = $util.Long.fromValue(d.fbAppId)).unsigned = true; + else if (typeof d.fbAppId === "string") + m.fbAppId = parseInt(d.fbAppId, 10); + else if (typeof d.fbAppId === "number") + m.fbAppId = d.fbAppId; + else if (typeof d.fbAppId === "object") + m.fbAppId = new $util.LongBits(d.fbAppId.low >>> 0, d.fbAppId.high >>> 0).toNumber(true); + } + if (d.fbDeviceId != null) { + if (typeof d.fbDeviceId === "string") + $util.base64.decode(d.fbDeviceId, m.fbDeviceId = $util.newBuffer($util.base64.length(d.fbDeviceId)), 0); + else if (d.fbDeviceId.length >= 0) + m.fbDeviceId = d.fbDeviceId; + } + if (d.pull != null) { + m.pull = Boolean(d.pull); + } + if (d.paddingBytes != null) { + if (typeof d.paddingBytes === "string") + $util.base64.decode(d.paddingBytes, m.paddingBytes = $util.newBuffer($util.base64.length(d.paddingBytes)), 0); + else if (d.paddingBytes.length >= 0) + m.paddingBytes = d.paddingBytes; + } + if (d.yearClass != null) { + m.yearClass = d.yearClass | 0; + } + if (d.memClass != null) { + m.memClass = d.memClass | 0; + } + if (d.interopData != null) { + if (typeof d.interopData !== "object") + throw TypeError(".proto.ClientPayload.interopData: object expected"); + m.interopData = $root.proto.ClientPayload.InteropData.fromObject(d.interopData); + } + switch (d.trafficAnonymization) { + default: + if (typeof d.trafficAnonymization === "number") { + m.trafficAnonymization = d.trafficAnonymization; + break; + } + break; + case "OFF": + case 0: + m.trafficAnonymization = 0; + break; + case "STANDARD": + case 1: + m.trafficAnonymization = 1; + break; + } + if (d.lidDbMigrated != null) { + m.lidDbMigrated = Boolean(d.lidDbMigrated); + } + switch (d.accountType) { + default: + if (typeof d.accountType === "number") { + m.accountType = d.accountType; + break; + } + break; + case "DEFAULT": + case 0: + m.accountType = 0; + break; + case "GUEST": + case 1: + m.accountType = 1; + break; + } + return m; + }; + + ClientPayload.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.shards = []; + } + if (m.username != null && m.hasOwnProperty("username")) { + if (typeof m.username === "number") + d.username = o.longs === String ? String(m.username) : m.username; + else + d.username = o.longs === String ? $util.Long.prototype.toString.call(m.username) : o.longs === Number ? new $util.LongBits(m.username.low >>> 0, m.username.high >>> 0).toNumber(true) : m.username; + if (o.oneofs) + d._username = "username"; + } + if (m.passive != null && m.hasOwnProperty("passive")) { + d.passive = m.passive; + if (o.oneofs) + d._passive = "passive"; + } + if (m.userAgent != null && m.hasOwnProperty("userAgent")) { + d.userAgent = $root.proto.ClientPayload.UserAgent.toObject(m.userAgent, o); + if (o.oneofs) + d._userAgent = "userAgent"; + } + if (m.webInfo != null && m.hasOwnProperty("webInfo")) { + d.webInfo = $root.proto.ClientPayload.WebInfo.toObject(m.webInfo, o); + if (o.oneofs) + d._webInfo = "webInfo"; + } + if (m.pushName != null && m.hasOwnProperty("pushName")) { + d.pushName = m.pushName; + if (o.oneofs) + d._pushName = "pushName"; + } + if (m.sessionId != null && m.hasOwnProperty("sessionId")) { + d.sessionId = m.sessionId; + if (o.oneofs) + d._sessionId = "sessionId"; + } + if (m.shortConnect != null && m.hasOwnProperty("shortConnect")) { + d.shortConnect = m.shortConnect; + if (o.oneofs) + d._shortConnect = "shortConnect"; + } + if (m.connectType != null && m.hasOwnProperty("connectType")) { + d.connectType = o.enums === String ? $root.proto.ClientPayload.ConnectType[m.connectType] === undefined ? m.connectType : $root.proto.ClientPayload.ConnectType[m.connectType] : m.connectType; + if (o.oneofs) + d._connectType = "connectType"; + } + if (m.connectReason != null && m.hasOwnProperty("connectReason")) { + d.connectReason = o.enums === String ? $root.proto.ClientPayload.ConnectReason[m.connectReason] === undefined ? m.connectReason : $root.proto.ClientPayload.ConnectReason[m.connectReason] : m.connectReason; + if (o.oneofs) + d._connectReason = "connectReason"; + } + if (m.shards && m.shards.length) { + d.shards = []; + for (var j = 0; j < m.shards.length; ++j) { + d.shards[j] = m.shards[j]; + } + } + if (m.dnsSource != null && m.hasOwnProperty("dnsSource")) { + d.dnsSource = $root.proto.ClientPayload.DNSSource.toObject(m.dnsSource, o); + if (o.oneofs) + d._dnsSource = "dnsSource"; + } + if (m.connectAttemptCount != null && m.hasOwnProperty("connectAttemptCount")) { + d.connectAttemptCount = m.connectAttemptCount; + if (o.oneofs) + d._connectAttemptCount = "connectAttemptCount"; + } + if (m.device != null && m.hasOwnProperty("device")) { + d.device = m.device; + if (o.oneofs) + d._device = "device"; + } + if (m.devicePairingData != null && m.hasOwnProperty("devicePairingData")) { + d.devicePairingData = $root.proto.ClientPayload.DevicePairingRegistrationData.toObject(m.devicePairingData, o); + if (o.oneofs) + d._devicePairingData = "devicePairingData"; + } + if (m.product != null && m.hasOwnProperty("product")) { + d.product = o.enums === String ? $root.proto.ClientPayload.Product[m.product] === undefined ? m.product : $root.proto.ClientPayload.Product[m.product] : m.product; + if (o.oneofs) + d._product = "product"; + } + if (m.fbCat != null && m.hasOwnProperty("fbCat")) { + d.fbCat = o.bytes === String ? $util.base64.encode(m.fbCat, 0, m.fbCat.length) : o.bytes === Array ? Array.prototype.slice.call(m.fbCat) : m.fbCat; + if (o.oneofs) + d._fbCat = "fbCat"; + } + if (m.fbUserAgent != null && m.hasOwnProperty("fbUserAgent")) { + d.fbUserAgent = o.bytes === String ? $util.base64.encode(m.fbUserAgent, 0, m.fbUserAgent.length) : o.bytes === Array ? Array.prototype.slice.call(m.fbUserAgent) : m.fbUserAgent; + if (o.oneofs) + d._fbUserAgent = "fbUserAgent"; + } + if (m.oc != null && m.hasOwnProperty("oc")) { + d.oc = m.oc; + if (o.oneofs) + d._oc = "oc"; + } + if (m.lc != null && m.hasOwnProperty("lc")) { + d.lc = m.lc; + if (o.oneofs) + d._lc = "lc"; + } + if (m.iosAppExtension != null && m.hasOwnProperty("iosAppExtension")) { + d.iosAppExtension = o.enums === String ? $root.proto.ClientPayload.IOSAppExtension[m.iosAppExtension] === undefined ? m.iosAppExtension : $root.proto.ClientPayload.IOSAppExtension[m.iosAppExtension] : m.iosAppExtension; + if (o.oneofs) + d._iosAppExtension = "iosAppExtension"; + } + if (m.fbAppId != null && m.hasOwnProperty("fbAppId")) { + if (typeof m.fbAppId === "number") + d.fbAppId = o.longs === String ? String(m.fbAppId) : m.fbAppId; + else + d.fbAppId = o.longs === String ? $util.Long.prototype.toString.call(m.fbAppId) : o.longs === Number ? new $util.LongBits(m.fbAppId.low >>> 0, m.fbAppId.high >>> 0).toNumber(true) : m.fbAppId; + if (o.oneofs) + d._fbAppId = "fbAppId"; + } + if (m.fbDeviceId != null && m.hasOwnProperty("fbDeviceId")) { + d.fbDeviceId = o.bytes === String ? $util.base64.encode(m.fbDeviceId, 0, m.fbDeviceId.length) : o.bytes === Array ? Array.prototype.slice.call(m.fbDeviceId) : m.fbDeviceId; + if (o.oneofs) + d._fbDeviceId = "fbDeviceId"; + } + if (m.pull != null && m.hasOwnProperty("pull")) { + d.pull = m.pull; + if (o.oneofs) + d._pull = "pull"; + } + if (m.paddingBytes != null && m.hasOwnProperty("paddingBytes")) { + d.paddingBytes = o.bytes === String ? $util.base64.encode(m.paddingBytes, 0, m.paddingBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.paddingBytes) : m.paddingBytes; + if (o.oneofs) + d._paddingBytes = "paddingBytes"; + } + if (m.yearClass != null && m.hasOwnProperty("yearClass")) { + d.yearClass = m.yearClass; + if (o.oneofs) + d._yearClass = "yearClass"; + } + if (m.memClass != null && m.hasOwnProperty("memClass")) { + d.memClass = m.memClass; + if (o.oneofs) + d._memClass = "memClass"; + } + if (m.interopData != null && m.hasOwnProperty("interopData")) { + d.interopData = $root.proto.ClientPayload.InteropData.toObject(m.interopData, o); + if (o.oneofs) + d._interopData = "interopData"; + } + if (m.trafficAnonymization != null && m.hasOwnProperty("trafficAnonymization")) { + d.trafficAnonymization = o.enums === String ? $root.proto.ClientPayload.TrafficAnonymization[m.trafficAnonymization] === undefined ? m.trafficAnonymization : $root.proto.ClientPayload.TrafficAnonymization[m.trafficAnonymization] : m.trafficAnonymization; + if (o.oneofs) + d._trafficAnonymization = "trafficAnonymization"; + } + if (m.lidDbMigrated != null && m.hasOwnProperty("lidDbMigrated")) { + d.lidDbMigrated = m.lidDbMigrated; + if (o.oneofs) + d._lidDbMigrated = "lidDbMigrated"; + } + if (m.accountType != null && m.hasOwnProperty("accountType")) { + d.accountType = o.enums === String ? $root.proto.ClientPayload.AccountType[m.accountType] === undefined ? m.accountType : $root.proto.ClientPayload.AccountType[m.accountType] : m.accountType; + if (o.oneofs) + d._accountType = "accountType"; + } + return d; + }; + + ClientPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ClientPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6369,8 +13923,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DNSSource.prototype.dnsMethod = 0; - DNSSource.prototype.appCached = false; + DNSSource.prototype.dnsMethod = null; + DNSSource.prototype.appCached = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DNSSource.prototype, "_dnsMethod", { + get: $util.oneOfGetter($oneOfFields = ["dnsMethod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DNSSource.prototype, "_appCached", { + get: $util.oneOfGetter($oneOfFields = ["appCached"]), + set: $util.oneOfSetter($oneOfFields) + }); DNSSource.create = function create(properties) { return new DNSSource(properties); @@ -6411,6 +13979,69 @@ export const proto = $root.proto = (() => { return m; }; + DNSSource.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.DNSSource) + return d; + var m = new $root.proto.ClientPayload.DNSSource(); + switch (d.dnsMethod) { + default: + if (typeof d.dnsMethod === "number") { + m.dnsMethod = d.dnsMethod; + break; + } + break; + case "SYSTEM": + case 0: + m.dnsMethod = 0; + break; + case "GOOGLE": + case 1: + m.dnsMethod = 1; + break; + case "HARDCODED": + case 2: + m.dnsMethod = 2; + break; + case "OVERRIDE": + case 3: + m.dnsMethod = 3; + break; + case "FALLBACK": + case 4: + m.dnsMethod = 4; + break; + case "MNS": + case 5: + m.dnsMethod = 5; + break; + } + if (d.appCached != null) { + m.appCached = Boolean(d.appCached); + } + return m; + }; + + DNSSource.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.dnsMethod != null && m.hasOwnProperty("dnsMethod")) { + d.dnsMethod = o.enums === String ? $root.proto.ClientPayload.DNSSource.DNSResolutionMethod[m.dnsMethod] === undefined ? m.dnsMethod : $root.proto.ClientPayload.DNSSource.DNSResolutionMethod[m.dnsMethod] : m.dnsMethod; + if (o.oneofs) + d._dnsMethod = "dnsMethod"; + } + if (m.appCached != null && m.hasOwnProperty("appCached")) { + d.appCached = m.appCached; + if (o.oneofs) + d._appCached = "appCached"; + } + return d; + }; + + DNSSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DNSSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6441,14 +14072,64 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DevicePairingRegistrationData.prototype.eRegid = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.eKeytype = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.eIdent = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.eSkeyId = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.eSkeyVal = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.eSkeySig = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.buildHash = $util.newBuffer([]); - DevicePairingRegistrationData.prototype.deviceProps = $util.newBuffer([]); + DevicePairingRegistrationData.prototype.eRegid = null; + DevicePairingRegistrationData.prototype.eKeytype = null; + DevicePairingRegistrationData.prototype.eIdent = null; + DevicePairingRegistrationData.prototype.eSkeyId = null; + DevicePairingRegistrationData.prototype.eSkeyVal = null; + DevicePairingRegistrationData.prototype.eSkeySig = null; + DevicePairingRegistrationData.prototype.buildHash = null; + DevicePairingRegistrationData.prototype.deviceProps = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_eRegid", { + get: $util.oneOfGetter($oneOfFields = ["eRegid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_eKeytype", { + get: $util.oneOfGetter($oneOfFields = ["eKeytype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_eIdent", { + get: $util.oneOfGetter($oneOfFields = ["eIdent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeyId", { + get: $util.oneOfGetter($oneOfFields = ["eSkeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeyVal", { + get: $util.oneOfGetter($oneOfFields = ["eSkeyVal"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeySig", { + get: $util.oneOfGetter($oneOfFields = ["eSkeySig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_buildHash", { + get: $util.oneOfGetter($oneOfFields = ["buildHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DevicePairingRegistrationData.prototype, "_deviceProps", { + get: $util.oneOfGetter($oneOfFields = ["deviceProps"]), + set: $util.oneOfSetter($oneOfFields) + }); DevicePairingRegistrationData.create = function create(properties) { return new DevicePairingRegistrationData(properties); @@ -6525,6 +14206,112 @@ export const proto = $root.proto = (() => { return m; }; + DevicePairingRegistrationData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.DevicePairingRegistrationData) + return d; + var m = new $root.proto.ClientPayload.DevicePairingRegistrationData(); + if (d.eRegid != null) { + if (typeof d.eRegid === "string") + $util.base64.decode(d.eRegid, m.eRegid = $util.newBuffer($util.base64.length(d.eRegid)), 0); + else if (d.eRegid.length >= 0) + m.eRegid = d.eRegid; + } + if (d.eKeytype != null) { + if (typeof d.eKeytype === "string") + $util.base64.decode(d.eKeytype, m.eKeytype = $util.newBuffer($util.base64.length(d.eKeytype)), 0); + else if (d.eKeytype.length >= 0) + m.eKeytype = d.eKeytype; + } + if (d.eIdent != null) { + if (typeof d.eIdent === "string") + $util.base64.decode(d.eIdent, m.eIdent = $util.newBuffer($util.base64.length(d.eIdent)), 0); + else if (d.eIdent.length >= 0) + m.eIdent = d.eIdent; + } + if (d.eSkeyId != null) { + if (typeof d.eSkeyId === "string") + $util.base64.decode(d.eSkeyId, m.eSkeyId = $util.newBuffer($util.base64.length(d.eSkeyId)), 0); + else if (d.eSkeyId.length >= 0) + m.eSkeyId = d.eSkeyId; + } + if (d.eSkeyVal != null) { + if (typeof d.eSkeyVal === "string") + $util.base64.decode(d.eSkeyVal, m.eSkeyVal = $util.newBuffer($util.base64.length(d.eSkeyVal)), 0); + else if (d.eSkeyVal.length >= 0) + m.eSkeyVal = d.eSkeyVal; + } + if (d.eSkeySig != null) { + if (typeof d.eSkeySig === "string") + $util.base64.decode(d.eSkeySig, m.eSkeySig = $util.newBuffer($util.base64.length(d.eSkeySig)), 0); + else if (d.eSkeySig.length >= 0) + m.eSkeySig = d.eSkeySig; + } + if (d.buildHash != null) { + if (typeof d.buildHash === "string") + $util.base64.decode(d.buildHash, m.buildHash = $util.newBuffer($util.base64.length(d.buildHash)), 0); + else if (d.buildHash.length >= 0) + m.buildHash = d.buildHash; + } + if (d.deviceProps != null) { + if (typeof d.deviceProps === "string") + $util.base64.decode(d.deviceProps, m.deviceProps = $util.newBuffer($util.base64.length(d.deviceProps)), 0); + else if (d.deviceProps.length >= 0) + m.deviceProps = d.deviceProps; + } + return m; + }; + + DevicePairingRegistrationData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.eRegid != null && m.hasOwnProperty("eRegid")) { + d.eRegid = o.bytes === String ? $util.base64.encode(m.eRegid, 0, m.eRegid.length) : o.bytes === Array ? Array.prototype.slice.call(m.eRegid) : m.eRegid; + if (o.oneofs) + d._eRegid = "eRegid"; + } + if (m.eKeytype != null && m.hasOwnProperty("eKeytype")) { + d.eKeytype = o.bytes === String ? $util.base64.encode(m.eKeytype, 0, m.eKeytype.length) : o.bytes === Array ? Array.prototype.slice.call(m.eKeytype) : m.eKeytype; + if (o.oneofs) + d._eKeytype = "eKeytype"; + } + if (m.eIdent != null && m.hasOwnProperty("eIdent")) { + d.eIdent = o.bytes === String ? $util.base64.encode(m.eIdent, 0, m.eIdent.length) : o.bytes === Array ? Array.prototype.slice.call(m.eIdent) : m.eIdent; + if (o.oneofs) + d._eIdent = "eIdent"; + } + if (m.eSkeyId != null && m.hasOwnProperty("eSkeyId")) { + d.eSkeyId = o.bytes === String ? $util.base64.encode(m.eSkeyId, 0, m.eSkeyId.length) : o.bytes === Array ? Array.prototype.slice.call(m.eSkeyId) : m.eSkeyId; + if (o.oneofs) + d._eSkeyId = "eSkeyId"; + } + if (m.eSkeyVal != null && m.hasOwnProperty("eSkeyVal")) { + d.eSkeyVal = o.bytes === String ? $util.base64.encode(m.eSkeyVal, 0, m.eSkeyVal.length) : o.bytes === Array ? Array.prototype.slice.call(m.eSkeyVal) : m.eSkeyVal; + if (o.oneofs) + d._eSkeyVal = "eSkeyVal"; + } + if (m.eSkeySig != null && m.hasOwnProperty("eSkeySig")) { + d.eSkeySig = o.bytes === String ? $util.base64.encode(m.eSkeySig, 0, m.eSkeySig.length) : o.bytes === Array ? Array.prototype.slice.call(m.eSkeySig) : m.eSkeySig; + if (o.oneofs) + d._eSkeySig = "eSkeySig"; + } + if (m.buildHash != null && m.hasOwnProperty("buildHash")) { + d.buildHash = o.bytes === String ? $util.base64.encode(m.buildHash, 0, m.buildHash.length) : o.bytes === Array ? Array.prototype.slice.call(m.buildHash) : m.buildHash; + if (o.oneofs) + d._buildHash = "buildHash"; + } + if (m.deviceProps != null && m.hasOwnProperty("deviceProps")) { + d.deviceProps = o.bytes === String ? $util.base64.encode(m.deviceProps, 0, m.deviceProps.length) : o.bytes === Array ? Array.prototype.slice.call(m.deviceProps) : m.deviceProps; + if (o.oneofs) + d._deviceProps = "deviceProps"; + } + return d; + }; + + DevicePairingRegistrationData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DevicePairingRegistrationData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6552,9 +14339,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - InteropData.prototype.accountId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - InteropData.prototype.token = $util.newBuffer([]); - InteropData.prototype.enableReadReceipts = false; + InteropData.prototype.accountId = null; + InteropData.prototype.token = null; + InteropData.prototype.enableReadReceipts = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteropData.prototype, "_accountId", { + get: $util.oneOfGetter($oneOfFields = ["accountId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteropData.prototype, "_token", { + get: $util.oneOfGetter($oneOfFields = ["token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteropData.prototype, "_enableReadReceipts", { + get: $util.oneOfGetter($oneOfFields = ["enableReadReceipts"]), + set: $util.oneOfSetter($oneOfFields) + }); InteropData.create = function create(properties) { return new InteropData(properties); @@ -6601,6 +14408,61 @@ export const proto = $root.proto = (() => { return m; }; + InteropData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.InteropData) + return d; + var m = new $root.proto.ClientPayload.InteropData(); + if (d.accountId != null) { + if ($util.Long) + (m.accountId = $util.Long.fromValue(d.accountId)).unsigned = true; + else if (typeof d.accountId === "string") + m.accountId = parseInt(d.accountId, 10); + else if (typeof d.accountId === "number") + m.accountId = d.accountId; + else if (typeof d.accountId === "object") + m.accountId = new $util.LongBits(d.accountId.low >>> 0, d.accountId.high >>> 0).toNumber(true); + } + if (d.token != null) { + if (typeof d.token === "string") + $util.base64.decode(d.token, m.token = $util.newBuffer($util.base64.length(d.token)), 0); + else if (d.token.length >= 0) + m.token = d.token; + } + if (d.enableReadReceipts != null) { + m.enableReadReceipts = Boolean(d.enableReadReceipts); + } + return m; + }; + + InteropData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.accountId != null && m.hasOwnProperty("accountId")) { + if (typeof m.accountId === "number") + d.accountId = o.longs === String ? String(m.accountId) : m.accountId; + else + d.accountId = o.longs === String ? $util.Long.prototype.toString.call(m.accountId) : o.longs === Number ? new $util.LongBits(m.accountId.low >>> 0, m.accountId.high >>> 0).toNumber(true) : m.accountId; + if (o.oneofs) + d._accountId = "accountId"; + } + if (m.token != null && m.hasOwnProperty("token")) { + d.token = o.bytes === String ? $util.base64.encode(m.token, 0, m.token.length) : o.bytes === Array ? Array.prototype.slice.call(m.token) : m.token; + if (o.oneofs) + d._token = "token"; + } + if (m.enableReadReceipts != null && m.hasOwnProperty("enableReadReceipts")) { + d.enableReadReceipts = m.enableReadReceipts; + if (o.oneofs) + d._enableReadReceipts = "enableReadReceipts"; + } + return d; + }; + + InteropData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InteropData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6637,22 +14499,120 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UserAgent.prototype.platform = 0; + UserAgent.prototype.platform = null; UserAgent.prototype.appVersion = null; - UserAgent.prototype.mcc = ""; - UserAgent.prototype.mnc = ""; - UserAgent.prototype.osVersion = ""; - UserAgent.prototype.manufacturer = ""; - UserAgent.prototype.device = ""; - UserAgent.prototype.osBuildNumber = ""; - UserAgent.prototype.phoneId = ""; - UserAgent.prototype.releaseChannel = 0; - UserAgent.prototype.localeLanguageIso6391 = ""; - UserAgent.prototype.localeCountryIso31661Alpha2 = ""; - UserAgent.prototype.deviceBoard = ""; - UserAgent.prototype.deviceExpId = ""; - UserAgent.prototype.deviceType = 0; - UserAgent.prototype.deviceModelType = ""; + UserAgent.prototype.mcc = null; + UserAgent.prototype.mnc = null; + UserAgent.prototype.osVersion = null; + UserAgent.prototype.manufacturer = null; + UserAgent.prototype.device = null; + UserAgent.prototype.osBuildNumber = null; + UserAgent.prototype.phoneId = null; + UserAgent.prototype.releaseChannel = null; + UserAgent.prototype.localeLanguageIso6391 = null; + UserAgent.prototype.localeCountryIso31661Alpha2 = null; + UserAgent.prototype.deviceBoard = null; + UserAgent.prototype.deviceExpId = null; + UserAgent.prototype.deviceType = null; + UserAgent.prototype.deviceModelType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_platform", { + get: $util.oneOfGetter($oneOfFields = ["platform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_appVersion", { + get: $util.oneOfGetter($oneOfFields = ["appVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_mcc", { + get: $util.oneOfGetter($oneOfFields = ["mcc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_mnc", { + get: $util.oneOfGetter($oneOfFields = ["mnc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_osVersion", { + get: $util.oneOfGetter($oneOfFields = ["osVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_manufacturer", { + get: $util.oneOfGetter($oneOfFields = ["manufacturer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_device", { + get: $util.oneOfGetter($oneOfFields = ["device"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_osBuildNumber", { + get: $util.oneOfGetter($oneOfFields = ["osBuildNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_phoneId", { + get: $util.oneOfGetter($oneOfFields = ["phoneId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_releaseChannel", { + get: $util.oneOfGetter($oneOfFields = ["releaseChannel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_localeLanguageIso6391", { + get: $util.oneOfGetter($oneOfFields = ["localeLanguageIso6391"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_localeCountryIso31661Alpha2", { + get: $util.oneOfGetter($oneOfFields = ["localeCountryIso31661Alpha2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_deviceBoard", { + get: $util.oneOfGetter($oneOfFields = ["deviceBoard"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_deviceExpId", { + get: $util.oneOfGetter($oneOfFields = ["deviceExpId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_deviceType", { + get: $util.oneOfGetter($oneOfFields = ["deviceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserAgent.prototype, "_deviceModelType", { + get: $util.oneOfGetter($oneOfFields = ["deviceModelType"]), + set: $util.oneOfSetter($oneOfFields) + }); UserAgent.create = function create(properties) { return new UserAgent(properties); @@ -6777,6 +14737,349 @@ export const proto = $root.proto = (() => { return m; }; + UserAgent.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.UserAgent) + return d; + var m = new $root.proto.ClientPayload.UserAgent(); + switch (d.platform) { + default: + if (typeof d.platform === "number") { + m.platform = d.platform; + break; + } + break; + case "ANDROID": + case 0: + m.platform = 0; + break; + case "IOS": + case 1: + m.platform = 1; + break; + case "WINDOWS_PHONE": + case 2: + m.platform = 2; + break; + case "BLACKBERRY": + case 3: + m.platform = 3; + break; + case "BLACKBERRYX": + case 4: + m.platform = 4; + break; + case "S40": + case 5: + m.platform = 5; + break; + case "S60": + case 6: + m.platform = 6; + break; + case "PYTHON_CLIENT": + case 7: + m.platform = 7; + break; + case "TIZEN": + case 8: + m.platform = 8; + break; + case "ENTERPRISE": + case 9: + m.platform = 9; + break; + case "SMB_ANDROID": + case 10: + m.platform = 10; + break; + case "KAIOS": + case 11: + m.platform = 11; + break; + case "SMB_IOS": + case 12: + m.platform = 12; + break; + case "WINDOWS": + case 13: + m.platform = 13; + break; + case "WEB": + case 14: + m.platform = 14; + break; + case "PORTAL": + case 15: + m.platform = 15; + break; + case "GREEN_ANDROID": + case 16: + m.platform = 16; + break; + case "GREEN_IPHONE": + case 17: + m.platform = 17; + break; + case "BLUE_ANDROID": + case 18: + m.platform = 18; + break; + case "BLUE_IPHONE": + case 19: + m.platform = 19; + break; + case "FBLITE_ANDROID": + case 20: + m.platform = 20; + break; + case "MLITE_ANDROID": + case 21: + m.platform = 21; + break; + case "IGLITE_ANDROID": + case 22: + m.platform = 22; + break; + case "PAGE": + case 23: + m.platform = 23; + break; + case "MACOS": + case 24: + m.platform = 24; + break; + case "OCULUS_MSG": + case 25: + m.platform = 25; + break; + case "OCULUS_CALL": + case 26: + m.platform = 26; + break; + case "MILAN": + case 27: + m.platform = 27; + break; + case "CAPI": + case 28: + m.platform = 28; + break; + case "WEAROS": + case 29: + m.platform = 29; + break; + case "ARDEVICE": + case 30: + m.platform = 30; + break; + case "VRDEVICE": + case 31: + m.platform = 31; + break; + case "BLUE_WEB": + case 32: + m.platform = 32; + break; + case "IPAD": + case 33: + m.platform = 33; + break; + case "TEST": + case 34: + m.platform = 34; + break; + case "SMART_GLASSES": + case 35: + m.platform = 35; + break; + } + if (d.appVersion != null) { + if (typeof d.appVersion !== "object") + throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected"); + m.appVersion = $root.proto.ClientPayload.UserAgent.AppVersion.fromObject(d.appVersion); + } + if (d.mcc != null) { + m.mcc = String(d.mcc); + } + if (d.mnc != null) { + m.mnc = String(d.mnc); + } + if (d.osVersion != null) { + m.osVersion = String(d.osVersion); + } + if (d.manufacturer != null) { + m.manufacturer = String(d.manufacturer); + } + if (d.device != null) { + m.device = String(d.device); + } + if (d.osBuildNumber != null) { + m.osBuildNumber = String(d.osBuildNumber); + } + if (d.phoneId != null) { + m.phoneId = String(d.phoneId); + } + switch (d.releaseChannel) { + default: + if (typeof d.releaseChannel === "number") { + m.releaseChannel = d.releaseChannel; + break; + } + break; + case "RELEASE": + case 0: + m.releaseChannel = 0; + break; + case "BETA": + case 1: + m.releaseChannel = 1; + break; + case "ALPHA": + case 2: + m.releaseChannel = 2; + break; + case "DEBUG": + case 3: + m.releaseChannel = 3; + break; + } + if (d.localeLanguageIso6391 != null) { + m.localeLanguageIso6391 = String(d.localeLanguageIso6391); + } + if (d.localeCountryIso31661Alpha2 != null) { + m.localeCountryIso31661Alpha2 = String(d.localeCountryIso31661Alpha2); + } + if (d.deviceBoard != null) { + m.deviceBoard = String(d.deviceBoard); + } + if (d.deviceExpId != null) { + m.deviceExpId = String(d.deviceExpId); + } + switch (d.deviceType) { + default: + if (typeof d.deviceType === "number") { + m.deviceType = d.deviceType; + break; + } + break; + case "PHONE": + case 0: + m.deviceType = 0; + break; + case "TABLET": + case 1: + m.deviceType = 1; + break; + case "DESKTOP": + case 2: + m.deviceType = 2; + break; + case "WEARABLE": + case 3: + m.deviceType = 3; + break; + case "VR": + case 4: + m.deviceType = 4; + break; + } + if (d.deviceModelType != null) { + m.deviceModelType = String(d.deviceModelType); + } + return m; + }; + + UserAgent.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.platform != null && m.hasOwnProperty("platform")) { + d.platform = o.enums === String ? $root.proto.ClientPayload.UserAgent.Platform[m.platform] === undefined ? m.platform : $root.proto.ClientPayload.UserAgent.Platform[m.platform] : m.platform; + if (o.oneofs) + d._platform = "platform"; + } + if (m.appVersion != null && m.hasOwnProperty("appVersion")) { + d.appVersion = $root.proto.ClientPayload.UserAgent.AppVersion.toObject(m.appVersion, o); + if (o.oneofs) + d._appVersion = "appVersion"; + } + if (m.mcc != null && m.hasOwnProperty("mcc")) { + d.mcc = m.mcc; + if (o.oneofs) + d._mcc = "mcc"; + } + if (m.mnc != null && m.hasOwnProperty("mnc")) { + d.mnc = m.mnc; + if (o.oneofs) + d._mnc = "mnc"; + } + if (m.osVersion != null && m.hasOwnProperty("osVersion")) { + d.osVersion = m.osVersion; + if (o.oneofs) + d._osVersion = "osVersion"; + } + if (m.manufacturer != null && m.hasOwnProperty("manufacturer")) { + d.manufacturer = m.manufacturer; + if (o.oneofs) + d._manufacturer = "manufacturer"; + } + if (m.device != null && m.hasOwnProperty("device")) { + d.device = m.device; + if (o.oneofs) + d._device = "device"; + } + if (m.osBuildNumber != null && m.hasOwnProperty("osBuildNumber")) { + d.osBuildNumber = m.osBuildNumber; + if (o.oneofs) + d._osBuildNumber = "osBuildNumber"; + } + if (m.phoneId != null && m.hasOwnProperty("phoneId")) { + d.phoneId = m.phoneId; + if (o.oneofs) + d._phoneId = "phoneId"; + } + if (m.releaseChannel != null && m.hasOwnProperty("releaseChannel")) { + d.releaseChannel = o.enums === String ? $root.proto.ClientPayload.UserAgent.ReleaseChannel[m.releaseChannel] === undefined ? m.releaseChannel : $root.proto.ClientPayload.UserAgent.ReleaseChannel[m.releaseChannel] : m.releaseChannel; + if (o.oneofs) + d._releaseChannel = "releaseChannel"; + } + if (m.localeLanguageIso6391 != null && m.hasOwnProperty("localeLanguageIso6391")) { + d.localeLanguageIso6391 = m.localeLanguageIso6391; + if (o.oneofs) + d._localeLanguageIso6391 = "localeLanguageIso6391"; + } + if (m.localeCountryIso31661Alpha2 != null && m.hasOwnProperty("localeCountryIso31661Alpha2")) { + d.localeCountryIso31661Alpha2 = m.localeCountryIso31661Alpha2; + if (o.oneofs) + d._localeCountryIso31661Alpha2 = "localeCountryIso31661Alpha2"; + } + if (m.deviceBoard != null && m.hasOwnProperty("deviceBoard")) { + d.deviceBoard = m.deviceBoard; + if (o.oneofs) + d._deviceBoard = "deviceBoard"; + } + if (m.deviceExpId != null && m.hasOwnProperty("deviceExpId")) { + d.deviceExpId = m.deviceExpId; + if (o.oneofs) + d._deviceExpId = "deviceExpId"; + } + if (m.deviceType != null && m.hasOwnProperty("deviceType")) { + d.deviceType = o.enums === String ? $root.proto.ClientPayload.UserAgent.DeviceType[m.deviceType] === undefined ? m.deviceType : $root.proto.ClientPayload.UserAgent.DeviceType[m.deviceType] : m.deviceType; + if (o.oneofs) + d._deviceType = "deviceType"; + } + if (m.deviceModelType != null && m.hasOwnProperty("deviceModelType")) { + d.deviceModelType = m.deviceModelType; + if (o.oneofs) + d._deviceModelType = "deviceModelType"; + } + return d; + }; + + UserAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UserAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6793,11 +15096,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AppVersion.prototype.primary = 0; - AppVersion.prototype.secondary = 0; - AppVersion.prototype.tertiary = 0; - AppVersion.prototype.quaternary = 0; - AppVersion.prototype.quinary = 0; + AppVersion.prototype.primary = null; + AppVersion.prototype.secondary = null; + AppVersion.prototype.tertiary = null; + AppVersion.prototype.quaternary = null; + AppVersion.prototype.quinary = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_primary", { + get: $util.oneOfGetter($oneOfFields = ["primary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_secondary", { + get: $util.oneOfGetter($oneOfFields = ["secondary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_tertiary", { + get: $util.oneOfGetter($oneOfFields = ["tertiary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_quaternary", { + get: $util.oneOfGetter($oneOfFields = ["quaternary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_quinary", { + get: $util.oneOfGetter($oneOfFields = ["quinary"]), + set: $util.oneOfSetter($oneOfFields) + }); AppVersion.create = function create(properties) { return new AppVersion(properties); @@ -6856,6 +15191,64 @@ export const proto = $root.proto = (() => { return m; }; + AppVersion.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.UserAgent.AppVersion) + return d; + var m = new $root.proto.ClientPayload.UserAgent.AppVersion(); + if (d.primary != null) { + m.primary = d.primary >>> 0; + } + if (d.secondary != null) { + m.secondary = d.secondary >>> 0; + } + if (d.tertiary != null) { + m.tertiary = d.tertiary >>> 0; + } + if (d.quaternary != null) { + m.quaternary = d.quaternary >>> 0; + } + if (d.quinary != null) { + m.quinary = d.quinary >>> 0; + } + return m; + }; + + AppVersion.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.primary != null && m.hasOwnProperty("primary")) { + d.primary = m.primary; + if (o.oneofs) + d._primary = "primary"; + } + if (m.secondary != null && m.hasOwnProperty("secondary")) { + d.secondary = m.secondary; + if (o.oneofs) + d._secondary = "secondary"; + } + if (m.tertiary != null && m.hasOwnProperty("tertiary")) { + d.tertiary = m.tertiary; + if (o.oneofs) + d._tertiary = "tertiary"; + } + if (m.quaternary != null && m.hasOwnProperty("quaternary")) { + d.quaternary = m.quaternary; + if (o.oneofs) + d._quaternary = "quaternary"; + } + if (m.quinary != null && m.hasOwnProperty("quinary")) { + d.quinary = m.quinary; + if (o.oneofs) + d._quinary = "quinary"; + } + return d; + }; + + AppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -6938,10 +15331,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WebInfo.prototype.refToken = ""; - WebInfo.prototype.version = ""; + WebInfo.prototype.refToken = null; + WebInfo.prototype.version = null; WebInfo.prototype.webdPayload = null; - WebInfo.prototype.webSubPlatform = 0; + WebInfo.prototype.webSubPlatform = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebInfo.prototype, "_refToken", { + get: $util.oneOfGetter($oneOfFields = ["refToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebInfo.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebInfo.prototype, "_webdPayload", { + get: $util.oneOfGetter($oneOfFields = ["webdPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebInfo.prototype, "_webSubPlatform", { + get: $util.oneOfGetter($oneOfFields = ["webSubPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); WebInfo.create = function create(properties) { return new WebInfo(properties); @@ -6994,6 +15413,87 @@ export const proto = $root.proto = (() => { return m; }; + WebInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.WebInfo) + return d; + var m = new $root.proto.ClientPayload.WebInfo(); + if (d.refToken != null) { + m.refToken = String(d.refToken); + } + if (d.version != null) { + m.version = String(d.version); + } + if (d.webdPayload != null) { + if (typeof d.webdPayload !== "object") + throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected"); + m.webdPayload = $root.proto.ClientPayload.WebInfo.WebdPayload.fromObject(d.webdPayload); + } + switch (d.webSubPlatform) { + default: + if (typeof d.webSubPlatform === "number") { + m.webSubPlatform = d.webSubPlatform; + break; + } + break; + case "WEB_BROWSER": + case 0: + m.webSubPlatform = 0; + break; + case "APP_STORE": + case 1: + m.webSubPlatform = 1; + break; + case "WIN_STORE": + case 2: + m.webSubPlatform = 2; + break; + case "DARWIN": + case 3: + m.webSubPlatform = 3; + break; + case "WIN32": + case 4: + m.webSubPlatform = 4; + break; + case "WIN_HYBRID": + case 5: + m.webSubPlatform = 5; + break; + } + return m; + }; + + WebInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.refToken != null && m.hasOwnProperty("refToken")) { + d.refToken = m.refToken; + if (o.oneofs) + d._refToken = "refToken"; + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = m.version; + if (o.oneofs) + d._version = "version"; + } + if (m.webdPayload != null && m.hasOwnProperty("webdPayload")) { + d.webdPayload = $root.proto.ClientPayload.WebInfo.WebdPayload.toObject(m.webdPayload, o); + if (o.oneofs) + d._webdPayload = "webdPayload"; + } + if (m.webSubPlatform != null && m.hasOwnProperty("webSubPlatform")) { + d.webSubPlatform = o.enums === String ? $root.proto.ClientPayload.WebInfo.WebSubPlatform[m.webSubPlatform] === undefined ? m.webSubPlatform : $root.proto.ClientPayload.WebInfo.WebSubPlatform[m.webSubPlatform] : m.webSubPlatform; + if (o.oneofs) + d._webSubPlatform = "webSubPlatform"; + } + return d; + }; + + WebInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WebInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7021,17 +15521,85 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WebdPayload.prototype.usesParticipantInKey = false; - WebdPayload.prototype.supportsStarredMessages = false; - WebdPayload.prototype.supportsDocumentMessages = false; - WebdPayload.prototype.supportsUrlMessages = false; - WebdPayload.prototype.supportsMediaRetry = false; - WebdPayload.prototype.supportsE2EImage = false; - WebdPayload.prototype.supportsE2EVideo = false; - WebdPayload.prototype.supportsE2EAudio = false; - WebdPayload.prototype.supportsE2EDocument = false; - WebdPayload.prototype.documentTypes = ""; - WebdPayload.prototype.features = $util.newBuffer([]); + WebdPayload.prototype.usesParticipantInKey = null; + WebdPayload.prototype.supportsStarredMessages = null; + WebdPayload.prototype.supportsDocumentMessages = null; + WebdPayload.prototype.supportsUrlMessages = null; + WebdPayload.prototype.supportsMediaRetry = null; + WebdPayload.prototype.supportsE2EImage = null; + WebdPayload.prototype.supportsE2EVideo = null; + WebdPayload.prototype.supportsE2EAudio = null; + WebdPayload.prototype.supportsE2EDocument = null; + WebdPayload.prototype.documentTypes = null; + WebdPayload.prototype.features = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_usesParticipantInKey", { + get: $util.oneOfGetter($oneOfFields = ["usesParticipantInKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsStarredMessages", { + get: $util.oneOfGetter($oneOfFields = ["supportsStarredMessages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsDocumentMessages", { + get: $util.oneOfGetter($oneOfFields = ["supportsDocumentMessages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsUrlMessages", { + get: $util.oneOfGetter($oneOfFields = ["supportsUrlMessages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsMediaRetry", { + get: $util.oneOfGetter($oneOfFields = ["supportsMediaRetry"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsE2EImage", { + get: $util.oneOfGetter($oneOfFields = ["supportsE2EImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsE2EVideo", { + get: $util.oneOfGetter($oneOfFields = ["supportsE2EVideo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsE2EAudio", { + get: $util.oneOfGetter($oneOfFields = ["supportsE2EAudio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_supportsE2EDocument", { + get: $util.oneOfGetter($oneOfFields = ["supportsE2EDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_documentTypes", { + get: $util.oneOfGetter($oneOfFields = ["documentTypes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebdPayload.prototype, "_features", { + get: $util.oneOfGetter($oneOfFields = ["features"]), + set: $util.oneOfSetter($oneOfFields) + }); WebdPayload.create = function create(properties) { return new WebdPayload(properties); @@ -7126,6 +15694,115 @@ export const proto = $root.proto = (() => { return m; }; + WebdPayload.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ClientPayload.WebInfo.WebdPayload) + return d; + var m = new $root.proto.ClientPayload.WebInfo.WebdPayload(); + if (d.usesParticipantInKey != null) { + m.usesParticipantInKey = Boolean(d.usesParticipantInKey); + } + if (d.supportsStarredMessages != null) { + m.supportsStarredMessages = Boolean(d.supportsStarredMessages); + } + if (d.supportsDocumentMessages != null) { + m.supportsDocumentMessages = Boolean(d.supportsDocumentMessages); + } + if (d.supportsUrlMessages != null) { + m.supportsUrlMessages = Boolean(d.supportsUrlMessages); + } + if (d.supportsMediaRetry != null) { + m.supportsMediaRetry = Boolean(d.supportsMediaRetry); + } + if (d.supportsE2EImage != null) { + m.supportsE2EImage = Boolean(d.supportsE2EImage); + } + if (d.supportsE2EVideo != null) { + m.supportsE2EVideo = Boolean(d.supportsE2EVideo); + } + if (d.supportsE2EAudio != null) { + m.supportsE2EAudio = Boolean(d.supportsE2EAudio); + } + if (d.supportsE2EDocument != null) { + m.supportsE2EDocument = Boolean(d.supportsE2EDocument); + } + if (d.documentTypes != null) { + m.documentTypes = String(d.documentTypes); + } + if (d.features != null) { + if (typeof d.features === "string") + $util.base64.decode(d.features, m.features = $util.newBuffer($util.base64.length(d.features)), 0); + else if (d.features.length >= 0) + m.features = d.features; + } + return m; + }; + + WebdPayload.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.usesParticipantInKey != null && m.hasOwnProperty("usesParticipantInKey")) { + d.usesParticipantInKey = m.usesParticipantInKey; + if (o.oneofs) + d._usesParticipantInKey = "usesParticipantInKey"; + } + if (m.supportsStarredMessages != null && m.hasOwnProperty("supportsStarredMessages")) { + d.supportsStarredMessages = m.supportsStarredMessages; + if (o.oneofs) + d._supportsStarredMessages = "supportsStarredMessages"; + } + if (m.supportsDocumentMessages != null && m.hasOwnProperty("supportsDocumentMessages")) { + d.supportsDocumentMessages = m.supportsDocumentMessages; + if (o.oneofs) + d._supportsDocumentMessages = "supportsDocumentMessages"; + } + if (m.supportsUrlMessages != null && m.hasOwnProperty("supportsUrlMessages")) { + d.supportsUrlMessages = m.supportsUrlMessages; + if (o.oneofs) + d._supportsUrlMessages = "supportsUrlMessages"; + } + if (m.supportsMediaRetry != null && m.hasOwnProperty("supportsMediaRetry")) { + d.supportsMediaRetry = m.supportsMediaRetry; + if (o.oneofs) + d._supportsMediaRetry = "supportsMediaRetry"; + } + if (m.supportsE2EImage != null && m.hasOwnProperty("supportsE2EImage")) { + d.supportsE2EImage = m.supportsE2EImage; + if (o.oneofs) + d._supportsE2EImage = "supportsE2EImage"; + } + if (m.supportsE2EVideo != null && m.hasOwnProperty("supportsE2EVideo")) { + d.supportsE2EVideo = m.supportsE2EVideo; + if (o.oneofs) + d._supportsE2EVideo = "supportsE2EVideo"; + } + if (m.supportsE2EAudio != null && m.hasOwnProperty("supportsE2EAudio")) { + d.supportsE2EAudio = m.supportsE2EAudio; + if (o.oneofs) + d._supportsE2EAudio = "supportsE2EAudio"; + } + if (m.supportsE2EDocument != null && m.hasOwnProperty("supportsE2EDocument")) { + d.supportsE2EDocument = m.supportsE2EDocument; + if (o.oneofs) + d._supportsE2EDocument = "supportsE2EDocument"; + } + if (m.documentTypes != null && m.hasOwnProperty("documentTypes")) { + d.documentTypes = m.documentTypes; + if (o.oneofs) + d._documentTypes = "documentTypes"; + } + if (m.features != null && m.hasOwnProperty("features")) { + d.features = o.bytes === String ? $util.base64.encode(m.features, 0, m.features.length) : o.bytes === Array ? Array.prototype.slice.call(m.features) : m.features; + if (o.oneofs) + d._features = "features"; + } + return d; + }; + + WebdPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WebdPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7152,7 +15829,21 @@ export const proto = $root.proto = (() => { } CommentMetadata.prototype.commentParentKey = null; - CommentMetadata.prototype.replyCount = 0; + CommentMetadata.prototype.replyCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CommentMetadata.prototype, "_commentParentKey", { + get: $util.oneOfGetter($oneOfFields = ["commentParentKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CommentMetadata.prototype, "_replyCount", { + get: $util.oneOfGetter($oneOfFields = ["replyCount"]), + set: $util.oneOfSetter($oneOfFields) + }); CommentMetadata.create = function create(properties) { return new CommentMetadata(properties); @@ -7193,6 +15884,42 @@ export const proto = $root.proto = (() => { return m; }; + CommentMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CommentMetadata) + return d; + var m = new $root.proto.CommentMetadata(); + if (d.commentParentKey != null) { + if (typeof d.commentParentKey !== "object") + throw TypeError(".proto.CommentMetadata.commentParentKey: object expected"); + m.commentParentKey = $root.proto.MessageKey.fromObject(d.commentParentKey); + } + if (d.replyCount != null) { + m.replyCount = d.replyCount >>> 0; + } + return m; + }; + + CommentMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.commentParentKey != null && m.hasOwnProperty("commentParentKey")) { + d.commentParentKey = $root.proto.MessageKey.toObject(m.commentParentKey, o); + if (o.oneofs) + d._commentParentKey = "commentParentKey"; + } + if (m.replyCount != null && m.hasOwnProperty("replyCount")) { + d.replyCount = m.replyCount; + if (o.oneofs) + d._replyCount = "replyCount"; + } + return d; + }; + + CommentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CommentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7212,7 +15939,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CompanionCommitment.prototype.hash = $util.newBuffer([]); + CompanionCommitment.prototype.hash = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CompanionCommitment.prototype, "_hash", { + get: $util.oneOfGetter($oneOfFields = ["hash"]), + set: $util.oneOfSetter($oneOfFields) + }); CompanionCommitment.create = function create(properties) { return new CompanionCommitment(properties); @@ -7247,6 +15982,35 @@ export const proto = $root.proto = (() => { return m; }; + CompanionCommitment.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CompanionCommitment) + return d; + var m = new $root.proto.CompanionCommitment(); + if (d.hash != null) { + if (typeof d.hash === "string") + $util.base64.decode(d.hash, m.hash = $util.newBuffer($util.base64.length(d.hash)), 0); + else if (d.hash.length >= 0) + m.hash = d.hash; + } + return m; + }; + + CompanionCommitment.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.hash != null && m.hasOwnProperty("hash")) { + d.hash = o.bytes === String ? $util.base64.encode(m.hash, 0, m.hash.length) : o.bytes === Array ? Array.prototype.slice.call(m.hash) : m.hash; + if (o.oneofs) + d._hash = "hash"; + } + return d; + }; + + CompanionCommitment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CompanionCommitment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7266,9 +16030,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CompanionEphemeralIdentity.prototype.publicKey = $util.newBuffer([]); - CompanionEphemeralIdentity.prototype.deviceType = 0; - CompanionEphemeralIdentity.prototype.ref = ""; + CompanionEphemeralIdentity.prototype.publicKey = null; + CompanionEphemeralIdentity.prototype.deviceType = null; + CompanionEphemeralIdentity.prototype.ref = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CompanionEphemeralIdentity.prototype, "_publicKey", { + get: $util.oneOfGetter($oneOfFields = ["publicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CompanionEphemeralIdentity.prototype, "_deviceType", { + get: $util.oneOfGetter($oneOfFields = ["deviceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CompanionEphemeralIdentity.prototype, "_ref", { + get: $util.oneOfGetter($oneOfFields = ["ref"]), + set: $util.oneOfSetter($oneOfFields) + }); CompanionEphemeralIdentity.create = function create(properties) { return new CompanionEphemeralIdentity(properties); @@ -7315,6 +16099,156 @@ export const proto = $root.proto = (() => { return m; }; + CompanionEphemeralIdentity.fromObject = function fromObject(d) { + if (d instanceof $root.proto.CompanionEphemeralIdentity) + return d; + var m = new $root.proto.CompanionEphemeralIdentity(); + if (d.publicKey != null) { + if (typeof d.publicKey === "string") + $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0); + else if (d.publicKey.length >= 0) + m.publicKey = d.publicKey; + } + switch (d.deviceType) { + default: + if (typeof d.deviceType === "number") { + m.deviceType = d.deviceType; + break; + } + break; + case "UNKNOWN": + case 0: + m.deviceType = 0; + break; + case "CHROME": + case 1: + m.deviceType = 1; + break; + case "FIREFOX": + case 2: + m.deviceType = 2; + break; + case "IE": + case 3: + m.deviceType = 3; + break; + case "OPERA": + case 4: + m.deviceType = 4; + break; + case "SAFARI": + case 5: + m.deviceType = 5; + break; + case "EDGE": + case 6: + m.deviceType = 6; + break; + case "DESKTOP": + case 7: + m.deviceType = 7; + break; + case "IPAD": + case 8: + m.deviceType = 8; + break; + case "ANDROID_TABLET": + case 9: + m.deviceType = 9; + break; + case "OHANA": + case 10: + m.deviceType = 10; + break; + case "ALOHA": + case 11: + m.deviceType = 11; + break; + case "CATALINA": + case 12: + m.deviceType = 12; + break; + case "TCL_TV": + case 13: + m.deviceType = 13; + break; + case "IOS_PHONE": + case 14: + m.deviceType = 14; + break; + case "IOS_CATALYST": + case 15: + m.deviceType = 15; + break; + case "ANDROID_PHONE": + case 16: + m.deviceType = 16; + break; + case "ANDROID_AMBIGUOUS": + case 17: + m.deviceType = 17; + break; + case "WEAR_OS": + case 18: + m.deviceType = 18; + break; + case "AR_WRIST": + case 19: + m.deviceType = 19; + break; + case "AR_DEVICE": + case 20: + m.deviceType = 20; + break; + case "UWP": + case 21: + m.deviceType = 21; + break; + case "VR": + case 22: + m.deviceType = 22; + break; + case "CLOUD_API": + case 23: + m.deviceType = 23; + break; + case "SMARTGLASSES": + case 24: + m.deviceType = 24; + break; + } + if (d.ref != null) { + m.ref = String(d.ref); + } + return m; + }; + + CompanionEphemeralIdentity.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.publicKey != null && m.hasOwnProperty("publicKey")) { + d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey; + if (o.oneofs) + d._publicKey = "publicKey"; + } + if (m.deviceType != null && m.hasOwnProperty("deviceType")) { + d.deviceType = o.enums === String ? $root.proto.DeviceProps.PlatformType[m.deviceType] === undefined ? m.deviceType : $root.proto.DeviceProps.PlatformType[m.deviceType] : m.deviceType; + if (o.oneofs) + d._deviceType = "deviceType"; + } + if (m.ref != null && m.hasOwnProperty("ref")) { + d.ref = m.ref; + if (o.oneofs) + d._ref = "ref"; + } + return d; + }; + + CompanionEphemeralIdentity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CompanionEphemeralIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7336,7 +16270,15 @@ export const proto = $root.proto = (() => { } Config.prototype.field = $util.emptyObject; - Config.prototype.version = 0; + Config.prototype.version = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Config.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); Config.create = function create(properties) { return new Config(properties); @@ -7400,6 +16342,52 @@ export const proto = $root.proto = (() => { return m; }; + Config.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Config) + return d; + var m = new $root.proto.Config(); + if (d.field) { + if (typeof d.field !== "object") + throw TypeError(".proto.Config.field: object expected"); + m.field = {}; + for (var ks = Object.keys(d.field), i = 0; i < ks.length; ++i) { + if (typeof d.field[ks[i]] !== "object") + throw TypeError(".proto.Config.field: object expected"); + m.field[ks[i]] = $root.proto.Field.fromObject(d.field[ks[i]]); + } + } + if (d.version != null) { + m.version = d.version >>> 0; + } + return m; + }; + + Config.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.objects || o.defaults) { + d.field = {}; + } + var ks2; + if (m.field && (ks2 = Object.keys(m.field)).length) { + d.field = {}; + for (var j = 0; j < ks2.length; ++j) { + d.field[ks2[j]] = $root.proto.Field.toObject(m.field[ks2[j]], o); + } + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = m.version; + if (o.oneofs) + d._version = "version"; + } + return d; + }; + + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7421,53 +16409,325 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ContextInfo.prototype.stanzaId = ""; - ContextInfo.prototype.participant = ""; + ContextInfo.prototype.stanzaId = null; + ContextInfo.prototype.participant = null; ContextInfo.prototype.quotedMessage = null; - ContextInfo.prototype.remoteJid = ""; + ContextInfo.prototype.remoteJid = null; ContextInfo.prototype.mentionedJid = $util.emptyArray; - ContextInfo.prototype.conversionSource = ""; - ContextInfo.prototype.conversionData = $util.newBuffer([]); - ContextInfo.prototype.conversionDelaySeconds = 0; - ContextInfo.prototype.forwardingScore = 0; - ContextInfo.prototype.isForwarded = false; + ContextInfo.prototype.conversionSource = null; + ContextInfo.prototype.conversionData = null; + ContextInfo.prototype.conversionDelaySeconds = null; + ContextInfo.prototype.forwardingScore = null; + ContextInfo.prototype.isForwarded = null; ContextInfo.prototype.quotedAd = null; ContextInfo.prototype.placeholderKey = null; - ContextInfo.prototype.expiration = 0; - ContextInfo.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - ContextInfo.prototype.ephemeralSharedSecret = $util.newBuffer([]); + ContextInfo.prototype.expiration = null; + ContextInfo.prototype.ephemeralSettingTimestamp = null; + ContextInfo.prototype.ephemeralSharedSecret = null; ContextInfo.prototype.externalAdReply = null; - ContextInfo.prototype.entryPointConversionSource = ""; - ContextInfo.prototype.entryPointConversionApp = ""; - ContextInfo.prototype.entryPointConversionDelaySeconds = 0; + ContextInfo.prototype.entryPointConversionSource = null; + ContextInfo.prototype.entryPointConversionApp = null; + ContextInfo.prototype.entryPointConversionDelaySeconds = null; ContextInfo.prototype.disappearingMode = null; ContextInfo.prototype.actionLink = null; - ContextInfo.prototype.groupSubject = ""; - ContextInfo.prototype.parentGroupJid = ""; - ContextInfo.prototype.trustBannerType = ""; - ContextInfo.prototype.trustBannerAction = 0; - ContextInfo.prototype.isSampled = false; + ContextInfo.prototype.groupSubject = null; + ContextInfo.prototype.parentGroupJid = null; + ContextInfo.prototype.trustBannerType = null; + ContextInfo.prototype.trustBannerAction = null; + ContextInfo.prototype.isSampled = null; ContextInfo.prototype.groupMentions = $util.emptyArray; ContextInfo.prototype.utm = null; ContextInfo.prototype.forwardedNewsletterMessageInfo = null; ContextInfo.prototype.businessMessageForwardInfo = null; - ContextInfo.prototype.smbClientCampaignId = ""; - ContextInfo.prototype.smbServerCampaignId = ""; + ContextInfo.prototype.smbClientCampaignId = null; + ContextInfo.prototype.smbServerCampaignId = null; ContextInfo.prototype.dataSharingContext = null; - ContextInfo.prototype.alwaysShowAdAttribution = false; + ContextInfo.prototype.alwaysShowAdAttribution = null; ContextInfo.prototype.featureEligibilities = null; - ContextInfo.prototype.entryPointConversionExternalSource = ""; - ContextInfo.prototype.entryPointConversionExternalMedium = ""; - ContextInfo.prototype.ctwaSignals = ""; - ContextInfo.prototype.ctwaPayload = $util.newBuffer([]); + ContextInfo.prototype.entryPointConversionExternalSource = null; + ContextInfo.prototype.entryPointConversionExternalMedium = null; + ContextInfo.prototype.ctwaSignals = null; + ContextInfo.prototype.ctwaPayload = null; ContextInfo.prototype.forwardedAiBotMessageInfo = null; - ContextInfo.prototype.statusAttributionType = 0; + ContextInfo.prototype.statusAttributionType = null; ContextInfo.prototype.urlTrackingMap = null; - ContextInfo.prototype.pairedMediaType = 0; - ContextInfo.prototype.rankingVersion = 0; + ContextInfo.prototype.pairedMediaType = null; + ContextInfo.prototype.rankingVersion = null; ContextInfo.prototype.memberLabel = null; - ContextInfo.prototype.isQuestion = false; - ContextInfo.prototype.statusSourceType = 0; + ContextInfo.prototype.isQuestion = null; + ContextInfo.prototype.statusSourceType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_stanzaId", { + get: $util.oneOfGetter($oneOfFields = ["stanzaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_participant", { + get: $util.oneOfGetter($oneOfFields = ["participant"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_quotedMessage", { + get: $util.oneOfGetter($oneOfFields = ["quotedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_remoteJid", { + get: $util.oneOfGetter($oneOfFields = ["remoteJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_conversionSource", { + get: $util.oneOfGetter($oneOfFields = ["conversionSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_conversionData", { + get: $util.oneOfGetter($oneOfFields = ["conversionData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_conversionDelaySeconds", { + get: $util.oneOfGetter($oneOfFields = ["conversionDelaySeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_forwardingScore", { + get: $util.oneOfGetter($oneOfFields = ["forwardingScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_isForwarded", { + get: $util.oneOfGetter($oneOfFields = ["isForwarded"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_quotedAd", { + get: $util.oneOfGetter($oneOfFields = ["quotedAd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_placeholderKey", { + get: $util.oneOfGetter($oneOfFields = ["placeholderKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_expiration", { + get: $util.oneOfGetter($oneOfFields = ["expiration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_ephemeralSettingTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralSettingTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_ephemeralSharedSecret", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralSharedSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_externalAdReply", { + get: $util.oneOfGetter($oneOfFields = ["externalAdReply"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_entryPointConversionSource", { + get: $util.oneOfGetter($oneOfFields = ["entryPointConversionSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_entryPointConversionApp", { + get: $util.oneOfGetter($oneOfFields = ["entryPointConversionApp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_entryPointConversionDelaySeconds", { + get: $util.oneOfGetter($oneOfFields = ["entryPointConversionDelaySeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_disappearingMode", { + get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_actionLink", { + get: $util.oneOfGetter($oneOfFields = ["actionLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_groupSubject", { + get: $util.oneOfGetter($oneOfFields = ["groupSubject"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_parentGroupJid", { + get: $util.oneOfGetter($oneOfFields = ["parentGroupJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_trustBannerType", { + get: $util.oneOfGetter($oneOfFields = ["trustBannerType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_trustBannerAction", { + get: $util.oneOfGetter($oneOfFields = ["trustBannerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_isSampled", { + get: $util.oneOfGetter($oneOfFields = ["isSampled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_utm", { + get: $util.oneOfGetter($oneOfFields = ["utm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_forwardedNewsletterMessageInfo", { + get: $util.oneOfGetter($oneOfFields = ["forwardedNewsletterMessageInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_businessMessageForwardInfo", { + get: $util.oneOfGetter($oneOfFields = ["businessMessageForwardInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_smbClientCampaignId", { + get: $util.oneOfGetter($oneOfFields = ["smbClientCampaignId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_smbServerCampaignId", { + get: $util.oneOfGetter($oneOfFields = ["smbServerCampaignId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_dataSharingContext", { + get: $util.oneOfGetter($oneOfFields = ["dataSharingContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_alwaysShowAdAttribution", { + get: $util.oneOfGetter($oneOfFields = ["alwaysShowAdAttribution"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_featureEligibilities", { + get: $util.oneOfGetter($oneOfFields = ["featureEligibilities"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_entryPointConversionExternalSource", { + get: $util.oneOfGetter($oneOfFields = ["entryPointConversionExternalSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_entryPointConversionExternalMedium", { + get: $util.oneOfGetter($oneOfFields = ["entryPointConversionExternalMedium"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_ctwaSignals", { + get: $util.oneOfGetter($oneOfFields = ["ctwaSignals"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_ctwaPayload", { + get: $util.oneOfGetter($oneOfFields = ["ctwaPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_forwardedAiBotMessageInfo", { + get: $util.oneOfGetter($oneOfFields = ["forwardedAiBotMessageInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_statusAttributionType", { + get: $util.oneOfGetter($oneOfFields = ["statusAttributionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_urlTrackingMap", { + get: $util.oneOfGetter($oneOfFields = ["urlTrackingMap"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_pairedMediaType", { + get: $util.oneOfGetter($oneOfFields = ["pairedMediaType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_rankingVersion", { + get: $util.oneOfGetter($oneOfFields = ["rankingVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_memberLabel", { + get: $util.oneOfGetter($oneOfFields = ["memberLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_isQuestion", { + get: $util.oneOfGetter($oneOfFields = ["isQuestion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContextInfo.prototype, "_statusSourceType", { + get: $util.oneOfGetter($oneOfFields = ["statusSourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); ContextInfo.create = function create(properties) { return new ContextInfo(properties); @@ -7786,6 +17046,544 @@ export const proto = $root.proto = (() => { return m; }; + ContextInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo) + return d; + var m = new $root.proto.ContextInfo(); + if (d.stanzaId != null) { + m.stanzaId = String(d.stanzaId); + } + if (d.participant != null) { + m.participant = String(d.participant); + } + if (d.quotedMessage != null) { + if (typeof d.quotedMessage !== "object") + throw TypeError(".proto.ContextInfo.quotedMessage: object expected"); + m.quotedMessage = $root.proto.Message.fromObject(d.quotedMessage); + } + if (d.remoteJid != null) { + m.remoteJid = String(d.remoteJid); + } + if (d.mentionedJid) { + if (!Array.isArray(d.mentionedJid)) + throw TypeError(".proto.ContextInfo.mentionedJid: array expected"); + m.mentionedJid = []; + for (var i = 0; i < d.mentionedJid.length; ++i) { + m.mentionedJid[i] = String(d.mentionedJid[i]); + } + } + if (d.conversionSource != null) { + m.conversionSource = String(d.conversionSource); + } + if (d.conversionData != null) { + if (typeof d.conversionData === "string") + $util.base64.decode(d.conversionData, m.conversionData = $util.newBuffer($util.base64.length(d.conversionData)), 0); + else if (d.conversionData.length >= 0) + m.conversionData = d.conversionData; + } + if (d.conversionDelaySeconds != null) { + m.conversionDelaySeconds = d.conversionDelaySeconds >>> 0; + } + if (d.forwardingScore != null) { + m.forwardingScore = d.forwardingScore >>> 0; + } + if (d.isForwarded != null) { + m.isForwarded = Boolean(d.isForwarded); + } + if (d.quotedAd != null) { + if (typeof d.quotedAd !== "object") + throw TypeError(".proto.ContextInfo.quotedAd: object expected"); + m.quotedAd = $root.proto.ContextInfo.AdReplyInfo.fromObject(d.quotedAd); + } + if (d.placeholderKey != null) { + if (typeof d.placeholderKey !== "object") + throw TypeError(".proto.ContextInfo.placeholderKey: object expected"); + m.placeholderKey = $root.proto.MessageKey.fromObject(d.placeholderKey); + } + if (d.expiration != null) { + m.expiration = d.expiration >>> 0; + } + if (d.ephemeralSettingTimestamp != null) { + if ($util.Long) + (m.ephemeralSettingTimestamp = $util.Long.fromValue(d.ephemeralSettingTimestamp)).unsigned = false; + else if (typeof d.ephemeralSettingTimestamp === "string") + m.ephemeralSettingTimestamp = parseInt(d.ephemeralSettingTimestamp, 10); + else if (typeof d.ephemeralSettingTimestamp === "number") + m.ephemeralSettingTimestamp = d.ephemeralSettingTimestamp; + else if (typeof d.ephemeralSettingTimestamp === "object") + m.ephemeralSettingTimestamp = new $util.LongBits(d.ephemeralSettingTimestamp.low >>> 0, d.ephemeralSettingTimestamp.high >>> 0).toNumber(); + } + if (d.ephemeralSharedSecret != null) { + if (typeof d.ephemeralSharedSecret === "string") + $util.base64.decode(d.ephemeralSharedSecret, m.ephemeralSharedSecret = $util.newBuffer($util.base64.length(d.ephemeralSharedSecret)), 0); + else if (d.ephemeralSharedSecret.length >= 0) + m.ephemeralSharedSecret = d.ephemeralSharedSecret; + } + if (d.externalAdReply != null) { + if (typeof d.externalAdReply !== "object") + throw TypeError(".proto.ContextInfo.externalAdReply: object expected"); + m.externalAdReply = $root.proto.ContextInfo.ExternalAdReplyInfo.fromObject(d.externalAdReply); + } + if (d.entryPointConversionSource != null) { + m.entryPointConversionSource = String(d.entryPointConversionSource); + } + if (d.entryPointConversionApp != null) { + m.entryPointConversionApp = String(d.entryPointConversionApp); + } + if (d.entryPointConversionDelaySeconds != null) { + m.entryPointConversionDelaySeconds = d.entryPointConversionDelaySeconds >>> 0; + } + if (d.disappearingMode != null) { + if (typeof d.disappearingMode !== "object") + throw TypeError(".proto.ContextInfo.disappearingMode: object expected"); + m.disappearingMode = $root.proto.DisappearingMode.fromObject(d.disappearingMode); + } + if (d.actionLink != null) { + if (typeof d.actionLink !== "object") + throw TypeError(".proto.ContextInfo.actionLink: object expected"); + m.actionLink = $root.proto.ActionLink.fromObject(d.actionLink); + } + if (d.groupSubject != null) { + m.groupSubject = String(d.groupSubject); + } + if (d.parentGroupJid != null) { + m.parentGroupJid = String(d.parentGroupJid); + } + if (d.trustBannerType != null) { + m.trustBannerType = String(d.trustBannerType); + } + if (d.trustBannerAction != null) { + m.trustBannerAction = d.trustBannerAction >>> 0; + } + if (d.isSampled != null) { + m.isSampled = Boolean(d.isSampled); + } + if (d.groupMentions) { + if (!Array.isArray(d.groupMentions)) + throw TypeError(".proto.ContextInfo.groupMentions: array expected"); + m.groupMentions = []; + for (var i = 0; i < d.groupMentions.length; ++i) { + if (typeof d.groupMentions[i] !== "object") + throw TypeError(".proto.ContextInfo.groupMentions: object expected"); + m.groupMentions[i] = $root.proto.GroupMention.fromObject(d.groupMentions[i]); + } + } + if (d.utm != null) { + if (typeof d.utm !== "object") + throw TypeError(".proto.ContextInfo.utm: object expected"); + m.utm = $root.proto.ContextInfo.UTMInfo.fromObject(d.utm); + } + if (d.forwardedNewsletterMessageInfo != null) { + if (typeof d.forwardedNewsletterMessageInfo !== "object") + throw TypeError(".proto.ContextInfo.forwardedNewsletterMessageInfo: object expected"); + m.forwardedNewsletterMessageInfo = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.fromObject(d.forwardedNewsletterMessageInfo); + } + if (d.businessMessageForwardInfo != null) { + if (typeof d.businessMessageForwardInfo !== "object") + throw TypeError(".proto.ContextInfo.businessMessageForwardInfo: object expected"); + m.businessMessageForwardInfo = $root.proto.ContextInfo.BusinessMessageForwardInfo.fromObject(d.businessMessageForwardInfo); + } + if (d.smbClientCampaignId != null) { + m.smbClientCampaignId = String(d.smbClientCampaignId); + } + if (d.smbServerCampaignId != null) { + m.smbServerCampaignId = String(d.smbServerCampaignId); + } + if (d.dataSharingContext != null) { + if (typeof d.dataSharingContext !== "object") + throw TypeError(".proto.ContextInfo.dataSharingContext: object expected"); + m.dataSharingContext = $root.proto.ContextInfo.DataSharingContext.fromObject(d.dataSharingContext); + } + if (d.alwaysShowAdAttribution != null) { + m.alwaysShowAdAttribution = Boolean(d.alwaysShowAdAttribution); + } + if (d.featureEligibilities != null) { + if (typeof d.featureEligibilities !== "object") + throw TypeError(".proto.ContextInfo.featureEligibilities: object expected"); + m.featureEligibilities = $root.proto.ContextInfo.FeatureEligibilities.fromObject(d.featureEligibilities); + } + if (d.entryPointConversionExternalSource != null) { + m.entryPointConversionExternalSource = String(d.entryPointConversionExternalSource); + } + if (d.entryPointConversionExternalMedium != null) { + m.entryPointConversionExternalMedium = String(d.entryPointConversionExternalMedium); + } + if (d.ctwaSignals != null) { + m.ctwaSignals = String(d.ctwaSignals); + } + if (d.ctwaPayload != null) { + if (typeof d.ctwaPayload === "string") + $util.base64.decode(d.ctwaPayload, m.ctwaPayload = $util.newBuffer($util.base64.length(d.ctwaPayload)), 0); + else if (d.ctwaPayload.length >= 0) + m.ctwaPayload = d.ctwaPayload; + } + if (d.forwardedAiBotMessageInfo != null) { + if (typeof d.forwardedAiBotMessageInfo !== "object") + throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected"); + m.forwardedAiBotMessageInfo = $root.proto.ContextInfo.ForwardedAIBotMessageInfo.fromObject(d.forwardedAiBotMessageInfo); + } + switch (d.statusAttributionType) { + default: + if (typeof d.statusAttributionType === "number") { + m.statusAttributionType = d.statusAttributionType; + break; + } + break; + case "NONE": + case 0: + m.statusAttributionType = 0; + break; + case "RESHARED_FROM_MENTION": + case 1: + m.statusAttributionType = 1; + break; + case "RESHARED_FROM_POST": + case 2: + m.statusAttributionType = 2; + break; + } + if (d.urlTrackingMap != null) { + if (typeof d.urlTrackingMap !== "object") + throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected"); + m.urlTrackingMap = $root.proto.UrlTrackingMap.fromObject(d.urlTrackingMap); + } + switch (d.pairedMediaType) { + default: + if (typeof d.pairedMediaType === "number") { + m.pairedMediaType = d.pairedMediaType; + break; + } + break; + case "NOT_PAIRED_MEDIA": + case 0: + m.pairedMediaType = 0; + break; + case "SD_VIDEO_PARENT": + case 1: + m.pairedMediaType = 1; + break; + case "HD_VIDEO_CHILD": + case 2: + m.pairedMediaType = 2; + break; + case "SD_IMAGE_PARENT": + case 3: + m.pairedMediaType = 3; + break; + case "HD_IMAGE_CHILD": + case 4: + m.pairedMediaType = 4; + break; + case "MOTION_PHOTO_PARENT": + case 5: + m.pairedMediaType = 5; + break; + case "MOTION_PHOTO_CHILD": + case 6: + m.pairedMediaType = 6; + break; + } + if (d.rankingVersion != null) { + m.rankingVersion = d.rankingVersion >>> 0; + } + if (d.memberLabel != null) { + if (typeof d.memberLabel !== "object") + throw TypeError(".proto.ContextInfo.memberLabel: object expected"); + m.memberLabel = $root.proto.MemberLabel.fromObject(d.memberLabel); + } + if (d.isQuestion != null) { + m.isQuestion = Boolean(d.isQuestion); + } + switch (d.statusSourceType) { + default: + if (typeof d.statusSourceType === "number") { + m.statusSourceType = d.statusSourceType; + break; + } + break; + case "IMAGE": + case 0: + m.statusSourceType = 0; + break; + case "VIDEO": + case 1: + m.statusSourceType = 1; + break; + case "GIF": + case 2: + m.statusSourceType = 2; + break; + case "AUDIO": + case 3: + m.statusSourceType = 3; + break; + case "TEXT": + case 4: + m.statusSourceType = 4; + break; + case "MUSIC_STANDALONE": + case 5: + m.statusSourceType = 5; + break; + } + return m; + }; + + ContextInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.mentionedJid = []; + d.groupMentions = []; + } + if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) { + d.stanzaId = m.stanzaId; + if (o.oneofs) + d._stanzaId = "stanzaId"; + } + if (m.participant != null && m.hasOwnProperty("participant")) { + d.participant = m.participant; + if (o.oneofs) + d._participant = "participant"; + } + if (m.quotedMessage != null && m.hasOwnProperty("quotedMessage")) { + d.quotedMessage = $root.proto.Message.toObject(m.quotedMessage, o); + if (o.oneofs) + d._quotedMessage = "quotedMessage"; + } + if (m.remoteJid != null && m.hasOwnProperty("remoteJid")) { + d.remoteJid = m.remoteJid; + if (o.oneofs) + d._remoteJid = "remoteJid"; + } + if (m.mentionedJid && m.mentionedJid.length) { + d.mentionedJid = []; + for (var j = 0; j < m.mentionedJid.length; ++j) { + d.mentionedJid[j] = m.mentionedJid[j]; + } + } + if (m.conversionSource != null && m.hasOwnProperty("conversionSource")) { + d.conversionSource = m.conversionSource; + if (o.oneofs) + d._conversionSource = "conversionSource"; + } + if (m.conversionData != null && m.hasOwnProperty("conversionData")) { + d.conversionData = o.bytes === String ? $util.base64.encode(m.conversionData, 0, m.conversionData.length) : o.bytes === Array ? Array.prototype.slice.call(m.conversionData) : m.conversionData; + if (o.oneofs) + d._conversionData = "conversionData"; + } + if (m.conversionDelaySeconds != null && m.hasOwnProperty("conversionDelaySeconds")) { + d.conversionDelaySeconds = m.conversionDelaySeconds; + if (o.oneofs) + d._conversionDelaySeconds = "conversionDelaySeconds"; + } + if (m.forwardingScore != null && m.hasOwnProperty("forwardingScore")) { + d.forwardingScore = m.forwardingScore; + if (o.oneofs) + d._forwardingScore = "forwardingScore"; + } + if (m.isForwarded != null && m.hasOwnProperty("isForwarded")) { + d.isForwarded = m.isForwarded; + if (o.oneofs) + d._isForwarded = "isForwarded"; + } + if (m.quotedAd != null && m.hasOwnProperty("quotedAd")) { + d.quotedAd = $root.proto.ContextInfo.AdReplyInfo.toObject(m.quotedAd, o); + if (o.oneofs) + d._quotedAd = "quotedAd"; + } + if (m.placeholderKey != null && m.hasOwnProperty("placeholderKey")) { + d.placeholderKey = $root.proto.MessageKey.toObject(m.placeholderKey, o); + if (o.oneofs) + d._placeholderKey = "placeholderKey"; + } + if (m.expiration != null && m.hasOwnProperty("expiration")) { + d.expiration = m.expiration; + if (o.oneofs) + d._expiration = "expiration"; + } + if (m.ephemeralSettingTimestamp != null && m.hasOwnProperty("ephemeralSettingTimestamp")) { + if (typeof m.ephemeralSettingTimestamp === "number") + d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; + else + d.ephemeralSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralSettingTimestamp.low >>> 0, m.ephemeralSettingTimestamp.high >>> 0).toNumber() : m.ephemeralSettingTimestamp; + if (o.oneofs) + d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp"; + } + if (m.ephemeralSharedSecret != null && m.hasOwnProperty("ephemeralSharedSecret")) { + d.ephemeralSharedSecret = o.bytes === String ? $util.base64.encode(m.ephemeralSharedSecret, 0, m.ephemeralSharedSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.ephemeralSharedSecret) : m.ephemeralSharedSecret; + if (o.oneofs) + d._ephemeralSharedSecret = "ephemeralSharedSecret"; + } + if (m.externalAdReply != null && m.hasOwnProperty("externalAdReply")) { + d.externalAdReply = $root.proto.ContextInfo.ExternalAdReplyInfo.toObject(m.externalAdReply, o); + if (o.oneofs) + d._externalAdReply = "externalAdReply"; + } + if (m.entryPointConversionSource != null && m.hasOwnProperty("entryPointConversionSource")) { + d.entryPointConversionSource = m.entryPointConversionSource; + if (o.oneofs) + d._entryPointConversionSource = "entryPointConversionSource"; + } + if (m.entryPointConversionApp != null && m.hasOwnProperty("entryPointConversionApp")) { + d.entryPointConversionApp = m.entryPointConversionApp; + if (o.oneofs) + d._entryPointConversionApp = "entryPointConversionApp"; + } + if (m.entryPointConversionDelaySeconds != null && m.hasOwnProperty("entryPointConversionDelaySeconds")) { + d.entryPointConversionDelaySeconds = m.entryPointConversionDelaySeconds; + if (o.oneofs) + d._entryPointConversionDelaySeconds = "entryPointConversionDelaySeconds"; + } + if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) { + d.disappearingMode = $root.proto.DisappearingMode.toObject(m.disappearingMode, o); + if (o.oneofs) + d._disappearingMode = "disappearingMode"; + } + if (m.actionLink != null && m.hasOwnProperty("actionLink")) { + d.actionLink = $root.proto.ActionLink.toObject(m.actionLink, o); + if (o.oneofs) + d._actionLink = "actionLink"; + } + if (m.groupSubject != null && m.hasOwnProperty("groupSubject")) { + d.groupSubject = m.groupSubject; + if (o.oneofs) + d._groupSubject = "groupSubject"; + } + if (m.parentGroupJid != null && m.hasOwnProperty("parentGroupJid")) { + d.parentGroupJid = m.parentGroupJid; + if (o.oneofs) + d._parentGroupJid = "parentGroupJid"; + } + if (m.trustBannerType != null && m.hasOwnProperty("trustBannerType")) { + d.trustBannerType = m.trustBannerType; + if (o.oneofs) + d._trustBannerType = "trustBannerType"; + } + if (m.trustBannerAction != null && m.hasOwnProperty("trustBannerAction")) { + d.trustBannerAction = m.trustBannerAction; + if (o.oneofs) + d._trustBannerAction = "trustBannerAction"; + } + if (m.isSampled != null && m.hasOwnProperty("isSampled")) { + d.isSampled = m.isSampled; + if (o.oneofs) + d._isSampled = "isSampled"; + } + if (m.groupMentions && m.groupMentions.length) { + d.groupMentions = []; + for (var j = 0; j < m.groupMentions.length; ++j) { + d.groupMentions[j] = $root.proto.GroupMention.toObject(m.groupMentions[j], o); + } + } + if (m.utm != null && m.hasOwnProperty("utm")) { + d.utm = $root.proto.ContextInfo.UTMInfo.toObject(m.utm, o); + if (o.oneofs) + d._utm = "utm"; + } + if (m.forwardedNewsletterMessageInfo != null && m.hasOwnProperty("forwardedNewsletterMessageInfo")) { + d.forwardedNewsletterMessageInfo = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.toObject(m.forwardedNewsletterMessageInfo, o); + if (o.oneofs) + d._forwardedNewsletterMessageInfo = "forwardedNewsletterMessageInfo"; + } + if (m.businessMessageForwardInfo != null && m.hasOwnProperty("businessMessageForwardInfo")) { + d.businessMessageForwardInfo = $root.proto.ContextInfo.BusinessMessageForwardInfo.toObject(m.businessMessageForwardInfo, o); + if (o.oneofs) + d._businessMessageForwardInfo = "businessMessageForwardInfo"; + } + if (m.smbClientCampaignId != null && m.hasOwnProperty("smbClientCampaignId")) { + d.smbClientCampaignId = m.smbClientCampaignId; + if (o.oneofs) + d._smbClientCampaignId = "smbClientCampaignId"; + } + if (m.smbServerCampaignId != null && m.hasOwnProperty("smbServerCampaignId")) { + d.smbServerCampaignId = m.smbServerCampaignId; + if (o.oneofs) + d._smbServerCampaignId = "smbServerCampaignId"; + } + if (m.dataSharingContext != null && m.hasOwnProperty("dataSharingContext")) { + d.dataSharingContext = $root.proto.ContextInfo.DataSharingContext.toObject(m.dataSharingContext, o); + if (o.oneofs) + d._dataSharingContext = "dataSharingContext"; + } + if (m.alwaysShowAdAttribution != null && m.hasOwnProperty("alwaysShowAdAttribution")) { + d.alwaysShowAdAttribution = m.alwaysShowAdAttribution; + if (o.oneofs) + d._alwaysShowAdAttribution = "alwaysShowAdAttribution"; + } + if (m.featureEligibilities != null && m.hasOwnProperty("featureEligibilities")) { + d.featureEligibilities = $root.proto.ContextInfo.FeatureEligibilities.toObject(m.featureEligibilities, o); + if (o.oneofs) + d._featureEligibilities = "featureEligibilities"; + } + if (m.entryPointConversionExternalSource != null && m.hasOwnProperty("entryPointConversionExternalSource")) { + d.entryPointConversionExternalSource = m.entryPointConversionExternalSource; + if (o.oneofs) + d._entryPointConversionExternalSource = "entryPointConversionExternalSource"; + } + if (m.entryPointConversionExternalMedium != null && m.hasOwnProperty("entryPointConversionExternalMedium")) { + d.entryPointConversionExternalMedium = m.entryPointConversionExternalMedium; + if (o.oneofs) + d._entryPointConversionExternalMedium = "entryPointConversionExternalMedium"; + } + if (m.ctwaSignals != null && m.hasOwnProperty("ctwaSignals")) { + d.ctwaSignals = m.ctwaSignals; + if (o.oneofs) + d._ctwaSignals = "ctwaSignals"; + } + if (m.ctwaPayload != null && m.hasOwnProperty("ctwaPayload")) { + d.ctwaPayload = o.bytes === String ? $util.base64.encode(m.ctwaPayload, 0, m.ctwaPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.ctwaPayload) : m.ctwaPayload; + if (o.oneofs) + d._ctwaPayload = "ctwaPayload"; + } + if (m.forwardedAiBotMessageInfo != null && m.hasOwnProperty("forwardedAiBotMessageInfo")) { + d.forwardedAiBotMessageInfo = $root.proto.ContextInfo.ForwardedAIBotMessageInfo.toObject(m.forwardedAiBotMessageInfo, o); + if (o.oneofs) + d._forwardedAiBotMessageInfo = "forwardedAiBotMessageInfo"; + } + if (m.statusAttributionType != null && m.hasOwnProperty("statusAttributionType")) { + d.statusAttributionType = o.enums === String ? $root.proto.ContextInfo.StatusAttributionType[m.statusAttributionType] === undefined ? m.statusAttributionType : $root.proto.ContextInfo.StatusAttributionType[m.statusAttributionType] : m.statusAttributionType; + if (o.oneofs) + d._statusAttributionType = "statusAttributionType"; + } + if (m.urlTrackingMap != null && m.hasOwnProperty("urlTrackingMap")) { + d.urlTrackingMap = $root.proto.UrlTrackingMap.toObject(m.urlTrackingMap, o); + if (o.oneofs) + d._urlTrackingMap = "urlTrackingMap"; + } + if (m.pairedMediaType != null && m.hasOwnProperty("pairedMediaType")) { + d.pairedMediaType = o.enums === String ? $root.proto.ContextInfo.PairedMediaType[m.pairedMediaType] === undefined ? m.pairedMediaType : $root.proto.ContextInfo.PairedMediaType[m.pairedMediaType] : m.pairedMediaType; + if (o.oneofs) + d._pairedMediaType = "pairedMediaType"; + } + if (m.rankingVersion != null && m.hasOwnProperty("rankingVersion")) { + d.rankingVersion = m.rankingVersion; + if (o.oneofs) + d._rankingVersion = "rankingVersion"; + } + if (m.memberLabel != null && m.hasOwnProperty("memberLabel")) { + d.memberLabel = $root.proto.MemberLabel.toObject(m.memberLabel, o); + if (o.oneofs) + d._memberLabel = "memberLabel"; + } + if (m.isQuestion != null && m.hasOwnProperty("isQuestion")) { + d.isQuestion = m.isQuestion; + if (o.oneofs) + d._isQuestion = "isQuestion"; + } + if (m.statusSourceType != null && m.hasOwnProperty("statusSourceType")) { + d.statusSourceType = o.enums === String ? $root.proto.ContextInfo.StatusSourceType[m.statusSourceType] === undefined ? m.statusSourceType : $root.proto.ContextInfo.StatusSourceType[m.statusSourceType] : m.statusSourceType; + if (o.oneofs) + d._statusSourceType = "statusSourceType"; + } + return d; + }; + + ContextInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7802,10 +17600,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AdReplyInfo.prototype.advertiserName = ""; - AdReplyInfo.prototype.mediaType = 0; - AdReplyInfo.prototype.jpegThumbnail = $util.newBuffer([]); - AdReplyInfo.prototype.caption = ""; + AdReplyInfo.prototype.advertiserName = null; + AdReplyInfo.prototype.mediaType = null; + AdReplyInfo.prototype.jpegThumbnail = null; + AdReplyInfo.prototype.caption = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdReplyInfo.prototype, "_advertiserName", { + get: $util.oneOfGetter($oneOfFields = ["advertiserName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdReplyInfo.prototype, "_mediaType", { + get: $util.oneOfGetter($oneOfFields = ["mediaType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdReplyInfo.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdReplyInfo.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); AdReplyInfo.create = function create(properties) { return new AdReplyInfo(properties); @@ -7858,6 +17682,76 @@ export const proto = $root.proto = (() => { return m; }; + AdReplyInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.AdReplyInfo) + return d; + var m = new $root.proto.ContextInfo.AdReplyInfo(); + if (d.advertiserName != null) { + m.advertiserName = String(d.advertiserName); + } + switch (d.mediaType) { + default: + if (typeof d.mediaType === "number") { + m.mediaType = d.mediaType; + break; + } + break; + case "NONE": + case 0: + m.mediaType = 0; + break; + case "IMAGE": + case 1: + m.mediaType = 1; + break; + case "VIDEO": + case 2: + m.mediaType = 2; + break; + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + return m; + }; + + AdReplyInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.advertiserName != null && m.hasOwnProperty("advertiserName")) { + d.advertiserName = m.advertiserName; + if (o.oneofs) + d._advertiserName = "advertiserName"; + } + if (m.mediaType != null && m.hasOwnProperty("mediaType")) { + d.mediaType = o.enums === String ? $root.proto.ContextInfo.AdReplyInfo.MediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.ContextInfo.AdReplyInfo.MediaType[m.mediaType] : m.mediaType; + if (o.oneofs) + d._mediaType = "mediaType"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + return d; + }; + + AdReplyInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AdReplyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7885,7 +17779,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BusinessMessageForwardInfo.prototype.businessOwnerJid = ""; + BusinessMessageForwardInfo.prototype.businessOwnerJid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BusinessMessageForwardInfo.prototype, "_businessOwnerJid", { + get: $util.oneOfGetter($oneOfFields = ["businessOwnerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); BusinessMessageForwardInfo.create = function create(properties) { return new BusinessMessageForwardInfo(properties); @@ -7920,6 +17822,32 @@ export const proto = $root.proto = (() => { return m; }; + BusinessMessageForwardInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.BusinessMessageForwardInfo) + return d; + var m = new $root.proto.ContextInfo.BusinessMessageForwardInfo(); + if (d.businessOwnerJid != null) { + m.businessOwnerJid = String(d.businessOwnerJid); + } + return m; + }; + + BusinessMessageForwardInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.businessOwnerJid != null && m.hasOwnProperty("businessOwnerJid")) { + d.businessOwnerJid = m.businessOwnerJid; + if (o.oneofs) + d._businessOwnerJid = "businessOwnerJid"; + } + return d; + }; + + BusinessMessageForwardInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BusinessMessageForwardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -7940,10 +17868,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DataSharingContext.prototype.showMmDisclosure = false; - DataSharingContext.prototype.encryptedSignalTokenConsented = ""; + DataSharingContext.prototype.showMmDisclosure = null; + DataSharingContext.prototype.encryptedSignalTokenConsented = null; DataSharingContext.prototype.parameters = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSharingContext.prototype, "_showMmDisclosure", { + get: $util.oneOfGetter($oneOfFields = ["showMmDisclosure"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSharingContext.prototype, "_encryptedSignalTokenConsented", { + get: $util.oneOfGetter($oneOfFields = ["encryptedSignalTokenConsented"]), + set: $util.oneOfSetter($oneOfFields) + }); + DataSharingContext.create = function create(properties) { return new DataSharingContext(properties); }; @@ -7993,6 +17935,59 @@ export const proto = $root.proto = (() => { return m; }; + DataSharingContext.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.DataSharingContext) + return d; + var m = new $root.proto.ContextInfo.DataSharingContext(); + if (d.showMmDisclosure != null) { + m.showMmDisclosure = Boolean(d.showMmDisclosure); + } + if (d.encryptedSignalTokenConsented != null) { + m.encryptedSignalTokenConsented = String(d.encryptedSignalTokenConsented); + } + if (d.parameters) { + if (!Array.isArray(d.parameters)) + throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected"); + m.parameters = []; + for (var i = 0; i < d.parameters.length; ++i) { + if (typeof d.parameters[i] !== "object") + throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: object expected"); + m.parameters[i] = $root.proto.ContextInfo.DataSharingContext.Parameters.fromObject(d.parameters[i]); + } + } + return m; + }; + + DataSharingContext.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.parameters = []; + } + if (m.showMmDisclosure != null && m.hasOwnProperty("showMmDisclosure")) { + d.showMmDisclosure = m.showMmDisclosure; + if (o.oneofs) + d._showMmDisclosure = "showMmDisclosure"; + } + if (m.encryptedSignalTokenConsented != null && m.hasOwnProperty("encryptedSignalTokenConsented")) { + d.encryptedSignalTokenConsented = m.encryptedSignalTokenConsented; + if (o.oneofs) + d._encryptedSignalTokenConsented = "encryptedSignalTokenConsented"; + } + if (m.parameters && m.parameters.length) { + d.parameters = []; + for (var j = 0; j < m.parameters.length; ++j) { + d.parameters[j] = $root.proto.ContextInfo.DataSharingContext.Parameters.toObject(m.parameters[j], o); + } + } + return d; + }; + + DataSharingContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DataSharingContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8009,12 +18004,44 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Parameters.prototype.key = ""; - Parameters.prototype.stringData = ""; - Parameters.prototype.intData = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - Parameters.prototype.floatData = 0; + Parameters.prototype.key = null; + Parameters.prototype.stringData = null; + Parameters.prototype.intData = null; + Parameters.prototype.floatData = null; Parameters.prototype.contents = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_stringData", { + get: $util.oneOfGetter($oneOfFields = ["stringData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_intData", { + get: $util.oneOfGetter($oneOfFields = ["intData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_floatData", { + get: $util.oneOfGetter($oneOfFields = ["floatData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_contents", { + get: $util.oneOfGetter($oneOfFields = ["contents"]), + set: $util.oneOfSetter($oneOfFields) + }); + Parameters.create = function create(properties) { return new Parameters(properties); }; @@ -8072,6 +18099,76 @@ export const proto = $root.proto = (() => { return m; }; + Parameters.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.DataSharingContext.Parameters) + return d; + var m = new $root.proto.ContextInfo.DataSharingContext.Parameters(); + if (d.key != null) { + m.key = String(d.key); + } + if (d.stringData != null) { + m.stringData = String(d.stringData); + } + if (d.intData != null) { + if ($util.Long) + (m.intData = $util.Long.fromValue(d.intData)).unsigned = false; + else if (typeof d.intData === "string") + m.intData = parseInt(d.intData, 10); + else if (typeof d.intData === "number") + m.intData = d.intData; + else if (typeof d.intData === "object") + m.intData = new $util.LongBits(d.intData.low >>> 0, d.intData.high >>> 0).toNumber(); + } + if (d.floatData != null) { + m.floatData = Number(d.floatData); + } + if (d.contents != null) { + if (typeof d.contents !== "object") + throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected"); + m.contents = $root.proto.ContextInfo.DataSharingContext.Parameters.fromObject(d.contents); + } + return m; + }; + + Parameters.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = m.key; + if (o.oneofs) + d._key = "key"; + } + if (m.stringData != null && m.hasOwnProperty("stringData")) { + d.stringData = m.stringData; + if (o.oneofs) + d._stringData = "stringData"; + } + if (m.intData != null && m.hasOwnProperty("intData")) { + if (typeof m.intData === "number") + d.intData = o.longs === String ? String(m.intData) : m.intData; + else + d.intData = o.longs === String ? $util.Long.prototype.toString.call(m.intData) : o.longs === Number ? new $util.LongBits(m.intData.low >>> 0, m.intData.high >>> 0).toNumber() : m.intData; + if (o.oneofs) + d._intData = "intData"; + } + if (m.floatData != null && m.hasOwnProperty("floatData")) { + d.floatData = o.json && !isFinite(m.floatData) ? String(m.floatData) : m.floatData; + if (o.oneofs) + d._floatData = "floatData"; + } + if (m.contents != null && m.hasOwnProperty("contents")) { + d.contents = $root.proto.ContextInfo.DataSharingContext.Parameters.toObject(m.contents, o); + if (o.oneofs) + d._contents = "contents"; + } + return d; + }; + + Parameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8094,31 +18191,183 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ExternalAdReplyInfo.prototype.title = ""; - ExternalAdReplyInfo.prototype.body = ""; - ExternalAdReplyInfo.prototype.mediaType = 0; - ExternalAdReplyInfo.prototype.thumbnailUrl = ""; - ExternalAdReplyInfo.prototype.mediaUrl = ""; - ExternalAdReplyInfo.prototype.thumbnail = $util.newBuffer([]); - ExternalAdReplyInfo.prototype.sourceType = ""; - ExternalAdReplyInfo.prototype.sourceId = ""; - ExternalAdReplyInfo.prototype.sourceUrl = ""; - ExternalAdReplyInfo.prototype.containsAutoReply = false; - ExternalAdReplyInfo.prototype.renderLargerThumbnail = false; - ExternalAdReplyInfo.prototype.showAdAttribution = false; - ExternalAdReplyInfo.prototype.ctwaClid = ""; - ExternalAdReplyInfo.prototype.ref = ""; - ExternalAdReplyInfo.prototype.clickToWhatsappCall = false; - ExternalAdReplyInfo.prototype.adContextPreviewDismissed = false; - ExternalAdReplyInfo.prototype.sourceApp = ""; - ExternalAdReplyInfo.prototype.automatedGreetingMessageShown = false; - ExternalAdReplyInfo.prototype.greetingMessageBody = ""; - ExternalAdReplyInfo.prototype.ctaPayload = ""; - ExternalAdReplyInfo.prototype.disableNudge = false; - ExternalAdReplyInfo.prototype.originalImageUrl = ""; - ExternalAdReplyInfo.prototype.automatedGreetingMessageCtaType = ""; - ExternalAdReplyInfo.prototype.wtwaAdFormat = false; - ExternalAdReplyInfo.prototype.adType = 0; + ExternalAdReplyInfo.prototype.title = null; + ExternalAdReplyInfo.prototype.body = null; + ExternalAdReplyInfo.prototype.mediaType = null; + ExternalAdReplyInfo.prototype.thumbnailUrl = null; + ExternalAdReplyInfo.prototype.mediaUrl = null; + ExternalAdReplyInfo.prototype.thumbnail = null; + ExternalAdReplyInfo.prototype.sourceType = null; + ExternalAdReplyInfo.prototype.sourceId = null; + ExternalAdReplyInfo.prototype.sourceUrl = null; + ExternalAdReplyInfo.prototype.containsAutoReply = null; + ExternalAdReplyInfo.prototype.renderLargerThumbnail = null; + ExternalAdReplyInfo.prototype.showAdAttribution = null; + ExternalAdReplyInfo.prototype.ctwaClid = null; + ExternalAdReplyInfo.prototype.ref = null; + ExternalAdReplyInfo.prototype.clickToWhatsappCall = null; + ExternalAdReplyInfo.prototype.adContextPreviewDismissed = null; + ExternalAdReplyInfo.prototype.sourceApp = null; + ExternalAdReplyInfo.prototype.automatedGreetingMessageShown = null; + ExternalAdReplyInfo.prototype.greetingMessageBody = null; + ExternalAdReplyInfo.prototype.ctaPayload = null; + ExternalAdReplyInfo.prototype.disableNudge = null; + ExternalAdReplyInfo.prototype.originalImageUrl = null; + ExternalAdReplyInfo.prototype.automatedGreetingMessageCtaType = null; + ExternalAdReplyInfo.prototype.wtwaAdFormat = null; + ExternalAdReplyInfo.prototype.adType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_body", { + get: $util.oneOfGetter($oneOfFields = ["body"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_mediaType", { + get: $util.oneOfGetter($oneOfFields = ["mediaType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_thumbnailUrl", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_mediaUrl", { + get: $util.oneOfGetter($oneOfFields = ["mediaUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_thumbnail", { + get: $util.oneOfGetter($oneOfFields = ["thumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceType", { + get: $util.oneOfGetter($oneOfFields = ["sourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceId", { + get: $util.oneOfGetter($oneOfFields = ["sourceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceUrl", { + get: $util.oneOfGetter($oneOfFields = ["sourceUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_containsAutoReply", { + get: $util.oneOfGetter($oneOfFields = ["containsAutoReply"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_renderLargerThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["renderLargerThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_showAdAttribution", { + get: $util.oneOfGetter($oneOfFields = ["showAdAttribution"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_ctwaClid", { + get: $util.oneOfGetter($oneOfFields = ["ctwaClid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_ref", { + get: $util.oneOfGetter($oneOfFields = ["ref"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_clickToWhatsappCall", { + get: $util.oneOfGetter($oneOfFields = ["clickToWhatsappCall"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_adContextPreviewDismissed", { + get: $util.oneOfGetter($oneOfFields = ["adContextPreviewDismissed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_sourceApp", { + get: $util.oneOfGetter($oneOfFields = ["sourceApp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_automatedGreetingMessageShown", { + get: $util.oneOfGetter($oneOfFields = ["automatedGreetingMessageShown"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_greetingMessageBody", { + get: $util.oneOfGetter($oneOfFields = ["greetingMessageBody"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_ctaPayload", { + get: $util.oneOfGetter($oneOfFields = ["ctaPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_disableNudge", { + get: $util.oneOfGetter($oneOfFields = ["disableNudge"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_originalImageUrl", { + get: $util.oneOfGetter($oneOfFields = ["originalImageUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_automatedGreetingMessageCtaType", { + get: $util.oneOfGetter($oneOfFields = ["automatedGreetingMessageCtaType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_wtwaAdFormat", { + get: $util.oneOfGetter($oneOfFields = ["wtwaAdFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalAdReplyInfo.prototype, "_adType", { + get: $util.oneOfGetter($oneOfFields = ["adType"]), + set: $util.oneOfSetter($oneOfFields) + }); ExternalAdReplyInfo.create = function create(properties) { return new ExternalAdReplyInfo(properties); @@ -8297,6 +18546,257 @@ export const proto = $root.proto = (() => { return m; }; + ExternalAdReplyInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.ExternalAdReplyInfo) + return d; + var m = new $root.proto.ContextInfo.ExternalAdReplyInfo(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.body != null) { + m.body = String(d.body); + } + switch (d.mediaType) { + default: + if (typeof d.mediaType === "number") { + m.mediaType = d.mediaType; + break; + } + break; + case "NONE": + case 0: + m.mediaType = 0; + break; + case "IMAGE": + case 1: + m.mediaType = 1; + break; + case "VIDEO": + case 2: + m.mediaType = 2; + break; + } + if (d.thumbnailUrl != null) { + m.thumbnailUrl = String(d.thumbnailUrl); + } + if (d.mediaUrl != null) { + m.mediaUrl = String(d.mediaUrl); + } + if (d.thumbnail != null) { + if (typeof d.thumbnail === "string") + $util.base64.decode(d.thumbnail, m.thumbnail = $util.newBuffer($util.base64.length(d.thumbnail)), 0); + else if (d.thumbnail.length >= 0) + m.thumbnail = d.thumbnail; + } + if (d.sourceType != null) { + m.sourceType = String(d.sourceType); + } + if (d.sourceId != null) { + m.sourceId = String(d.sourceId); + } + if (d.sourceUrl != null) { + m.sourceUrl = String(d.sourceUrl); + } + if (d.containsAutoReply != null) { + m.containsAutoReply = Boolean(d.containsAutoReply); + } + if (d.renderLargerThumbnail != null) { + m.renderLargerThumbnail = Boolean(d.renderLargerThumbnail); + } + if (d.showAdAttribution != null) { + m.showAdAttribution = Boolean(d.showAdAttribution); + } + if (d.ctwaClid != null) { + m.ctwaClid = String(d.ctwaClid); + } + if (d.ref != null) { + m.ref = String(d.ref); + } + if (d.clickToWhatsappCall != null) { + m.clickToWhatsappCall = Boolean(d.clickToWhatsappCall); + } + if (d.adContextPreviewDismissed != null) { + m.adContextPreviewDismissed = Boolean(d.adContextPreviewDismissed); + } + if (d.sourceApp != null) { + m.sourceApp = String(d.sourceApp); + } + if (d.automatedGreetingMessageShown != null) { + m.automatedGreetingMessageShown = Boolean(d.automatedGreetingMessageShown); + } + if (d.greetingMessageBody != null) { + m.greetingMessageBody = String(d.greetingMessageBody); + } + if (d.ctaPayload != null) { + m.ctaPayload = String(d.ctaPayload); + } + if (d.disableNudge != null) { + m.disableNudge = Boolean(d.disableNudge); + } + if (d.originalImageUrl != null) { + m.originalImageUrl = String(d.originalImageUrl); + } + if (d.automatedGreetingMessageCtaType != null) { + m.automatedGreetingMessageCtaType = String(d.automatedGreetingMessageCtaType); + } + if (d.wtwaAdFormat != null) { + m.wtwaAdFormat = Boolean(d.wtwaAdFormat); + } + switch (d.adType) { + default: + if (typeof d.adType === "number") { + m.adType = d.adType; + break; + } + break; + case "CTWA": + case 0: + m.adType = 0; + break; + case "CAWC": + case 1: + m.adType = 1; + break; + } + return m; + }; + + ExternalAdReplyInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.body != null && m.hasOwnProperty("body")) { + d.body = m.body; + if (o.oneofs) + d._body = "body"; + } + if (m.mediaType != null && m.hasOwnProperty("mediaType")) { + d.mediaType = o.enums === String ? $root.proto.ContextInfo.ExternalAdReplyInfo.MediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.ContextInfo.ExternalAdReplyInfo.MediaType[m.mediaType] : m.mediaType; + if (o.oneofs) + d._mediaType = "mediaType"; + } + if (m.thumbnailUrl != null && m.hasOwnProperty("thumbnailUrl")) { + d.thumbnailUrl = m.thumbnailUrl; + if (o.oneofs) + d._thumbnailUrl = "thumbnailUrl"; + } + if (m.mediaUrl != null && m.hasOwnProperty("mediaUrl")) { + d.mediaUrl = m.mediaUrl; + if (o.oneofs) + d._mediaUrl = "mediaUrl"; + } + if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) { + d.thumbnail = o.bytes === String ? $util.base64.encode(m.thumbnail, 0, m.thumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnail) : m.thumbnail; + if (o.oneofs) + d._thumbnail = "thumbnail"; + } + if (m.sourceType != null && m.hasOwnProperty("sourceType")) { + d.sourceType = m.sourceType; + if (o.oneofs) + d._sourceType = "sourceType"; + } + if (m.sourceId != null && m.hasOwnProperty("sourceId")) { + d.sourceId = m.sourceId; + if (o.oneofs) + d._sourceId = "sourceId"; + } + if (m.sourceUrl != null && m.hasOwnProperty("sourceUrl")) { + d.sourceUrl = m.sourceUrl; + if (o.oneofs) + d._sourceUrl = "sourceUrl"; + } + if (m.containsAutoReply != null && m.hasOwnProperty("containsAutoReply")) { + d.containsAutoReply = m.containsAutoReply; + if (o.oneofs) + d._containsAutoReply = "containsAutoReply"; + } + if (m.renderLargerThumbnail != null && m.hasOwnProperty("renderLargerThumbnail")) { + d.renderLargerThumbnail = m.renderLargerThumbnail; + if (o.oneofs) + d._renderLargerThumbnail = "renderLargerThumbnail"; + } + if (m.showAdAttribution != null && m.hasOwnProperty("showAdAttribution")) { + d.showAdAttribution = m.showAdAttribution; + if (o.oneofs) + d._showAdAttribution = "showAdAttribution"; + } + if (m.ctwaClid != null && m.hasOwnProperty("ctwaClid")) { + d.ctwaClid = m.ctwaClid; + if (o.oneofs) + d._ctwaClid = "ctwaClid"; + } + if (m.ref != null && m.hasOwnProperty("ref")) { + d.ref = m.ref; + if (o.oneofs) + d._ref = "ref"; + } + if (m.clickToWhatsappCall != null && m.hasOwnProperty("clickToWhatsappCall")) { + d.clickToWhatsappCall = m.clickToWhatsappCall; + if (o.oneofs) + d._clickToWhatsappCall = "clickToWhatsappCall"; + } + if (m.adContextPreviewDismissed != null && m.hasOwnProperty("adContextPreviewDismissed")) { + d.adContextPreviewDismissed = m.adContextPreviewDismissed; + if (o.oneofs) + d._adContextPreviewDismissed = "adContextPreviewDismissed"; + } + if (m.sourceApp != null && m.hasOwnProperty("sourceApp")) { + d.sourceApp = m.sourceApp; + if (o.oneofs) + d._sourceApp = "sourceApp"; + } + if (m.automatedGreetingMessageShown != null && m.hasOwnProperty("automatedGreetingMessageShown")) { + d.automatedGreetingMessageShown = m.automatedGreetingMessageShown; + if (o.oneofs) + d._automatedGreetingMessageShown = "automatedGreetingMessageShown"; + } + if (m.greetingMessageBody != null && m.hasOwnProperty("greetingMessageBody")) { + d.greetingMessageBody = m.greetingMessageBody; + if (o.oneofs) + d._greetingMessageBody = "greetingMessageBody"; + } + if (m.ctaPayload != null && m.hasOwnProperty("ctaPayload")) { + d.ctaPayload = m.ctaPayload; + if (o.oneofs) + d._ctaPayload = "ctaPayload"; + } + if (m.disableNudge != null && m.hasOwnProperty("disableNudge")) { + d.disableNudge = m.disableNudge; + if (o.oneofs) + d._disableNudge = "disableNudge"; + } + if (m.originalImageUrl != null && m.hasOwnProperty("originalImageUrl")) { + d.originalImageUrl = m.originalImageUrl; + if (o.oneofs) + d._originalImageUrl = "originalImageUrl"; + } + if (m.automatedGreetingMessageCtaType != null && m.hasOwnProperty("automatedGreetingMessageCtaType")) { + d.automatedGreetingMessageCtaType = m.automatedGreetingMessageCtaType; + if (o.oneofs) + d._automatedGreetingMessageCtaType = "automatedGreetingMessageCtaType"; + } + if (m.wtwaAdFormat != null && m.hasOwnProperty("wtwaAdFormat")) { + d.wtwaAdFormat = m.wtwaAdFormat; + if (o.oneofs) + d._wtwaAdFormat = "wtwaAdFormat"; + } + if (m.adType != null && m.hasOwnProperty("adType")) { + d.adType = o.enums === String ? $root.proto.ContextInfo.ExternalAdReplyInfo.AdType[m.adType] === undefined ? m.adType : $root.proto.ContextInfo.ExternalAdReplyInfo.AdType[m.adType] : m.adType; + if (o.oneofs) + d._adType = "adType"; + } + return d; + }; + + ExternalAdReplyInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExternalAdReplyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8331,10 +18831,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - FeatureEligibilities.prototype.cannotBeReactedTo = false; - FeatureEligibilities.prototype.cannotBeRanked = false; - FeatureEligibilities.prototype.canRequestFeedback = false; - FeatureEligibilities.prototype.canBeReshared = false; + FeatureEligibilities.prototype.cannotBeReactedTo = null; + FeatureEligibilities.prototype.cannotBeRanked = null; + FeatureEligibilities.prototype.canRequestFeedback = null; + FeatureEligibilities.prototype.canBeReshared = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FeatureEligibilities.prototype, "_cannotBeReactedTo", { + get: $util.oneOfGetter($oneOfFields = ["cannotBeReactedTo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FeatureEligibilities.prototype, "_cannotBeRanked", { + get: $util.oneOfGetter($oneOfFields = ["cannotBeRanked"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FeatureEligibilities.prototype, "_canRequestFeedback", { + get: $util.oneOfGetter($oneOfFields = ["canRequestFeedback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FeatureEligibilities.prototype, "_canBeReshared", { + get: $util.oneOfGetter($oneOfFields = ["canBeReshared"]), + set: $util.oneOfSetter($oneOfFields) + }); FeatureEligibilities.create = function create(properties) { return new FeatureEligibilities(properties); @@ -8387,6 +18913,56 @@ export const proto = $root.proto = (() => { return m; }; + FeatureEligibilities.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.FeatureEligibilities) + return d; + var m = new $root.proto.ContextInfo.FeatureEligibilities(); + if (d.cannotBeReactedTo != null) { + m.cannotBeReactedTo = Boolean(d.cannotBeReactedTo); + } + if (d.cannotBeRanked != null) { + m.cannotBeRanked = Boolean(d.cannotBeRanked); + } + if (d.canRequestFeedback != null) { + m.canRequestFeedback = Boolean(d.canRequestFeedback); + } + if (d.canBeReshared != null) { + m.canBeReshared = Boolean(d.canBeReshared); + } + return m; + }; + + FeatureEligibilities.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.cannotBeReactedTo != null && m.hasOwnProperty("cannotBeReactedTo")) { + d.cannotBeReactedTo = m.cannotBeReactedTo; + if (o.oneofs) + d._cannotBeReactedTo = "cannotBeReactedTo"; + } + if (m.cannotBeRanked != null && m.hasOwnProperty("cannotBeRanked")) { + d.cannotBeRanked = m.cannotBeRanked; + if (o.oneofs) + d._cannotBeRanked = "cannotBeRanked"; + } + if (m.canRequestFeedback != null && m.hasOwnProperty("canRequestFeedback")) { + d.canRequestFeedback = m.canRequestFeedback; + if (o.oneofs) + d._canRequestFeedback = "canRequestFeedback"; + } + if (m.canBeReshared != null && m.hasOwnProperty("canBeReshared")) { + d.canBeReshared = m.canBeReshared; + if (o.oneofs) + d._canBeReshared = "canBeReshared"; + } + return d; + }; + + FeatureEligibilities.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FeatureEligibilities.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8406,9 +18982,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ForwardedAIBotMessageInfo.prototype.botName = ""; - ForwardedAIBotMessageInfo.prototype.botJid = ""; - ForwardedAIBotMessageInfo.prototype.creatorName = ""; + ForwardedAIBotMessageInfo.prototype.botName = null; + ForwardedAIBotMessageInfo.prototype.botJid = null; + ForwardedAIBotMessageInfo.prototype.creatorName = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedAIBotMessageInfo.prototype, "_botName", { + get: $util.oneOfGetter($oneOfFields = ["botName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedAIBotMessageInfo.prototype, "_botJid", { + get: $util.oneOfGetter($oneOfFields = ["botJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedAIBotMessageInfo.prototype, "_creatorName", { + get: $util.oneOfGetter($oneOfFields = ["creatorName"]), + set: $util.oneOfSetter($oneOfFields) + }); ForwardedAIBotMessageInfo.create = function create(properties) { return new ForwardedAIBotMessageInfo(properties); @@ -8455,6 +19051,48 @@ export const proto = $root.proto = (() => { return m; }; + ForwardedAIBotMessageInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.ForwardedAIBotMessageInfo) + return d; + var m = new $root.proto.ContextInfo.ForwardedAIBotMessageInfo(); + if (d.botName != null) { + m.botName = String(d.botName); + } + if (d.botJid != null) { + m.botJid = String(d.botJid); + } + if (d.creatorName != null) { + m.creatorName = String(d.creatorName); + } + return m; + }; + + ForwardedAIBotMessageInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.botName != null && m.hasOwnProperty("botName")) { + d.botName = m.botName; + if (o.oneofs) + d._botName = "botName"; + } + if (m.botJid != null && m.hasOwnProperty("botJid")) { + d.botJid = m.botJid; + if (o.oneofs) + d._botJid = "botJid"; + } + if (m.creatorName != null && m.hasOwnProperty("creatorName")) { + d.creatorName = m.creatorName; + if (o.oneofs) + d._creatorName = "creatorName"; + } + return d; + }; + + ForwardedAIBotMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ForwardedAIBotMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8474,11 +19112,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ForwardedNewsletterMessageInfo.prototype.newsletterJid = ""; - ForwardedNewsletterMessageInfo.prototype.serverMessageId = 0; - ForwardedNewsletterMessageInfo.prototype.newsletterName = ""; - ForwardedNewsletterMessageInfo.prototype.contentType = 1; - ForwardedNewsletterMessageInfo.prototype.accessibilityText = ""; + ForwardedNewsletterMessageInfo.prototype.newsletterJid = null; + ForwardedNewsletterMessageInfo.prototype.serverMessageId = null; + ForwardedNewsletterMessageInfo.prototype.newsletterName = null; + ForwardedNewsletterMessageInfo.prototype.contentType = null; + ForwardedNewsletterMessageInfo.prototype.accessibilityText = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_newsletterJid", { + get: $util.oneOfGetter($oneOfFields = ["newsletterJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_serverMessageId", { + get: $util.oneOfGetter($oneOfFields = ["serverMessageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_newsletterName", { + get: $util.oneOfGetter($oneOfFields = ["newsletterName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_contentType", { + get: $util.oneOfGetter($oneOfFields = ["contentType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedNewsletterMessageInfo.prototype, "_accessibilityText", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityText"]), + set: $util.oneOfSetter($oneOfFields) + }); ForwardedNewsletterMessageInfo.create = function create(properties) { return new ForwardedNewsletterMessageInfo(properties); @@ -8537,6 +19207,81 @@ export const proto = $root.proto = (() => { return m; }; + ForwardedNewsletterMessageInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.ForwardedNewsletterMessageInfo) + return d; + var m = new $root.proto.ContextInfo.ForwardedNewsletterMessageInfo(); + if (d.newsletterJid != null) { + m.newsletterJid = String(d.newsletterJid); + } + if (d.serverMessageId != null) { + m.serverMessageId = d.serverMessageId | 0; + } + if (d.newsletterName != null) { + m.newsletterName = String(d.newsletterName); + } + switch (d.contentType) { + default: + if (typeof d.contentType === "number") { + m.contentType = d.contentType; + break; + } + break; + case "UPDATE": + case 1: + m.contentType = 1; + break; + case "UPDATE_CARD": + case 2: + m.contentType = 2; + break; + case "LINK_CARD": + case 3: + m.contentType = 3; + break; + } + if (d.accessibilityText != null) { + m.accessibilityText = String(d.accessibilityText); + } + return m; + }; + + ForwardedNewsletterMessageInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.newsletterJid != null && m.hasOwnProperty("newsletterJid")) { + d.newsletterJid = m.newsletterJid; + if (o.oneofs) + d._newsletterJid = "newsletterJid"; + } + if (m.serverMessageId != null && m.hasOwnProperty("serverMessageId")) { + d.serverMessageId = m.serverMessageId; + if (o.oneofs) + d._serverMessageId = "serverMessageId"; + } + if (m.newsletterName != null && m.hasOwnProperty("newsletterName")) { + d.newsletterName = m.newsletterName; + if (o.oneofs) + d._newsletterName = "newsletterName"; + } + if (m.contentType != null && m.hasOwnProperty("contentType")) { + d.contentType = o.enums === String ? $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[m.contentType] === undefined ? m.contentType : $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[m.contentType] : m.contentType; + if (o.oneofs) + d._contentType = "contentType"; + } + if (m.accessibilityText != null && m.hasOwnProperty("accessibilityText")) { + d.accessibilityText = m.accessibilityText; + if (o.oneofs) + d._accessibilityText = "accessibilityText"; + } + return d; + }; + + ForwardedNewsletterMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ForwardedNewsletterMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8595,8 +19340,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UTMInfo.prototype.utmSource = ""; - UTMInfo.prototype.utmCampaign = ""; + UTMInfo.prototype.utmSource = null; + UTMInfo.prototype.utmCampaign = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UTMInfo.prototype, "_utmSource", { + get: $util.oneOfGetter($oneOfFields = ["utmSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UTMInfo.prototype, "_utmCampaign", { + get: $util.oneOfGetter($oneOfFields = ["utmCampaign"]), + set: $util.oneOfSetter($oneOfFields) + }); UTMInfo.create = function create(properties) { return new UTMInfo(properties); @@ -8637,6 +19396,40 @@ export const proto = $root.proto = (() => { return m; }; + UTMInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ContextInfo.UTMInfo) + return d; + var m = new $root.proto.ContextInfo.UTMInfo(); + if (d.utmSource != null) { + m.utmSource = String(d.utmSource); + } + if (d.utmCampaign != null) { + m.utmCampaign = String(d.utmCampaign); + } + return m; + }; + + UTMInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.utmSource != null && m.hasOwnProperty("utmSource")) { + d.utmSource = m.utmSource; + if (o.oneofs) + d._utmSource = "utmSource"; + } + if (m.utmCampaign != null && m.hasOwnProperty("utmCampaign")) { + d.utmCampaign = m.utmCampaign; + if (o.oneofs) + d._utmCampaign = "utmCampaign"; + } + return d; + }; + + UTMInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UTMInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -8663,57 +19456,359 @@ export const proto = $root.proto = (() => { Conversation.prototype.id = ""; Conversation.prototype.messages = $util.emptyArray; - Conversation.prototype.newJid = ""; - Conversation.prototype.oldJid = ""; - Conversation.prototype.lastMsgTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Conversation.prototype.unreadCount = 0; - Conversation.prototype.readOnly = false; - Conversation.prototype.endOfHistoryTransfer = false; - Conversation.prototype.ephemeralExpiration = 0; - Conversation.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - Conversation.prototype.endOfHistoryTransferType = 0; - Conversation.prototype.conversationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Conversation.prototype.name = ""; - Conversation.prototype.pHash = ""; - Conversation.prototype.notSpam = false; - Conversation.prototype.archived = false; + Conversation.prototype.newJid = null; + Conversation.prototype.oldJid = null; + Conversation.prototype.lastMsgTimestamp = null; + Conversation.prototype.unreadCount = null; + Conversation.prototype.readOnly = null; + Conversation.prototype.endOfHistoryTransfer = null; + Conversation.prototype.ephemeralExpiration = null; + Conversation.prototype.ephemeralSettingTimestamp = null; + Conversation.prototype.endOfHistoryTransferType = null; + Conversation.prototype.conversationTimestamp = null; + Conversation.prototype.name = null; + Conversation.prototype.pHash = null; + Conversation.prototype.notSpam = null; + Conversation.prototype.archived = null; Conversation.prototype.disappearingMode = null; - Conversation.prototype.unreadMentionCount = 0; - Conversation.prototype.markedAsUnread = false; + Conversation.prototype.unreadMentionCount = null; + Conversation.prototype.markedAsUnread = null; Conversation.prototype.participant = $util.emptyArray; - Conversation.prototype.tcToken = $util.newBuffer([]); - Conversation.prototype.tcTokenTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Conversation.prototype.contactPrimaryIdentityKey = $util.newBuffer([]); - Conversation.prototype.pinned = 0; - Conversation.prototype.muteEndTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Conversation.prototype.tcToken = null; + Conversation.prototype.tcTokenTimestamp = null; + Conversation.prototype.contactPrimaryIdentityKey = null; + Conversation.prototype.pinned = null; + Conversation.prototype.muteEndTime = null; Conversation.prototype.wallpaper = null; - Conversation.prototype.mediaVisibility = 0; - Conversation.prototype.tcTokenSenderTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Conversation.prototype.suspended = false; - Conversation.prototype.terminated = false; - Conversation.prototype.createdAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Conversation.prototype.createdBy = ""; - Conversation.prototype.description = ""; - Conversation.prototype.support = false; - Conversation.prototype.isParentGroup = false; - Conversation.prototype.parentGroupId = ""; - Conversation.prototype.isDefaultSubgroup = false; - Conversation.prototype.displayName = ""; - Conversation.prototype.pnJid = ""; - Conversation.prototype.shareOwnPn = false; - Conversation.prototype.pnhDuplicateLidThread = false; - Conversation.prototype.lidJid = ""; - Conversation.prototype.username = ""; - Conversation.prototype.lidOriginType = ""; - Conversation.prototype.commentsCount = 0; - Conversation.prototype.locked = false; - Conversation.prototype.systemMessageToInsert = 1; - Conversation.prototype.capiCreatedGroup = false; - Conversation.prototype.accountLid = ""; - Conversation.prototype.limitSharing = false; - Conversation.prototype.limitSharingSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - Conversation.prototype.limitSharingTrigger = 0; - Conversation.prototype.limitSharingInitiatedByMe = false; + Conversation.prototype.mediaVisibility = null; + Conversation.prototype.tcTokenSenderTimestamp = null; + Conversation.prototype.suspended = null; + Conversation.prototype.terminated = null; + Conversation.prototype.createdAt = null; + Conversation.prototype.createdBy = null; + Conversation.prototype.description = null; + Conversation.prototype.support = null; + Conversation.prototype.isParentGroup = null; + Conversation.prototype.parentGroupId = null; + Conversation.prototype.isDefaultSubgroup = null; + Conversation.prototype.displayName = null; + Conversation.prototype.pnJid = null; + Conversation.prototype.shareOwnPn = null; + Conversation.prototype.pnhDuplicateLidThread = null; + Conversation.prototype.lidJid = null; + Conversation.prototype.username = null; + Conversation.prototype.lidOriginType = null; + Conversation.prototype.commentsCount = null; + Conversation.prototype.locked = null; + Conversation.prototype.systemMessageToInsert = null; + Conversation.prototype.capiCreatedGroup = null; + Conversation.prototype.accountLid = null; + Conversation.prototype.limitSharing = null; + Conversation.prototype.limitSharingSettingTimestamp = null; + Conversation.prototype.limitSharingTrigger = null; + Conversation.prototype.limitSharingInitiatedByMe = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_newJid", { + get: $util.oneOfGetter($oneOfFields = ["newJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_oldJid", { + get: $util.oneOfGetter($oneOfFields = ["oldJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_lastMsgTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastMsgTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_unreadCount", { + get: $util.oneOfGetter($oneOfFields = ["unreadCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_readOnly", { + get: $util.oneOfGetter($oneOfFields = ["readOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_endOfHistoryTransfer", { + get: $util.oneOfGetter($oneOfFields = ["endOfHistoryTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_ephemeralExpiration", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralExpiration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_ephemeralSettingTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralSettingTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_endOfHistoryTransferType", { + get: $util.oneOfGetter($oneOfFields = ["endOfHistoryTransferType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_conversationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["conversationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_pHash", { + get: $util.oneOfGetter($oneOfFields = ["pHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_notSpam", { + get: $util.oneOfGetter($oneOfFields = ["notSpam"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_archived", { + get: $util.oneOfGetter($oneOfFields = ["archived"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_disappearingMode", { + get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_unreadMentionCount", { + get: $util.oneOfGetter($oneOfFields = ["unreadMentionCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_markedAsUnread", { + get: $util.oneOfGetter($oneOfFields = ["markedAsUnread"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_tcToken", { + get: $util.oneOfGetter($oneOfFields = ["tcToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_tcTokenTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["tcTokenTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_contactPrimaryIdentityKey", { + get: $util.oneOfGetter($oneOfFields = ["contactPrimaryIdentityKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_pinned", { + get: $util.oneOfGetter($oneOfFields = ["pinned"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_muteEndTime", { + get: $util.oneOfGetter($oneOfFields = ["muteEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_wallpaper", { + get: $util.oneOfGetter($oneOfFields = ["wallpaper"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_mediaVisibility", { + get: $util.oneOfGetter($oneOfFields = ["mediaVisibility"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_tcTokenSenderTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["tcTokenSenderTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_suspended", { + get: $util.oneOfGetter($oneOfFields = ["suspended"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_terminated", { + get: $util.oneOfGetter($oneOfFields = ["terminated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_createdAt", { + get: $util.oneOfGetter($oneOfFields = ["createdAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_createdBy", { + get: $util.oneOfGetter($oneOfFields = ["createdBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_support", { + get: $util.oneOfGetter($oneOfFields = ["support"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_isParentGroup", { + get: $util.oneOfGetter($oneOfFields = ["isParentGroup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_parentGroupId", { + get: $util.oneOfGetter($oneOfFields = ["parentGroupId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_isDefaultSubgroup", { + get: $util.oneOfGetter($oneOfFields = ["isDefaultSubgroup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_pnJid", { + get: $util.oneOfGetter($oneOfFields = ["pnJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_shareOwnPn", { + get: $util.oneOfGetter($oneOfFields = ["shareOwnPn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_pnhDuplicateLidThread", { + get: $util.oneOfGetter($oneOfFields = ["pnhDuplicateLidThread"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_lidJid", { + get: $util.oneOfGetter($oneOfFields = ["lidJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_username", { + get: $util.oneOfGetter($oneOfFields = ["username"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_lidOriginType", { + get: $util.oneOfGetter($oneOfFields = ["lidOriginType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_commentsCount", { + get: $util.oneOfGetter($oneOfFields = ["commentsCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_locked", { + get: $util.oneOfGetter($oneOfFields = ["locked"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_systemMessageToInsert", { + get: $util.oneOfGetter($oneOfFields = ["systemMessageToInsert"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_capiCreatedGroup", { + get: $util.oneOfGetter($oneOfFields = ["capiCreatedGroup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_accountLid", { + get: $util.oneOfGetter($oneOfFields = ["accountLid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_limitSharing", { + get: $util.oneOfGetter($oneOfFields = ["limitSharing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_limitSharingSettingTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["limitSharingSettingTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_limitSharingTrigger", { + get: $util.oneOfGetter($oneOfFields = ["limitSharingTrigger"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Conversation.prototype, "_limitSharingInitiatedByMe", { + get: $util.oneOfGetter($oneOfFields = ["limitSharingInitiatedByMe"]), + set: $util.oneOfSetter($oneOfFields) + }); Conversation.create = function create(properties) { return new Conversation(properties); @@ -8722,7 +19817,8 @@ export const proto = $root.proto = (() => { Conversation.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(10).string(m.id); + if (m.id != null && Object.hasOwnProperty.call(m, "id")) + w.uint32(10).string(m.id); if (m.messages != null && m.messages.length) { for (var i = 0; i < m.messages.length; ++i) $root.proto.HistorySyncMsg.encode(m.messages[i], w.uint32(18).fork()).ldelim(); @@ -9064,11 +20160,634 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("id")) - throw $util.ProtocolError("missing required 'id'", { instance: m }); return m; }; + Conversation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Conversation) + return d; + var m = new $root.proto.Conversation(); + if (d.id != null) { + m.id = String(d.id); + } + if (d.messages) { + if (!Array.isArray(d.messages)) + throw TypeError(".proto.Conversation.messages: array expected"); + m.messages = []; + for (var i = 0; i < d.messages.length; ++i) { + if (typeof d.messages[i] !== "object") + throw TypeError(".proto.Conversation.messages: object expected"); + m.messages[i] = $root.proto.HistorySyncMsg.fromObject(d.messages[i]); + } + } + if (d.newJid != null) { + m.newJid = String(d.newJid); + } + if (d.oldJid != null) { + m.oldJid = String(d.oldJid); + } + if (d.lastMsgTimestamp != null) { + if ($util.Long) + (m.lastMsgTimestamp = $util.Long.fromValue(d.lastMsgTimestamp)).unsigned = true; + else if (typeof d.lastMsgTimestamp === "string") + m.lastMsgTimestamp = parseInt(d.lastMsgTimestamp, 10); + else if (typeof d.lastMsgTimestamp === "number") + m.lastMsgTimestamp = d.lastMsgTimestamp; + else if (typeof d.lastMsgTimestamp === "object") + m.lastMsgTimestamp = new $util.LongBits(d.lastMsgTimestamp.low >>> 0, d.lastMsgTimestamp.high >>> 0).toNumber(true); + } + if (d.unreadCount != null) { + m.unreadCount = d.unreadCount >>> 0; + } + if (d.readOnly != null) { + m.readOnly = Boolean(d.readOnly); + } + if (d.endOfHistoryTransfer != null) { + m.endOfHistoryTransfer = Boolean(d.endOfHistoryTransfer); + } + if (d.ephemeralExpiration != null) { + m.ephemeralExpiration = d.ephemeralExpiration >>> 0; + } + if (d.ephemeralSettingTimestamp != null) { + if ($util.Long) + (m.ephemeralSettingTimestamp = $util.Long.fromValue(d.ephemeralSettingTimestamp)).unsigned = false; + else if (typeof d.ephemeralSettingTimestamp === "string") + m.ephemeralSettingTimestamp = parseInt(d.ephemeralSettingTimestamp, 10); + else if (typeof d.ephemeralSettingTimestamp === "number") + m.ephemeralSettingTimestamp = d.ephemeralSettingTimestamp; + else if (typeof d.ephemeralSettingTimestamp === "object") + m.ephemeralSettingTimestamp = new $util.LongBits(d.ephemeralSettingTimestamp.low >>> 0, d.ephemeralSettingTimestamp.high >>> 0).toNumber(); + } + switch (d.endOfHistoryTransferType) { + default: + if (typeof d.endOfHistoryTransferType === "number") { + m.endOfHistoryTransferType = d.endOfHistoryTransferType; + break; + } + break; + case "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY": + case 0: + m.endOfHistoryTransferType = 0; + break; + case "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY": + case 1: + m.endOfHistoryTransferType = 1; + break; + case "COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY": + case 2: + m.endOfHistoryTransferType = 2; + break; + } + if (d.conversationTimestamp != null) { + if ($util.Long) + (m.conversationTimestamp = $util.Long.fromValue(d.conversationTimestamp)).unsigned = true; + else if (typeof d.conversationTimestamp === "string") + m.conversationTimestamp = parseInt(d.conversationTimestamp, 10); + else if (typeof d.conversationTimestamp === "number") + m.conversationTimestamp = d.conversationTimestamp; + else if (typeof d.conversationTimestamp === "object") + m.conversationTimestamp = new $util.LongBits(d.conversationTimestamp.low >>> 0, d.conversationTimestamp.high >>> 0).toNumber(true); + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.pHash != null) { + m.pHash = String(d.pHash); + } + if (d.notSpam != null) { + m.notSpam = Boolean(d.notSpam); + } + if (d.archived != null) { + m.archived = Boolean(d.archived); + } + if (d.disappearingMode != null) { + if (typeof d.disappearingMode !== "object") + throw TypeError(".proto.Conversation.disappearingMode: object expected"); + m.disappearingMode = $root.proto.DisappearingMode.fromObject(d.disappearingMode); + } + if (d.unreadMentionCount != null) { + m.unreadMentionCount = d.unreadMentionCount >>> 0; + } + if (d.markedAsUnread != null) { + m.markedAsUnread = Boolean(d.markedAsUnread); + } + if (d.participant) { + if (!Array.isArray(d.participant)) + throw TypeError(".proto.Conversation.participant: array expected"); + m.participant = []; + for (var i = 0; i < d.participant.length; ++i) { + if (typeof d.participant[i] !== "object") + throw TypeError(".proto.Conversation.participant: object expected"); + m.participant[i] = $root.proto.GroupParticipant.fromObject(d.participant[i]); + } + } + if (d.tcToken != null) { + if (typeof d.tcToken === "string") + $util.base64.decode(d.tcToken, m.tcToken = $util.newBuffer($util.base64.length(d.tcToken)), 0); + else if (d.tcToken.length >= 0) + m.tcToken = d.tcToken; + } + if (d.tcTokenTimestamp != null) { + if ($util.Long) + (m.tcTokenTimestamp = $util.Long.fromValue(d.tcTokenTimestamp)).unsigned = true; + else if (typeof d.tcTokenTimestamp === "string") + m.tcTokenTimestamp = parseInt(d.tcTokenTimestamp, 10); + else if (typeof d.tcTokenTimestamp === "number") + m.tcTokenTimestamp = d.tcTokenTimestamp; + else if (typeof d.tcTokenTimestamp === "object") + m.tcTokenTimestamp = new $util.LongBits(d.tcTokenTimestamp.low >>> 0, d.tcTokenTimestamp.high >>> 0).toNumber(true); + } + if (d.contactPrimaryIdentityKey != null) { + if (typeof d.contactPrimaryIdentityKey === "string") + $util.base64.decode(d.contactPrimaryIdentityKey, m.contactPrimaryIdentityKey = $util.newBuffer($util.base64.length(d.contactPrimaryIdentityKey)), 0); + else if (d.contactPrimaryIdentityKey.length >= 0) + m.contactPrimaryIdentityKey = d.contactPrimaryIdentityKey; + } + if (d.pinned != null) { + m.pinned = d.pinned >>> 0; + } + if (d.muteEndTime != null) { + if ($util.Long) + (m.muteEndTime = $util.Long.fromValue(d.muteEndTime)).unsigned = true; + else if (typeof d.muteEndTime === "string") + m.muteEndTime = parseInt(d.muteEndTime, 10); + else if (typeof d.muteEndTime === "number") + m.muteEndTime = d.muteEndTime; + else if (typeof d.muteEndTime === "object") + m.muteEndTime = new $util.LongBits(d.muteEndTime.low >>> 0, d.muteEndTime.high >>> 0).toNumber(true); + } + if (d.wallpaper != null) { + if (typeof d.wallpaper !== "object") + throw TypeError(".proto.Conversation.wallpaper: object expected"); + m.wallpaper = $root.proto.WallpaperSettings.fromObject(d.wallpaper); + } + switch (d.mediaVisibility) { + default: + if (typeof d.mediaVisibility === "number") { + m.mediaVisibility = d.mediaVisibility; + break; + } + break; + case "DEFAULT": + case 0: + m.mediaVisibility = 0; + break; + case "OFF": + case 1: + m.mediaVisibility = 1; + break; + case "ON": + case 2: + m.mediaVisibility = 2; + break; + } + if (d.tcTokenSenderTimestamp != null) { + if ($util.Long) + (m.tcTokenSenderTimestamp = $util.Long.fromValue(d.tcTokenSenderTimestamp)).unsigned = true; + else if (typeof d.tcTokenSenderTimestamp === "string") + m.tcTokenSenderTimestamp = parseInt(d.tcTokenSenderTimestamp, 10); + else if (typeof d.tcTokenSenderTimestamp === "number") + m.tcTokenSenderTimestamp = d.tcTokenSenderTimestamp; + else if (typeof d.tcTokenSenderTimestamp === "object") + m.tcTokenSenderTimestamp = new $util.LongBits(d.tcTokenSenderTimestamp.low >>> 0, d.tcTokenSenderTimestamp.high >>> 0).toNumber(true); + } + if (d.suspended != null) { + m.suspended = Boolean(d.suspended); + } + if (d.terminated != null) { + m.terminated = Boolean(d.terminated); + } + if (d.createdAt != null) { + if ($util.Long) + (m.createdAt = $util.Long.fromValue(d.createdAt)).unsigned = true; + else if (typeof d.createdAt === "string") + m.createdAt = parseInt(d.createdAt, 10); + else if (typeof d.createdAt === "number") + m.createdAt = d.createdAt; + else if (typeof d.createdAt === "object") + m.createdAt = new $util.LongBits(d.createdAt.low >>> 0, d.createdAt.high >>> 0).toNumber(true); + } + if (d.createdBy != null) { + m.createdBy = String(d.createdBy); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.support != null) { + m.support = Boolean(d.support); + } + if (d.isParentGroup != null) { + m.isParentGroup = Boolean(d.isParentGroup); + } + if (d.parentGroupId != null) { + m.parentGroupId = String(d.parentGroupId); + } + if (d.isDefaultSubgroup != null) { + m.isDefaultSubgroup = Boolean(d.isDefaultSubgroup); + } + if (d.displayName != null) { + m.displayName = String(d.displayName); + } + if (d.pnJid != null) { + m.pnJid = String(d.pnJid); + } + if (d.shareOwnPn != null) { + m.shareOwnPn = Boolean(d.shareOwnPn); + } + if (d.pnhDuplicateLidThread != null) { + m.pnhDuplicateLidThread = Boolean(d.pnhDuplicateLidThread); + } + if (d.lidJid != null) { + m.lidJid = String(d.lidJid); + } + if (d.username != null) { + m.username = String(d.username); + } + if (d.lidOriginType != null) { + m.lidOriginType = String(d.lidOriginType); + } + if (d.commentsCount != null) { + m.commentsCount = d.commentsCount >>> 0; + } + if (d.locked != null) { + m.locked = Boolean(d.locked); + } + switch (d.systemMessageToInsert) { + default: + if (typeof d.systemMessageToInsert === "number") { + m.systemMessageToInsert = d.systemMessageToInsert; + break; + } + break; + case "E2EE_MSG": + case 1: + m.systemMessageToInsert = 1; + break; + case "NE2EE_SELF": + case 2: + m.systemMessageToInsert = 2; + break; + case "NE2EE_OTHER": + case 3: + m.systemMessageToInsert = 3; + break; + } + if (d.capiCreatedGroup != null) { + m.capiCreatedGroup = Boolean(d.capiCreatedGroup); + } + if (d.accountLid != null) { + m.accountLid = String(d.accountLid); + } + if (d.limitSharing != null) { + m.limitSharing = Boolean(d.limitSharing); + } + if (d.limitSharingSettingTimestamp != null) { + if ($util.Long) + (m.limitSharingSettingTimestamp = $util.Long.fromValue(d.limitSharingSettingTimestamp)).unsigned = false; + else if (typeof d.limitSharingSettingTimestamp === "string") + m.limitSharingSettingTimestamp = parseInt(d.limitSharingSettingTimestamp, 10); + else if (typeof d.limitSharingSettingTimestamp === "number") + m.limitSharingSettingTimestamp = d.limitSharingSettingTimestamp; + else if (typeof d.limitSharingSettingTimestamp === "object") + m.limitSharingSettingTimestamp = new $util.LongBits(d.limitSharingSettingTimestamp.low >>> 0, d.limitSharingSettingTimestamp.high >>> 0).toNumber(); + } + switch (d.limitSharingTrigger) { + default: + if (typeof d.limitSharingTrigger === "number") { + m.limitSharingTrigger = d.limitSharingTrigger; + break; + } + break; + case "UNKNOWN": + case 0: + m.limitSharingTrigger = 0; + break; + case "CHAT_SETTING": + case 1: + m.limitSharingTrigger = 1; + break; + case "BIZ_SUPPORTS_FB_HOSTING": + case 2: + m.limitSharingTrigger = 2; + break; + case "UNKNOWN_GROUP": + case 3: + m.limitSharingTrigger = 3; + break; + } + if (d.limitSharingInitiatedByMe != null) { + m.limitSharingInitiatedByMe = Boolean(d.limitSharingInitiatedByMe); + } + return m; + }; + + Conversation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.messages = []; + d.participant = []; + } + if (o.defaults) { + d.id = ""; + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + } + if (m.messages && m.messages.length) { + d.messages = []; + for (var j = 0; j < m.messages.length; ++j) { + d.messages[j] = $root.proto.HistorySyncMsg.toObject(m.messages[j], o); + } + } + if (m.newJid != null && m.hasOwnProperty("newJid")) { + d.newJid = m.newJid; + if (o.oneofs) + d._newJid = "newJid"; + } + if (m.oldJid != null && m.hasOwnProperty("oldJid")) { + d.oldJid = m.oldJid; + if (o.oneofs) + d._oldJid = "oldJid"; + } + if (m.lastMsgTimestamp != null && m.hasOwnProperty("lastMsgTimestamp")) { + if (typeof m.lastMsgTimestamp === "number") + d.lastMsgTimestamp = o.longs === String ? String(m.lastMsgTimestamp) : m.lastMsgTimestamp; + else + d.lastMsgTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.lastMsgTimestamp) : o.longs === Number ? new $util.LongBits(m.lastMsgTimestamp.low >>> 0, m.lastMsgTimestamp.high >>> 0).toNumber(true) : m.lastMsgTimestamp; + if (o.oneofs) + d._lastMsgTimestamp = "lastMsgTimestamp"; + } + if (m.unreadCount != null && m.hasOwnProperty("unreadCount")) { + d.unreadCount = m.unreadCount; + if (o.oneofs) + d._unreadCount = "unreadCount"; + } + if (m.readOnly != null && m.hasOwnProperty("readOnly")) { + d.readOnly = m.readOnly; + if (o.oneofs) + d._readOnly = "readOnly"; + } + if (m.endOfHistoryTransfer != null && m.hasOwnProperty("endOfHistoryTransfer")) { + d.endOfHistoryTransfer = m.endOfHistoryTransfer; + if (o.oneofs) + d._endOfHistoryTransfer = "endOfHistoryTransfer"; + } + if (m.ephemeralExpiration != null && m.hasOwnProperty("ephemeralExpiration")) { + d.ephemeralExpiration = m.ephemeralExpiration; + if (o.oneofs) + d._ephemeralExpiration = "ephemeralExpiration"; + } + if (m.ephemeralSettingTimestamp != null && m.hasOwnProperty("ephemeralSettingTimestamp")) { + if (typeof m.ephemeralSettingTimestamp === "number") + d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; + else + d.ephemeralSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralSettingTimestamp.low >>> 0, m.ephemeralSettingTimestamp.high >>> 0).toNumber() : m.ephemeralSettingTimestamp; + if (o.oneofs) + d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp"; + } + if (m.endOfHistoryTransferType != null && m.hasOwnProperty("endOfHistoryTransferType")) { + d.endOfHistoryTransferType = o.enums === String ? $root.proto.Conversation.EndOfHistoryTransferType[m.endOfHistoryTransferType] === undefined ? m.endOfHistoryTransferType : $root.proto.Conversation.EndOfHistoryTransferType[m.endOfHistoryTransferType] : m.endOfHistoryTransferType; + if (o.oneofs) + d._endOfHistoryTransferType = "endOfHistoryTransferType"; + } + if (m.conversationTimestamp != null && m.hasOwnProperty("conversationTimestamp")) { + if (typeof m.conversationTimestamp === "number") + d.conversationTimestamp = o.longs === String ? String(m.conversationTimestamp) : m.conversationTimestamp; + else + d.conversationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.conversationTimestamp) : o.longs === Number ? new $util.LongBits(m.conversationTimestamp.low >>> 0, m.conversationTimestamp.high >>> 0).toNumber(true) : m.conversationTimestamp; + if (o.oneofs) + d._conversationTimestamp = "conversationTimestamp"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.pHash != null && m.hasOwnProperty("pHash")) { + d.pHash = m.pHash; + if (o.oneofs) + d._pHash = "pHash"; + } + if (m.notSpam != null && m.hasOwnProperty("notSpam")) { + d.notSpam = m.notSpam; + if (o.oneofs) + d._notSpam = "notSpam"; + } + if (m.archived != null && m.hasOwnProperty("archived")) { + d.archived = m.archived; + if (o.oneofs) + d._archived = "archived"; + } + if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) { + d.disappearingMode = $root.proto.DisappearingMode.toObject(m.disappearingMode, o); + if (o.oneofs) + d._disappearingMode = "disappearingMode"; + } + if (m.unreadMentionCount != null && m.hasOwnProperty("unreadMentionCount")) { + d.unreadMentionCount = m.unreadMentionCount; + if (o.oneofs) + d._unreadMentionCount = "unreadMentionCount"; + } + if (m.markedAsUnread != null && m.hasOwnProperty("markedAsUnread")) { + d.markedAsUnread = m.markedAsUnread; + if (o.oneofs) + d._markedAsUnread = "markedAsUnread"; + } + if (m.participant && m.participant.length) { + d.participant = []; + for (var j = 0; j < m.participant.length; ++j) { + d.participant[j] = $root.proto.GroupParticipant.toObject(m.participant[j], o); + } + } + if (m.tcToken != null && m.hasOwnProperty("tcToken")) { + d.tcToken = o.bytes === String ? $util.base64.encode(m.tcToken, 0, m.tcToken.length) : o.bytes === Array ? Array.prototype.slice.call(m.tcToken) : m.tcToken; + if (o.oneofs) + d._tcToken = "tcToken"; + } + if (m.tcTokenTimestamp != null && m.hasOwnProperty("tcTokenTimestamp")) { + if (typeof m.tcTokenTimestamp === "number") + d.tcTokenTimestamp = o.longs === String ? String(m.tcTokenTimestamp) : m.tcTokenTimestamp; + else + d.tcTokenTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.tcTokenTimestamp) : o.longs === Number ? new $util.LongBits(m.tcTokenTimestamp.low >>> 0, m.tcTokenTimestamp.high >>> 0).toNumber(true) : m.tcTokenTimestamp; + if (o.oneofs) + d._tcTokenTimestamp = "tcTokenTimestamp"; + } + if (m.contactPrimaryIdentityKey != null && m.hasOwnProperty("contactPrimaryIdentityKey")) { + d.contactPrimaryIdentityKey = o.bytes === String ? $util.base64.encode(m.contactPrimaryIdentityKey, 0, m.contactPrimaryIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.contactPrimaryIdentityKey) : m.contactPrimaryIdentityKey; + if (o.oneofs) + d._contactPrimaryIdentityKey = "contactPrimaryIdentityKey"; + } + if (m.pinned != null && m.hasOwnProperty("pinned")) { + d.pinned = m.pinned; + if (o.oneofs) + d._pinned = "pinned"; + } + if (m.muteEndTime != null && m.hasOwnProperty("muteEndTime")) { + if (typeof m.muteEndTime === "number") + d.muteEndTime = o.longs === String ? String(m.muteEndTime) : m.muteEndTime; + else + d.muteEndTime = o.longs === String ? $util.Long.prototype.toString.call(m.muteEndTime) : o.longs === Number ? new $util.LongBits(m.muteEndTime.low >>> 0, m.muteEndTime.high >>> 0).toNumber(true) : m.muteEndTime; + if (o.oneofs) + d._muteEndTime = "muteEndTime"; + } + if (m.wallpaper != null && m.hasOwnProperty("wallpaper")) { + d.wallpaper = $root.proto.WallpaperSettings.toObject(m.wallpaper, o); + if (o.oneofs) + d._wallpaper = "wallpaper"; + } + if (m.mediaVisibility != null && m.hasOwnProperty("mediaVisibility")) { + d.mediaVisibility = o.enums === String ? $root.proto.MediaVisibility[m.mediaVisibility] === undefined ? m.mediaVisibility : $root.proto.MediaVisibility[m.mediaVisibility] : m.mediaVisibility; + if (o.oneofs) + d._mediaVisibility = "mediaVisibility"; + } + if (m.tcTokenSenderTimestamp != null && m.hasOwnProperty("tcTokenSenderTimestamp")) { + if (typeof m.tcTokenSenderTimestamp === "number") + d.tcTokenSenderTimestamp = o.longs === String ? String(m.tcTokenSenderTimestamp) : m.tcTokenSenderTimestamp; + else + d.tcTokenSenderTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.tcTokenSenderTimestamp) : o.longs === Number ? new $util.LongBits(m.tcTokenSenderTimestamp.low >>> 0, m.tcTokenSenderTimestamp.high >>> 0).toNumber(true) : m.tcTokenSenderTimestamp; + if (o.oneofs) + d._tcTokenSenderTimestamp = "tcTokenSenderTimestamp"; + } + if (m.suspended != null && m.hasOwnProperty("suspended")) { + d.suspended = m.suspended; + if (o.oneofs) + d._suspended = "suspended"; + } + if (m.terminated != null && m.hasOwnProperty("terminated")) { + d.terminated = m.terminated; + if (o.oneofs) + d._terminated = "terminated"; + } + if (m.createdAt != null && m.hasOwnProperty("createdAt")) { + if (typeof m.createdAt === "number") + d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt; + else + d.createdAt = o.longs === String ? $util.Long.prototype.toString.call(m.createdAt) : o.longs === Number ? new $util.LongBits(m.createdAt.low >>> 0, m.createdAt.high >>> 0).toNumber(true) : m.createdAt; + if (o.oneofs) + d._createdAt = "createdAt"; + } + if (m.createdBy != null && m.hasOwnProperty("createdBy")) { + d.createdBy = m.createdBy; + if (o.oneofs) + d._createdBy = "createdBy"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.support != null && m.hasOwnProperty("support")) { + d.support = m.support; + if (o.oneofs) + d._support = "support"; + } + if (m.isParentGroup != null && m.hasOwnProperty("isParentGroup")) { + d.isParentGroup = m.isParentGroup; + if (o.oneofs) + d._isParentGroup = "isParentGroup"; + } + if (m.isDefaultSubgroup != null && m.hasOwnProperty("isDefaultSubgroup")) { + d.isDefaultSubgroup = m.isDefaultSubgroup; + if (o.oneofs) + d._isDefaultSubgroup = "isDefaultSubgroup"; + } + if (m.parentGroupId != null && m.hasOwnProperty("parentGroupId")) { + d.parentGroupId = m.parentGroupId; + if (o.oneofs) + d._parentGroupId = "parentGroupId"; + } + if (m.displayName != null && m.hasOwnProperty("displayName")) { + d.displayName = m.displayName; + if (o.oneofs) + d._displayName = "displayName"; + } + if (m.pnJid != null && m.hasOwnProperty("pnJid")) { + d.pnJid = m.pnJid; + if (o.oneofs) + d._pnJid = "pnJid"; + } + if (m.shareOwnPn != null && m.hasOwnProperty("shareOwnPn")) { + d.shareOwnPn = m.shareOwnPn; + if (o.oneofs) + d._shareOwnPn = "shareOwnPn"; + } + if (m.pnhDuplicateLidThread != null && m.hasOwnProperty("pnhDuplicateLidThread")) { + d.pnhDuplicateLidThread = m.pnhDuplicateLidThread; + if (o.oneofs) + d._pnhDuplicateLidThread = "pnhDuplicateLidThread"; + } + if (m.lidJid != null && m.hasOwnProperty("lidJid")) { + d.lidJid = m.lidJid; + if (o.oneofs) + d._lidJid = "lidJid"; + } + if (m.username != null && m.hasOwnProperty("username")) { + d.username = m.username; + if (o.oneofs) + d._username = "username"; + } + if (m.lidOriginType != null && m.hasOwnProperty("lidOriginType")) { + d.lidOriginType = m.lidOriginType; + if (o.oneofs) + d._lidOriginType = "lidOriginType"; + } + if (m.commentsCount != null && m.hasOwnProperty("commentsCount")) { + d.commentsCount = m.commentsCount; + if (o.oneofs) + d._commentsCount = "commentsCount"; + } + if (m.locked != null && m.hasOwnProperty("locked")) { + d.locked = m.locked; + if (o.oneofs) + d._locked = "locked"; + } + if (m.systemMessageToInsert != null && m.hasOwnProperty("systemMessageToInsert")) { + d.systemMessageToInsert = o.enums === String ? $root.proto.PrivacySystemMessage[m.systemMessageToInsert] === undefined ? m.systemMessageToInsert : $root.proto.PrivacySystemMessage[m.systemMessageToInsert] : m.systemMessageToInsert; + if (o.oneofs) + d._systemMessageToInsert = "systemMessageToInsert"; + } + if (m.capiCreatedGroup != null && m.hasOwnProperty("capiCreatedGroup")) { + d.capiCreatedGroup = m.capiCreatedGroup; + if (o.oneofs) + d._capiCreatedGroup = "capiCreatedGroup"; + } + if (m.accountLid != null && m.hasOwnProperty("accountLid")) { + d.accountLid = m.accountLid; + if (o.oneofs) + d._accountLid = "accountLid"; + } + if (m.limitSharing != null && m.hasOwnProperty("limitSharing")) { + d.limitSharing = m.limitSharing; + if (o.oneofs) + d._limitSharing = "limitSharing"; + } + if (m.limitSharingSettingTimestamp != null && m.hasOwnProperty("limitSharingSettingTimestamp")) { + if (typeof m.limitSharingSettingTimestamp === "number") + d.limitSharingSettingTimestamp = o.longs === String ? String(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp; + else + d.limitSharingSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.limitSharingSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.limitSharingSettingTimestamp.low >>> 0, m.limitSharingSettingTimestamp.high >>> 0).toNumber() : m.limitSharingSettingTimestamp; + if (o.oneofs) + d._limitSharingSettingTimestamp = "limitSharingSettingTimestamp"; + } + if (m.limitSharingTrigger != null && m.hasOwnProperty("limitSharingTrigger")) { + d.limitSharingTrigger = o.enums === String ? $root.proto.LimitSharing.TriggerType[m.limitSharingTrigger] === undefined ? m.limitSharingTrigger : $root.proto.LimitSharing.TriggerType[m.limitSharingTrigger] : m.limitSharingTrigger; + if (o.oneofs) + d._limitSharingTrigger = "limitSharingTrigger"; + } + if (m.limitSharingInitiatedByMe != null && m.hasOwnProperty("limitSharingInitiatedByMe")) { + d.limitSharingInitiatedByMe = m.limitSharingInitiatedByMe; + if (o.oneofs) + d._limitSharingInitiatedByMe = "limitSharingInitiatedByMe"; + } + return d; + }; + + Conversation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9096,9 +20815,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeviceCapabilities.prototype.chatLockSupportLevel = 0; + DeviceCapabilities.prototype.chatLockSupportLevel = null; DeviceCapabilities.prototype.lidMigration = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceCapabilities.prototype, "_chatLockSupportLevel", { + get: $util.oneOfGetter($oneOfFields = ["chatLockSupportLevel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceCapabilities.prototype, "_lidMigration", { + get: $util.oneOfGetter($oneOfFields = ["lidMigration"]), + set: $util.oneOfSetter($oneOfFields) + }); + DeviceCapabilities.create = function create(properties) { return new DeviceCapabilities(properties); }; @@ -9138,6 +20871,59 @@ export const proto = $root.proto = (() => { return m; }; + DeviceCapabilities.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceCapabilities) + return d; + var m = new $root.proto.DeviceCapabilities(); + switch (d.chatLockSupportLevel) { + default: + if (typeof d.chatLockSupportLevel === "number") { + m.chatLockSupportLevel = d.chatLockSupportLevel; + break; + } + break; + case "NONE": + case 0: + m.chatLockSupportLevel = 0; + break; + case "MINIMAL": + case 1: + m.chatLockSupportLevel = 1; + break; + case "FULL": + case 2: + m.chatLockSupportLevel = 2; + break; + } + if (d.lidMigration != null) { + if (typeof d.lidMigration !== "object") + throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected"); + m.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.fromObject(d.lidMigration); + } + return m; + }; + + DeviceCapabilities.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.chatLockSupportLevel != null && m.hasOwnProperty("chatLockSupportLevel")) { + d.chatLockSupportLevel = o.enums === String ? $root.proto.DeviceCapabilities.ChatLockSupportLevel[m.chatLockSupportLevel] === undefined ? m.chatLockSupportLevel : $root.proto.DeviceCapabilities.ChatLockSupportLevel[m.chatLockSupportLevel] : m.chatLockSupportLevel; + if (o.oneofs) + d._chatLockSupportLevel = "chatLockSupportLevel"; + } + if (m.lidMigration != null && m.hasOwnProperty("lidMigration")) { + d.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.toObject(m.lidMigration, o); + if (o.oneofs) + d._lidMigration = "lidMigration"; + } + return d; + }; + + DeviceCapabilities.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeviceCapabilities.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9162,7 +20948,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LIDMigration.prototype.chatDbMigrationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LIDMigration.prototype.chatDbMigrationTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LIDMigration.prototype, "_chatDbMigrationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["chatDbMigrationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); LIDMigration.create = function create(properties) { return new LIDMigration(properties); @@ -9197,6 +20991,42 @@ export const proto = $root.proto = (() => { return m; }; + LIDMigration.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceCapabilities.LIDMigration) + return d; + var m = new $root.proto.DeviceCapabilities.LIDMigration(); + if (d.chatDbMigrationTimestamp != null) { + if ($util.Long) + (m.chatDbMigrationTimestamp = $util.Long.fromValue(d.chatDbMigrationTimestamp)).unsigned = true; + else if (typeof d.chatDbMigrationTimestamp === "string") + m.chatDbMigrationTimestamp = parseInt(d.chatDbMigrationTimestamp, 10); + else if (typeof d.chatDbMigrationTimestamp === "number") + m.chatDbMigrationTimestamp = d.chatDbMigrationTimestamp; + else if (typeof d.chatDbMigrationTimestamp === "object") + m.chatDbMigrationTimestamp = new $util.LongBits(d.chatDbMigrationTimestamp.low >>> 0, d.chatDbMigrationTimestamp.high >>> 0).toNumber(true); + } + return m; + }; + + LIDMigration.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.chatDbMigrationTimestamp != null && m.hasOwnProperty("chatDbMigrationTimestamp")) { + if (typeof m.chatDbMigrationTimestamp === "number") + d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp; + else + d.chatDbMigrationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.chatDbMigrationTimestamp) : o.longs === Number ? new $util.LongBits(m.chatDbMigrationTimestamp.low >>> 0, m.chatDbMigrationTimestamp.high >>> 0).toNumber(true) : m.chatDbMigrationTimestamp; + if (o.oneofs) + d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp"; + } + return d; + }; + + LIDMigration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LIDMigration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9219,8 +21049,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeviceConsistencyCodeMessage.prototype.generation = 0; - DeviceConsistencyCodeMessage.prototype.signature = $util.newBuffer([]); + DeviceConsistencyCodeMessage.prototype.generation = null; + DeviceConsistencyCodeMessage.prototype.signature = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceConsistencyCodeMessage.prototype, "_generation", { + get: $util.oneOfGetter($oneOfFields = ["generation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceConsistencyCodeMessage.prototype, "_signature", { + get: $util.oneOfGetter($oneOfFields = ["signature"]), + set: $util.oneOfSetter($oneOfFields) + }); DeviceConsistencyCodeMessage.create = function create(properties) { return new DeviceConsistencyCodeMessage(properties); @@ -9261,6 +21105,43 @@ export const proto = $root.proto = (() => { return m; }; + DeviceConsistencyCodeMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceConsistencyCodeMessage) + return d; + var m = new $root.proto.DeviceConsistencyCodeMessage(); + if (d.generation != null) { + m.generation = d.generation >>> 0; + } + if (d.signature != null) { + if (typeof d.signature === "string") + $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0); + else if (d.signature.length >= 0) + m.signature = d.signature; + } + return m; + }; + + DeviceConsistencyCodeMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.generation != null && m.hasOwnProperty("generation")) { + d.generation = m.generation; + if (o.oneofs) + d._generation = "generation"; + } + if (m.signature != null && m.hasOwnProperty("signature")) { + d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature; + if (o.oneofs) + d._signature = "signature"; + } + return d; + }; + + DeviceConsistencyCodeMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeviceConsistencyCodeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9282,15 +21163,53 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeviceListMetadata.prototype.senderKeyHash = $util.newBuffer([]); - DeviceListMetadata.prototype.senderTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + DeviceListMetadata.prototype.senderKeyHash = null; + DeviceListMetadata.prototype.senderTimestamp = null; DeviceListMetadata.prototype.senderKeyIndexes = $util.emptyArray; - DeviceListMetadata.prototype.senderAccountType = 0; - DeviceListMetadata.prototype.receiverAccountType = 0; - DeviceListMetadata.prototype.recipientKeyHash = $util.newBuffer([]); - DeviceListMetadata.prototype.recipientTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + DeviceListMetadata.prototype.senderAccountType = null; + DeviceListMetadata.prototype.receiverAccountType = null; + DeviceListMetadata.prototype.recipientKeyHash = null; + DeviceListMetadata.prototype.recipientTimestamp = null; DeviceListMetadata.prototype.recipientKeyIndexes = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceListMetadata.prototype, "_senderKeyHash", { + get: $util.oneOfGetter($oneOfFields = ["senderKeyHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceListMetadata.prototype, "_senderTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceListMetadata.prototype, "_senderAccountType", { + get: $util.oneOfGetter($oneOfFields = ["senderAccountType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceListMetadata.prototype, "_receiverAccountType", { + get: $util.oneOfGetter($oneOfFields = ["receiverAccountType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceListMetadata.prototype, "_recipientKeyHash", { + get: $util.oneOfGetter($oneOfFields = ["recipientKeyHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceListMetadata.prototype, "_recipientTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["recipientTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + DeviceListMetadata.create = function create(properties) { return new DeviceListMetadata(properties); }; @@ -9388,6 +21307,156 @@ export const proto = $root.proto = (() => { return m; }; + DeviceListMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceListMetadata) + return d; + var m = new $root.proto.DeviceListMetadata(); + if (d.senderKeyHash != null) { + if (typeof d.senderKeyHash === "string") + $util.base64.decode(d.senderKeyHash, m.senderKeyHash = $util.newBuffer($util.base64.length(d.senderKeyHash)), 0); + else if (d.senderKeyHash.length >= 0) + m.senderKeyHash = d.senderKeyHash; + } + if (d.senderTimestamp != null) { + if ($util.Long) + (m.senderTimestamp = $util.Long.fromValue(d.senderTimestamp)).unsigned = true; + else if (typeof d.senderTimestamp === "string") + m.senderTimestamp = parseInt(d.senderTimestamp, 10); + else if (typeof d.senderTimestamp === "number") + m.senderTimestamp = d.senderTimestamp; + else if (typeof d.senderTimestamp === "object") + m.senderTimestamp = new $util.LongBits(d.senderTimestamp.low >>> 0, d.senderTimestamp.high >>> 0).toNumber(true); + } + if (d.senderKeyIndexes) { + if (!Array.isArray(d.senderKeyIndexes)) + throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected"); + m.senderKeyIndexes = []; + for (var i = 0; i < d.senderKeyIndexes.length; ++i) { + m.senderKeyIndexes[i] = d.senderKeyIndexes[i] >>> 0; + } + } + switch (d.senderAccountType) { + default: + if (typeof d.senderAccountType === "number") { + m.senderAccountType = d.senderAccountType; + break; + } + break; + case "E2EE": + case 0: + m.senderAccountType = 0; + break; + case "HOSTED": + case 1: + m.senderAccountType = 1; + break; + } + switch (d.receiverAccountType) { + default: + if (typeof d.receiverAccountType === "number") { + m.receiverAccountType = d.receiverAccountType; + break; + } + break; + case "E2EE": + case 0: + m.receiverAccountType = 0; + break; + case "HOSTED": + case 1: + m.receiverAccountType = 1; + break; + } + if (d.recipientKeyHash != null) { + if (typeof d.recipientKeyHash === "string") + $util.base64.decode(d.recipientKeyHash, m.recipientKeyHash = $util.newBuffer($util.base64.length(d.recipientKeyHash)), 0); + else if (d.recipientKeyHash.length >= 0) + m.recipientKeyHash = d.recipientKeyHash; + } + if (d.recipientTimestamp != null) { + if ($util.Long) + (m.recipientTimestamp = $util.Long.fromValue(d.recipientTimestamp)).unsigned = true; + else if (typeof d.recipientTimestamp === "string") + m.recipientTimestamp = parseInt(d.recipientTimestamp, 10); + else if (typeof d.recipientTimestamp === "number") + m.recipientTimestamp = d.recipientTimestamp; + else if (typeof d.recipientTimestamp === "object") + m.recipientTimestamp = new $util.LongBits(d.recipientTimestamp.low >>> 0, d.recipientTimestamp.high >>> 0).toNumber(true); + } + if (d.recipientKeyIndexes) { + if (!Array.isArray(d.recipientKeyIndexes)) + throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected"); + m.recipientKeyIndexes = []; + for (var i = 0; i < d.recipientKeyIndexes.length; ++i) { + m.recipientKeyIndexes[i] = d.recipientKeyIndexes[i] >>> 0; + } + } + return m; + }; + + DeviceListMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.senderKeyIndexes = []; + d.recipientKeyIndexes = []; + } + if (m.senderKeyHash != null && m.hasOwnProperty("senderKeyHash")) { + d.senderKeyHash = o.bytes === String ? $util.base64.encode(m.senderKeyHash, 0, m.senderKeyHash.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderKeyHash) : m.senderKeyHash; + if (o.oneofs) + d._senderKeyHash = "senderKeyHash"; + } + if (m.senderTimestamp != null && m.hasOwnProperty("senderTimestamp")) { + if (typeof m.senderTimestamp === "number") + d.senderTimestamp = o.longs === String ? String(m.senderTimestamp) : m.senderTimestamp; + else + d.senderTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestamp) : o.longs === Number ? new $util.LongBits(m.senderTimestamp.low >>> 0, m.senderTimestamp.high >>> 0).toNumber(true) : m.senderTimestamp; + if (o.oneofs) + d._senderTimestamp = "senderTimestamp"; + } + if (m.senderKeyIndexes && m.senderKeyIndexes.length) { + d.senderKeyIndexes = []; + for (var j = 0; j < m.senderKeyIndexes.length; ++j) { + d.senderKeyIndexes[j] = m.senderKeyIndexes[j]; + } + } + if (m.senderAccountType != null && m.hasOwnProperty("senderAccountType")) { + d.senderAccountType = o.enums === String ? $root.proto.ADVEncryptionType[m.senderAccountType] === undefined ? m.senderAccountType : $root.proto.ADVEncryptionType[m.senderAccountType] : m.senderAccountType; + if (o.oneofs) + d._senderAccountType = "senderAccountType"; + } + if (m.receiverAccountType != null && m.hasOwnProperty("receiverAccountType")) { + d.receiverAccountType = o.enums === String ? $root.proto.ADVEncryptionType[m.receiverAccountType] === undefined ? m.receiverAccountType : $root.proto.ADVEncryptionType[m.receiverAccountType] : m.receiverAccountType; + if (o.oneofs) + d._receiverAccountType = "receiverAccountType"; + } + if (m.recipientKeyHash != null && m.hasOwnProperty("recipientKeyHash")) { + d.recipientKeyHash = o.bytes === String ? $util.base64.encode(m.recipientKeyHash, 0, m.recipientKeyHash.length) : o.bytes === Array ? Array.prototype.slice.call(m.recipientKeyHash) : m.recipientKeyHash; + if (o.oneofs) + d._recipientKeyHash = "recipientKeyHash"; + } + if (m.recipientTimestamp != null && m.hasOwnProperty("recipientTimestamp")) { + if (typeof m.recipientTimestamp === "number") + d.recipientTimestamp = o.longs === String ? String(m.recipientTimestamp) : m.recipientTimestamp; + else + d.recipientTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.recipientTimestamp) : o.longs === Number ? new $util.LongBits(m.recipientTimestamp.low >>> 0, m.recipientTimestamp.high >>> 0).toNumber(true) : m.recipientTimestamp; + if (o.oneofs) + d._recipientTimestamp = "recipientTimestamp"; + } + if (m.recipientKeyIndexes && m.recipientKeyIndexes.length) { + d.recipientKeyIndexes = []; + for (var j = 0; j < m.recipientKeyIndexes.length; ++j) { + d.recipientKeyIndexes[j] = m.recipientKeyIndexes[j]; + } + } + return d; + }; + + DeviceListMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeviceListMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9407,12 +21476,44 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeviceProps.prototype.os = ""; + DeviceProps.prototype.os = null; DeviceProps.prototype.version = null; - DeviceProps.prototype.platformType = 0; - DeviceProps.prototype.requireFullSync = false; + DeviceProps.prototype.platformType = null; + DeviceProps.prototype.requireFullSync = null; DeviceProps.prototype.historySyncConfig = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceProps.prototype, "_os", { + get: $util.oneOfGetter($oneOfFields = ["os"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceProps.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceProps.prototype, "_platformType", { + get: $util.oneOfGetter($oneOfFields = ["platformType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceProps.prototype, "_requireFullSync", { + get: $util.oneOfGetter($oneOfFields = ["requireFullSync"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceProps.prototype, "_historySyncConfig", { + get: $util.oneOfGetter($oneOfFields = ["historySyncConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + DeviceProps.create = function create(properties) { return new DeviceProps(properties); }; @@ -9470,6 +21571,173 @@ export const proto = $root.proto = (() => { return m; }; + DeviceProps.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceProps) + return d; + var m = new $root.proto.DeviceProps(); + if (d.os != null) { + m.os = String(d.os); + } + if (d.version != null) { + if (typeof d.version !== "object") + throw TypeError(".proto.DeviceProps.version: object expected"); + m.version = $root.proto.DeviceProps.AppVersion.fromObject(d.version); + } + switch (d.platformType) { + default: + if (typeof d.platformType === "number") { + m.platformType = d.platformType; + break; + } + break; + case "UNKNOWN": + case 0: + m.platformType = 0; + break; + case "CHROME": + case 1: + m.platformType = 1; + break; + case "FIREFOX": + case 2: + m.platformType = 2; + break; + case "IE": + case 3: + m.platformType = 3; + break; + case "OPERA": + case 4: + m.platformType = 4; + break; + case "SAFARI": + case 5: + m.platformType = 5; + break; + case "EDGE": + case 6: + m.platformType = 6; + break; + case "DESKTOP": + case 7: + m.platformType = 7; + break; + case "IPAD": + case 8: + m.platformType = 8; + break; + case "ANDROID_TABLET": + case 9: + m.platformType = 9; + break; + case "OHANA": + case 10: + m.platformType = 10; + break; + case "ALOHA": + case 11: + m.platformType = 11; + break; + case "CATALINA": + case 12: + m.platformType = 12; + break; + case "TCL_TV": + case 13: + m.platformType = 13; + break; + case "IOS_PHONE": + case 14: + m.platformType = 14; + break; + case "IOS_CATALYST": + case 15: + m.platformType = 15; + break; + case "ANDROID_PHONE": + case 16: + m.platformType = 16; + break; + case "ANDROID_AMBIGUOUS": + case 17: + m.platformType = 17; + break; + case "WEAR_OS": + case 18: + m.platformType = 18; + break; + case "AR_WRIST": + case 19: + m.platformType = 19; + break; + case "AR_DEVICE": + case 20: + m.platformType = 20; + break; + case "UWP": + case 21: + m.platformType = 21; + break; + case "VR": + case 22: + m.platformType = 22; + break; + case "CLOUD_API": + case 23: + m.platformType = 23; + break; + case "SMARTGLASSES": + case 24: + m.platformType = 24; + break; + } + if (d.requireFullSync != null) { + m.requireFullSync = Boolean(d.requireFullSync); + } + if (d.historySyncConfig != null) { + if (typeof d.historySyncConfig !== "object") + throw TypeError(".proto.DeviceProps.historySyncConfig: object expected"); + m.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.fromObject(d.historySyncConfig); + } + return m; + }; + + DeviceProps.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.os != null && m.hasOwnProperty("os")) { + d.os = m.os; + if (o.oneofs) + d._os = "os"; + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = $root.proto.DeviceProps.AppVersion.toObject(m.version, o); + if (o.oneofs) + d._version = "version"; + } + if (m.platformType != null && m.hasOwnProperty("platformType")) { + d.platformType = o.enums === String ? $root.proto.DeviceProps.PlatformType[m.platformType] === undefined ? m.platformType : $root.proto.DeviceProps.PlatformType[m.platformType] : m.platformType; + if (o.oneofs) + d._platformType = "platformType"; + } + if (m.requireFullSync != null && m.hasOwnProperty("requireFullSync")) { + d.requireFullSync = m.requireFullSync; + if (o.oneofs) + d._requireFullSync = "requireFullSync"; + } + if (m.historySyncConfig != null && m.hasOwnProperty("historySyncConfig")) { + d.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.toObject(m.historySyncConfig, o); + if (o.oneofs) + d._historySyncConfig = "historySyncConfig"; + } + return d; + }; + + DeviceProps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeviceProps.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9486,11 +21754,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AppVersion.prototype.primary = 0; - AppVersion.prototype.secondary = 0; - AppVersion.prototype.tertiary = 0; - AppVersion.prototype.quaternary = 0; - AppVersion.prototype.quinary = 0; + AppVersion.prototype.primary = null; + AppVersion.prototype.secondary = null; + AppVersion.prototype.tertiary = null; + AppVersion.prototype.quaternary = null; + AppVersion.prototype.quinary = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_primary", { + get: $util.oneOfGetter($oneOfFields = ["primary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_secondary", { + get: $util.oneOfGetter($oneOfFields = ["secondary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_tertiary", { + get: $util.oneOfGetter($oneOfFields = ["tertiary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_quaternary", { + get: $util.oneOfGetter($oneOfFields = ["quaternary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppVersion.prototype, "_quinary", { + get: $util.oneOfGetter($oneOfFields = ["quinary"]), + set: $util.oneOfSetter($oneOfFields) + }); AppVersion.create = function create(properties) { return new AppVersion(properties); @@ -9549,6 +21849,64 @@ export const proto = $root.proto = (() => { return m; }; + AppVersion.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceProps.AppVersion) + return d; + var m = new $root.proto.DeviceProps.AppVersion(); + if (d.primary != null) { + m.primary = d.primary >>> 0; + } + if (d.secondary != null) { + m.secondary = d.secondary >>> 0; + } + if (d.tertiary != null) { + m.tertiary = d.tertiary >>> 0; + } + if (d.quaternary != null) { + m.quaternary = d.quaternary >>> 0; + } + if (d.quinary != null) { + m.quinary = d.quinary >>> 0; + } + return m; + }; + + AppVersion.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.primary != null && m.hasOwnProperty("primary")) { + d.primary = m.primary; + if (o.oneofs) + d._primary = "primary"; + } + if (m.secondary != null && m.hasOwnProperty("secondary")) { + d.secondary = m.secondary; + if (o.oneofs) + d._secondary = "secondary"; + } + if (m.tertiary != null && m.hasOwnProperty("tertiary")) { + d.tertiary = m.tertiary; + if (o.oneofs) + d._tertiary = "tertiary"; + } + if (m.quaternary != null && m.hasOwnProperty("quaternary")) { + d.quaternary = m.quaternary; + if (o.oneofs) + d._quaternary = "quaternary"; + } + if (m.quinary != null && m.hasOwnProperty("quinary")) { + d.quinary = m.quinary; + if (o.oneofs) + d._quinary = "quinary"; + } + return d; + }; + + AppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9568,20 +21926,106 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HistorySyncConfig.prototype.fullSyncDaysLimit = 0; - HistorySyncConfig.prototype.fullSyncSizeMbLimit = 0; - HistorySyncConfig.prototype.storageQuotaMb = 0; - HistorySyncConfig.prototype.inlineInitialPayloadInE2EeMsg = false; - HistorySyncConfig.prototype.recentSyncDaysLimit = 0; - HistorySyncConfig.prototype.supportCallLogHistory = false; - HistorySyncConfig.prototype.supportBotUserAgentChatHistory = false; - HistorySyncConfig.prototype.supportCagReactionsAndPolls = false; - HistorySyncConfig.prototype.supportBizHostedMsg = false; - HistorySyncConfig.prototype.supportRecentSyncChunkMessageCountTuning = false; - HistorySyncConfig.prototype.supportHostedGroupMsg = false; - HistorySyncConfig.prototype.supportFbidBotChatHistory = false; - HistorySyncConfig.prototype.supportAddOnHistorySyncMigration = false; - HistorySyncConfig.prototype.supportMessageAssociation = false; + HistorySyncConfig.prototype.fullSyncDaysLimit = null; + HistorySyncConfig.prototype.fullSyncSizeMbLimit = null; + HistorySyncConfig.prototype.storageQuotaMb = null; + HistorySyncConfig.prototype.inlineInitialPayloadInE2EeMsg = null; + HistorySyncConfig.prototype.recentSyncDaysLimit = null; + HistorySyncConfig.prototype.supportCallLogHistory = null; + HistorySyncConfig.prototype.supportBotUserAgentChatHistory = null; + HistorySyncConfig.prototype.supportCagReactionsAndPolls = null; + HistorySyncConfig.prototype.supportBizHostedMsg = null; + HistorySyncConfig.prototype.supportRecentSyncChunkMessageCountTuning = null; + HistorySyncConfig.prototype.supportHostedGroupMsg = null; + HistorySyncConfig.prototype.supportFbidBotChatHistory = null; + HistorySyncConfig.prototype.supportAddOnHistorySyncMigration = null; + HistorySyncConfig.prototype.supportMessageAssociation = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_fullSyncDaysLimit", { + get: $util.oneOfGetter($oneOfFields = ["fullSyncDaysLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_fullSyncSizeMbLimit", { + get: $util.oneOfGetter($oneOfFields = ["fullSyncSizeMbLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_storageQuotaMb", { + get: $util.oneOfGetter($oneOfFields = ["storageQuotaMb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_inlineInitialPayloadInE2EeMsg", { + get: $util.oneOfGetter($oneOfFields = ["inlineInitialPayloadInE2EeMsg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_recentSyncDaysLimit", { + get: $util.oneOfGetter($oneOfFields = ["recentSyncDaysLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportCallLogHistory", { + get: $util.oneOfGetter($oneOfFields = ["supportCallLogHistory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportBotUserAgentChatHistory", { + get: $util.oneOfGetter($oneOfFields = ["supportBotUserAgentChatHistory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportCagReactionsAndPolls", { + get: $util.oneOfGetter($oneOfFields = ["supportCagReactionsAndPolls"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportBizHostedMsg", { + get: $util.oneOfGetter($oneOfFields = ["supportBizHostedMsg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportRecentSyncChunkMessageCountTuning", { + get: $util.oneOfGetter($oneOfFields = ["supportRecentSyncChunkMessageCountTuning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportHostedGroupMsg", { + get: $util.oneOfGetter($oneOfFields = ["supportHostedGroupMsg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportFbidBotChatHistory", { + get: $util.oneOfGetter($oneOfFields = ["supportFbidBotChatHistory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportAddOnHistorySyncMigration", { + get: $util.oneOfGetter($oneOfFields = ["supportAddOnHistorySyncMigration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncConfig.prototype, "_supportMessageAssociation", { + get: $util.oneOfGetter($oneOfFields = ["supportMessageAssociation"]), + set: $util.oneOfSetter($oneOfFields) + }); HistorySyncConfig.create = function create(properties) { return new HistorySyncConfig(properties); @@ -9694,6 +22138,136 @@ export const proto = $root.proto = (() => { return m; }; + HistorySyncConfig.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DeviceProps.HistorySyncConfig) + return d; + var m = new $root.proto.DeviceProps.HistorySyncConfig(); + if (d.fullSyncDaysLimit != null) { + m.fullSyncDaysLimit = d.fullSyncDaysLimit >>> 0; + } + if (d.fullSyncSizeMbLimit != null) { + m.fullSyncSizeMbLimit = d.fullSyncSizeMbLimit >>> 0; + } + if (d.storageQuotaMb != null) { + m.storageQuotaMb = d.storageQuotaMb >>> 0; + } + if (d.inlineInitialPayloadInE2EeMsg != null) { + m.inlineInitialPayloadInE2EeMsg = Boolean(d.inlineInitialPayloadInE2EeMsg); + } + if (d.recentSyncDaysLimit != null) { + m.recentSyncDaysLimit = d.recentSyncDaysLimit >>> 0; + } + if (d.supportCallLogHistory != null) { + m.supportCallLogHistory = Boolean(d.supportCallLogHistory); + } + if (d.supportBotUserAgentChatHistory != null) { + m.supportBotUserAgentChatHistory = Boolean(d.supportBotUserAgentChatHistory); + } + if (d.supportCagReactionsAndPolls != null) { + m.supportCagReactionsAndPolls = Boolean(d.supportCagReactionsAndPolls); + } + if (d.supportBizHostedMsg != null) { + m.supportBizHostedMsg = Boolean(d.supportBizHostedMsg); + } + if (d.supportRecentSyncChunkMessageCountTuning != null) { + m.supportRecentSyncChunkMessageCountTuning = Boolean(d.supportRecentSyncChunkMessageCountTuning); + } + if (d.supportHostedGroupMsg != null) { + m.supportHostedGroupMsg = Boolean(d.supportHostedGroupMsg); + } + if (d.supportFbidBotChatHistory != null) { + m.supportFbidBotChatHistory = Boolean(d.supportFbidBotChatHistory); + } + if (d.supportAddOnHistorySyncMigration != null) { + m.supportAddOnHistorySyncMigration = Boolean(d.supportAddOnHistorySyncMigration); + } + if (d.supportMessageAssociation != null) { + m.supportMessageAssociation = Boolean(d.supportMessageAssociation); + } + return m; + }; + + HistorySyncConfig.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fullSyncDaysLimit != null && m.hasOwnProperty("fullSyncDaysLimit")) { + d.fullSyncDaysLimit = m.fullSyncDaysLimit; + if (o.oneofs) + d._fullSyncDaysLimit = "fullSyncDaysLimit"; + } + if (m.fullSyncSizeMbLimit != null && m.hasOwnProperty("fullSyncSizeMbLimit")) { + d.fullSyncSizeMbLimit = m.fullSyncSizeMbLimit; + if (o.oneofs) + d._fullSyncSizeMbLimit = "fullSyncSizeMbLimit"; + } + if (m.storageQuotaMb != null && m.hasOwnProperty("storageQuotaMb")) { + d.storageQuotaMb = m.storageQuotaMb; + if (o.oneofs) + d._storageQuotaMb = "storageQuotaMb"; + } + if (m.inlineInitialPayloadInE2EeMsg != null && m.hasOwnProperty("inlineInitialPayloadInE2EeMsg")) { + d.inlineInitialPayloadInE2EeMsg = m.inlineInitialPayloadInE2EeMsg; + if (o.oneofs) + d._inlineInitialPayloadInE2EeMsg = "inlineInitialPayloadInE2EeMsg"; + } + if (m.recentSyncDaysLimit != null && m.hasOwnProperty("recentSyncDaysLimit")) { + d.recentSyncDaysLimit = m.recentSyncDaysLimit; + if (o.oneofs) + d._recentSyncDaysLimit = "recentSyncDaysLimit"; + } + if (m.supportCallLogHistory != null && m.hasOwnProperty("supportCallLogHistory")) { + d.supportCallLogHistory = m.supportCallLogHistory; + if (o.oneofs) + d._supportCallLogHistory = "supportCallLogHistory"; + } + if (m.supportBotUserAgentChatHistory != null && m.hasOwnProperty("supportBotUserAgentChatHistory")) { + d.supportBotUserAgentChatHistory = m.supportBotUserAgentChatHistory; + if (o.oneofs) + d._supportBotUserAgentChatHistory = "supportBotUserAgentChatHistory"; + } + if (m.supportCagReactionsAndPolls != null && m.hasOwnProperty("supportCagReactionsAndPolls")) { + d.supportCagReactionsAndPolls = m.supportCagReactionsAndPolls; + if (o.oneofs) + d._supportCagReactionsAndPolls = "supportCagReactionsAndPolls"; + } + if (m.supportBizHostedMsg != null && m.hasOwnProperty("supportBizHostedMsg")) { + d.supportBizHostedMsg = m.supportBizHostedMsg; + if (o.oneofs) + d._supportBizHostedMsg = "supportBizHostedMsg"; + } + if (m.supportRecentSyncChunkMessageCountTuning != null && m.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")) { + d.supportRecentSyncChunkMessageCountTuning = m.supportRecentSyncChunkMessageCountTuning; + if (o.oneofs) + d._supportRecentSyncChunkMessageCountTuning = "supportRecentSyncChunkMessageCountTuning"; + } + if (m.supportHostedGroupMsg != null && m.hasOwnProperty("supportHostedGroupMsg")) { + d.supportHostedGroupMsg = m.supportHostedGroupMsg; + if (o.oneofs) + d._supportHostedGroupMsg = "supportHostedGroupMsg"; + } + if (m.supportFbidBotChatHistory != null && m.hasOwnProperty("supportFbidBotChatHistory")) { + d.supportFbidBotChatHistory = m.supportFbidBotChatHistory; + if (o.oneofs) + d._supportFbidBotChatHistory = "supportFbidBotChatHistory"; + } + if (m.supportAddOnHistorySyncMigration != null && m.hasOwnProperty("supportAddOnHistorySyncMigration")) { + d.supportAddOnHistorySyncMigration = m.supportAddOnHistorySyncMigration; + if (o.oneofs) + d._supportAddOnHistorySyncMigration = "supportAddOnHistorySyncMigration"; + } + if (m.supportMessageAssociation != null && m.hasOwnProperty("supportMessageAssociation")) { + d.supportMessageAssociation = m.supportMessageAssociation; + if (o.oneofs) + d._supportMessageAssociation = "supportMessageAssociation"; + } + return d; + }; + + HistorySyncConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HistorySyncConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9746,10 +22320,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DisappearingMode.prototype.initiator = 0; - DisappearingMode.prototype.trigger = 0; - DisappearingMode.prototype.initiatorDeviceJid = ""; - DisappearingMode.prototype.initiatedByMe = false; + DisappearingMode.prototype.initiator = null; + DisappearingMode.prototype.trigger = null; + DisappearingMode.prototype.initiatorDeviceJid = null; + DisappearingMode.prototype.initiatedByMe = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DisappearingMode.prototype, "_initiator", { + get: $util.oneOfGetter($oneOfFields = ["initiator"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DisappearingMode.prototype, "_trigger", { + get: $util.oneOfGetter($oneOfFields = ["trigger"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DisappearingMode.prototype, "_initiatorDeviceJid", { + get: $util.oneOfGetter($oneOfFields = ["initiatorDeviceJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DisappearingMode.prototype, "_initiatedByMe", { + get: $util.oneOfGetter($oneOfFields = ["initiatedByMe"]), + set: $util.oneOfSetter($oneOfFields) + }); DisappearingMode.create = function create(properties) { return new DisappearingMode(properties); @@ -9802,6 +22402,106 @@ export const proto = $root.proto = (() => { return m; }; + DisappearingMode.fromObject = function fromObject(d) { + if (d instanceof $root.proto.DisappearingMode) + return d; + var m = new $root.proto.DisappearingMode(); + switch (d.initiator) { + default: + if (typeof d.initiator === "number") { + m.initiator = d.initiator; + break; + } + break; + case "CHANGED_IN_CHAT": + case 0: + m.initiator = 0; + break; + case "INITIATED_BY_ME": + case 1: + m.initiator = 1; + break; + case "INITIATED_BY_OTHER": + case 2: + m.initiator = 2; + break; + case "BIZ_UPGRADE_FB_HOSTING": + case 3: + m.initiator = 3; + break; + } + switch (d.trigger) { + default: + if (typeof d.trigger === "number") { + m.trigger = d.trigger; + break; + } + break; + case "UNKNOWN": + case 0: + m.trigger = 0; + break; + case "CHAT_SETTING": + case 1: + m.trigger = 1; + break; + case "ACCOUNT_SETTING": + case 2: + m.trigger = 2; + break; + case "BULK_CHANGE": + case 3: + m.trigger = 3; + break; + case "BIZ_SUPPORTS_FB_HOSTING": + case 4: + m.trigger = 4; + break; + case "UNKNOWN_GROUPS": + case 5: + m.trigger = 5; + break; + } + if (d.initiatorDeviceJid != null) { + m.initiatorDeviceJid = String(d.initiatorDeviceJid); + } + if (d.initiatedByMe != null) { + m.initiatedByMe = Boolean(d.initiatedByMe); + } + return m; + }; + + DisappearingMode.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.initiator != null && m.hasOwnProperty("initiator")) { + d.initiator = o.enums === String ? $root.proto.DisappearingMode.Initiator[m.initiator] === undefined ? m.initiator : $root.proto.DisappearingMode.Initiator[m.initiator] : m.initiator; + if (o.oneofs) + d._initiator = "initiator"; + } + if (m.trigger != null && m.hasOwnProperty("trigger")) { + d.trigger = o.enums === String ? $root.proto.DisappearingMode.Trigger[m.trigger] === undefined ? m.trigger : $root.proto.DisappearingMode.Trigger[m.trigger] : m.trigger; + if (o.oneofs) + d._trigger = "trigger"; + } + if (m.initiatorDeviceJid != null && m.hasOwnProperty("initiatorDeviceJid")) { + d.initiatorDeviceJid = m.initiatorDeviceJid; + if (o.oneofs) + d._initiatorDeviceJid = "initiatorDeviceJid"; + } + if (m.initiatedByMe != null && m.hasOwnProperty("initiatedByMe")) { + d.initiatedByMe = m.initiatedByMe; + if (o.oneofs) + d._initiatedByMe = "initiatedByMe"; + } + return d; + }; + + DisappearingMode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DisappearingMode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9890,6 +22590,44 @@ export const proto = $root.proto = (() => { return m; }; + EmbeddedContent.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EmbeddedContent) + return d; + var m = new $root.proto.EmbeddedContent(); + if (d.embeddedMessage != null) { + if (typeof d.embeddedMessage !== "object") + throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected"); + m.embeddedMessage = $root.proto.EmbeddedMessage.fromObject(d.embeddedMessage); + } + if (d.embeddedMusic != null) { + if (typeof d.embeddedMusic !== "object") + throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected"); + m.embeddedMusic = $root.proto.EmbeddedMusic.fromObject(d.embeddedMusic); + } + return m; + }; + + EmbeddedContent.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.embeddedMessage != null && m.hasOwnProperty("embeddedMessage")) { + d.embeddedMessage = $root.proto.EmbeddedMessage.toObject(m.embeddedMessage, o); + if (o.oneofs) + d.content = "embeddedMessage"; + } + if (m.embeddedMusic != null && m.hasOwnProperty("embeddedMusic")) { + d.embeddedMusic = $root.proto.EmbeddedMusic.toObject(m.embeddedMusic, o); + if (o.oneofs) + d.content = "embeddedMusic"; + } + return d; + }; + + EmbeddedContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EmbeddedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9909,9 +22647,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EmbeddedMessage.prototype.stanzaId = ""; + EmbeddedMessage.prototype.stanzaId = null; EmbeddedMessage.prototype.message = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMessage.prototype, "_stanzaId", { + get: $util.oneOfGetter($oneOfFields = ["stanzaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMessage.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + EmbeddedMessage.create = function create(properties) { return new EmbeddedMessage(properties); }; @@ -9951,6 +22703,42 @@ export const proto = $root.proto = (() => { return m; }; + EmbeddedMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EmbeddedMessage) + return d; + var m = new $root.proto.EmbeddedMessage(); + if (d.stanzaId != null) { + m.stanzaId = String(d.stanzaId); + } + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.EmbeddedMessage.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + return m; + }; + + EmbeddedMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) { + d.stanzaId = m.stanzaId; + if (o.oneofs) + d._stanzaId = "stanzaId"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + return d; + }; + + EmbeddedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EmbeddedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -9970,17 +22758,85 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EmbeddedMusic.prototype.musicContentMediaId = ""; - EmbeddedMusic.prototype.songId = ""; - EmbeddedMusic.prototype.author = ""; - EmbeddedMusic.prototype.title = ""; - EmbeddedMusic.prototype.artworkDirectPath = ""; - EmbeddedMusic.prototype.artworkSha256 = $util.newBuffer([]); - EmbeddedMusic.prototype.artworkEncSha256 = $util.newBuffer([]); - EmbeddedMusic.prototype.artworkMediaKey = $util.newBuffer([]); - EmbeddedMusic.prototype.artistAttribution = ""; - EmbeddedMusic.prototype.countryBlocklist = $util.newBuffer([]); - EmbeddedMusic.prototype.isExplicit = false; + EmbeddedMusic.prototype.musicContentMediaId = null; + EmbeddedMusic.prototype.songId = null; + EmbeddedMusic.prototype.author = null; + EmbeddedMusic.prototype.title = null; + EmbeddedMusic.prototype.artworkDirectPath = null; + EmbeddedMusic.prototype.artworkSha256 = null; + EmbeddedMusic.prototype.artworkEncSha256 = null; + EmbeddedMusic.prototype.artworkMediaKey = null; + EmbeddedMusic.prototype.artistAttribution = null; + EmbeddedMusic.prototype.countryBlocklist = null; + EmbeddedMusic.prototype.isExplicit = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_musicContentMediaId", { + get: $util.oneOfGetter($oneOfFields = ["musicContentMediaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_songId", { + get: $util.oneOfGetter($oneOfFields = ["songId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_author", { + get: $util.oneOfGetter($oneOfFields = ["author"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_artworkDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["artworkDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_artworkSha256", { + get: $util.oneOfGetter($oneOfFields = ["artworkSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_artworkEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["artworkEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_artworkMediaKey", { + get: $util.oneOfGetter($oneOfFields = ["artworkMediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_artistAttribution", { + get: $util.oneOfGetter($oneOfFields = ["artistAttribution"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_countryBlocklist", { + get: $util.oneOfGetter($oneOfFields = ["countryBlocklist"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EmbeddedMusic.prototype, "_isExplicit", { + get: $util.oneOfGetter($oneOfFields = ["isExplicit"]), + set: $util.oneOfSetter($oneOfFields) + }); EmbeddedMusic.create = function create(properties) { return new EmbeddedMusic(properties); @@ -10075,6 +22931,124 @@ export const proto = $root.proto = (() => { return m; }; + EmbeddedMusic.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EmbeddedMusic) + return d; + var m = new $root.proto.EmbeddedMusic(); + if (d.musicContentMediaId != null) { + m.musicContentMediaId = String(d.musicContentMediaId); + } + if (d.songId != null) { + m.songId = String(d.songId); + } + if (d.author != null) { + m.author = String(d.author); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.artworkDirectPath != null) { + m.artworkDirectPath = String(d.artworkDirectPath); + } + if (d.artworkSha256 != null) { + if (typeof d.artworkSha256 === "string") + $util.base64.decode(d.artworkSha256, m.artworkSha256 = $util.newBuffer($util.base64.length(d.artworkSha256)), 0); + else if (d.artworkSha256.length >= 0) + m.artworkSha256 = d.artworkSha256; + } + if (d.artworkEncSha256 != null) { + if (typeof d.artworkEncSha256 === "string") + $util.base64.decode(d.artworkEncSha256, m.artworkEncSha256 = $util.newBuffer($util.base64.length(d.artworkEncSha256)), 0); + else if (d.artworkEncSha256.length >= 0) + m.artworkEncSha256 = d.artworkEncSha256; + } + if (d.artworkMediaKey != null) { + if (typeof d.artworkMediaKey === "string") + $util.base64.decode(d.artworkMediaKey, m.artworkMediaKey = $util.newBuffer($util.base64.length(d.artworkMediaKey)), 0); + else if (d.artworkMediaKey.length >= 0) + m.artworkMediaKey = d.artworkMediaKey; + } + if (d.artistAttribution != null) { + m.artistAttribution = String(d.artistAttribution); + } + if (d.countryBlocklist != null) { + if (typeof d.countryBlocklist === "string") + $util.base64.decode(d.countryBlocklist, m.countryBlocklist = $util.newBuffer($util.base64.length(d.countryBlocklist)), 0); + else if (d.countryBlocklist.length >= 0) + m.countryBlocklist = d.countryBlocklist; + } + if (d.isExplicit != null) { + m.isExplicit = Boolean(d.isExplicit); + } + return m; + }; + + EmbeddedMusic.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.musicContentMediaId != null && m.hasOwnProperty("musicContentMediaId")) { + d.musicContentMediaId = m.musicContentMediaId; + if (o.oneofs) + d._musicContentMediaId = "musicContentMediaId"; + } + if (m.songId != null && m.hasOwnProperty("songId")) { + d.songId = m.songId; + if (o.oneofs) + d._songId = "songId"; + } + if (m.author != null && m.hasOwnProperty("author")) { + d.author = m.author; + if (o.oneofs) + d._author = "author"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.artworkDirectPath != null && m.hasOwnProperty("artworkDirectPath")) { + d.artworkDirectPath = m.artworkDirectPath; + if (o.oneofs) + d._artworkDirectPath = "artworkDirectPath"; + } + if (m.artworkSha256 != null && m.hasOwnProperty("artworkSha256")) { + d.artworkSha256 = o.bytes === String ? $util.base64.encode(m.artworkSha256, 0, m.artworkSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.artworkSha256) : m.artworkSha256; + if (o.oneofs) + d._artworkSha256 = "artworkSha256"; + } + if (m.artworkEncSha256 != null && m.hasOwnProperty("artworkEncSha256")) { + d.artworkEncSha256 = o.bytes === String ? $util.base64.encode(m.artworkEncSha256, 0, m.artworkEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.artworkEncSha256) : m.artworkEncSha256; + if (o.oneofs) + d._artworkEncSha256 = "artworkEncSha256"; + } + if (m.artistAttribution != null && m.hasOwnProperty("artistAttribution")) { + d.artistAttribution = m.artistAttribution; + if (o.oneofs) + d._artistAttribution = "artistAttribution"; + } + if (m.countryBlocklist != null && m.hasOwnProperty("countryBlocklist")) { + d.countryBlocklist = o.bytes === String ? $util.base64.encode(m.countryBlocklist, 0, m.countryBlocklist.length) : o.bytes === Array ? Array.prototype.slice.call(m.countryBlocklist) : m.countryBlocklist; + if (o.oneofs) + d._countryBlocklist = "countryBlocklist"; + } + if (m.isExplicit != null && m.hasOwnProperty("isExplicit")) { + d.isExplicit = m.isExplicit; + if (o.oneofs) + d._isExplicit = "isExplicit"; + } + if (m.artworkMediaKey != null && m.hasOwnProperty("artworkMediaKey")) { + d.artworkMediaKey = o.bytes === String ? $util.base64.encode(m.artworkMediaKey, 0, m.artworkMediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.artworkMediaKey) : m.artworkMediaKey; + if (o.oneofs) + d._artworkMediaKey = "artworkMediaKey"; + } + return d; + }; + + EmbeddedMusic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EmbeddedMusic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10094,8 +23068,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EncryptedPairingRequest.prototype.encryptedPayload = $util.newBuffer([]); - EncryptedPairingRequest.prototype.iv = $util.newBuffer([]); + EncryptedPairingRequest.prototype.encryptedPayload = null; + EncryptedPairingRequest.prototype.iv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncryptedPairingRequest.prototype, "_encryptedPayload", { + get: $util.oneOfGetter($oneOfFields = ["encryptedPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncryptedPairingRequest.prototype, "_iv", { + get: $util.oneOfGetter($oneOfFields = ["iv"]), + set: $util.oneOfSetter($oneOfFields) + }); EncryptedPairingRequest.create = function create(properties) { return new EncryptedPairingRequest(properties); @@ -10136,6 +23124,46 @@ export const proto = $root.proto = (() => { return m; }; + EncryptedPairingRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EncryptedPairingRequest) + return d; + var m = new $root.proto.EncryptedPairingRequest(); + if (d.encryptedPayload != null) { + if (typeof d.encryptedPayload === "string") + $util.base64.decode(d.encryptedPayload, m.encryptedPayload = $util.newBuffer($util.base64.length(d.encryptedPayload)), 0); + else if (d.encryptedPayload.length >= 0) + m.encryptedPayload = d.encryptedPayload; + } + if (d.iv != null) { + if (typeof d.iv === "string") + $util.base64.decode(d.iv, m.iv = $util.newBuffer($util.base64.length(d.iv)), 0); + else if (d.iv.length >= 0) + m.iv = d.iv; + } + return m; + }; + + EncryptedPairingRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.encryptedPayload != null && m.hasOwnProperty("encryptedPayload")) { + d.encryptedPayload = o.bytes === String ? $util.base64.encode(m.encryptedPayload, 0, m.encryptedPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encryptedPayload) : m.encryptedPayload; + if (o.oneofs) + d._encryptedPayload = "encryptedPayload"; + } + if (m.iv != null && m.hasOwnProperty("iv")) { + d.iv = o.bytes === String ? $util.base64.encode(m.iv, 0, m.iv.length) : o.bytes === Array ? Array.prototype.slice.call(m.iv) : m.iv; + if (o.oneofs) + d._iv = "iv"; + } + return d; + }; + + EncryptedPairingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EncryptedPairingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10155,8 +23183,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EphemeralSetting.prototype.duration = 0; - EphemeralSetting.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + EphemeralSetting.prototype.duration = null; + EphemeralSetting.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EphemeralSetting.prototype, "_duration", { + get: $util.oneOfGetter($oneOfFields = ["duration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EphemeralSetting.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); EphemeralSetting.create = function create(properties) { return new EphemeralSetting(properties); @@ -10197,6 +23239,50 @@ export const proto = $root.proto = (() => { return m; }; + EphemeralSetting.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EphemeralSetting) + return d; + var m = new $root.proto.EphemeralSetting(); + if (d.duration != null) { + m.duration = d.duration | 0; + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + EphemeralSetting.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.duration != null && m.hasOwnProperty("duration")) { + d.duration = m.duration; + if (o.oneofs) + d._duration = "duration"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + EphemeralSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EphemeralSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10216,7 +23302,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EventAdditionalMetadata.prototype.isStale = false; + EventAdditionalMetadata.prototype.isStale = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventAdditionalMetadata.prototype, "_isStale", { + get: $util.oneOfGetter($oneOfFields = ["isStale"]), + set: $util.oneOfSetter($oneOfFields) + }); EventAdditionalMetadata.create = function create(properties) { return new EventAdditionalMetadata(properties); @@ -10251,6 +23345,32 @@ export const proto = $root.proto = (() => { return m; }; + EventAdditionalMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EventAdditionalMetadata) + return d; + var m = new $root.proto.EventAdditionalMetadata(); + if (d.isStale != null) { + m.isStale = Boolean(d.isStale); + } + return m; + }; + + EventAdditionalMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isStale != null && m.hasOwnProperty("isStale")) { + d.isStale = m.isStale; + if (o.oneofs) + d._isStale = "isStale"; + } + return d; + }; + + EventAdditionalMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EventAdditionalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10271,9 +23391,35 @@ export const proto = $root.proto = (() => { } EventResponse.prototype.eventResponseMessageKey = null; - EventResponse.prototype.timestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + EventResponse.prototype.timestampMs = null; EventResponse.prototype.eventResponseMessage = null; - EventResponse.prototype.unread = false; + EventResponse.prototype.unread = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponse.prototype, "_eventResponseMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["eventResponseMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponse.prototype, "_timestampMs", { + get: $util.oneOfGetter($oneOfFields = ["timestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponse.prototype, "_eventResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["eventResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponse.prototype, "_unread", { + get: $util.oneOfGetter($oneOfFields = ["unread"]), + set: $util.oneOfSetter($oneOfFields) + }); EventResponse.create = function create(properties) { return new EventResponse(properties); @@ -10326,6 +23472,70 @@ export const proto = $root.proto = (() => { return m; }; + EventResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.EventResponse) + return d; + var m = new $root.proto.EventResponse(); + if (d.eventResponseMessageKey != null) { + if (typeof d.eventResponseMessageKey !== "object") + throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected"); + m.eventResponseMessageKey = $root.proto.MessageKey.fromObject(d.eventResponseMessageKey); + } + if (d.timestampMs != null) { + if ($util.Long) + (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false; + else if (typeof d.timestampMs === "string") + m.timestampMs = parseInt(d.timestampMs, 10); + else if (typeof d.timestampMs === "number") + m.timestampMs = d.timestampMs; + else if (typeof d.timestampMs === "object") + m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber(); + } + if (d.eventResponseMessage != null) { + if (typeof d.eventResponseMessage !== "object") + throw TypeError(".proto.EventResponse.eventResponseMessage: object expected"); + m.eventResponseMessage = $root.proto.Message.EventResponseMessage.fromObject(d.eventResponseMessage); + } + if (d.unread != null) { + m.unread = Boolean(d.unread); + } + return m; + }; + + EventResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.eventResponseMessageKey != null && m.hasOwnProperty("eventResponseMessageKey")) { + d.eventResponseMessageKey = $root.proto.MessageKey.toObject(m.eventResponseMessageKey, o); + if (o.oneofs) + d._eventResponseMessageKey = "eventResponseMessageKey"; + } + if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) { + if (typeof m.timestampMs === "number") + d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; + else + d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + if (o.oneofs) + d._timestampMs = "timestampMs"; + } + if (m.eventResponseMessage != null && m.hasOwnProperty("eventResponseMessage")) { + d.eventResponseMessage = $root.proto.Message.EventResponseMessage.toObject(m.eventResponseMessage, o); + if (o.oneofs) + d._eventResponseMessage = "eventResponseMessage"; + } + if (m.unread != null && m.hasOwnProperty("unread")) { + d.unread = m.unread; + if (o.oneofs) + d._unread = "unread"; + } + return d; + }; + + EventResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EventResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10345,8 +23555,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ExitCode.prototype.code = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ExitCode.prototype.text = ""; + ExitCode.prototype.code = null; + ExitCode.prototype.text = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExitCode.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExitCode.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); ExitCode.create = function create(properties) { return new ExitCode(properties); @@ -10387,6 +23611,50 @@ export const proto = $root.proto = (() => { return m; }; + ExitCode.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ExitCode) + return d; + var m = new $root.proto.ExitCode(); + if (d.code != null) { + if ($util.Long) + (m.code = $util.Long.fromValue(d.code)).unsigned = true; + else if (typeof d.code === "string") + m.code = parseInt(d.code, 10); + else if (typeof d.code === "number") + m.code = d.code; + else if (typeof d.code === "object") + m.code = new $util.LongBits(d.code.low >>> 0, d.code.high >>> 0).toNumber(true); + } + if (d.text != null) { + m.text = String(d.text); + } + return m; + }; + + ExitCode.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.code != null && m.hasOwnProperty("code")) { + if (typeof m.code === "number") + d.code = o.longs === String ? String(m.code) : m.code; + else + d.code = o.longs === String ? $util.Long.prototype.toString.call(m.code) : o.longs === Number ? new $util.LongBits(m.code.low >>> 0, m.code.high >>> 0).toNumber(true) : m.code; + if (o.oneofs) + d._code = "code"; + } + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + return d; + }; + + ExitCode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExitCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10406,12 +23674,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ExternalBlobReference.prototype.mediaKey = $util.newBuffer([]); - ExternalBlobReference.prototype.directPath = ""; - ExternalBlobReference.prototype.handle = ""; - ExternalBlobReference.prototype.fileSizeBytes = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ExternalBlobReference.prototype.fileSha256 = $util.newBuffer([]); - ExternalBlobReference.prototype.fileEncSha256 = $util.newBuffer([]); + ExternalBlobReference.prototype.mediaKey = null; + ExternalBlobReference.prototype.directPath = null; + ExternalBlobReference.prototype.handle = null; + ExternalBlobReference.prototype.fileSizeBytes = null; + ExternalBlobReference.prototype.fileSha256 = null; + ExternalBlobReference.prototype.fileEncSha256 = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalBlobReference.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalBlobReference.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalBlobReference.prototype, "_handle", { + get: $util.oneOfGetter($oneOfFields = ["handle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalBlobReference.prototype, "_fileSizeBytes", { + get: $util.oneOfGetter($oneOfFields = ["fileSizeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalBlobReference.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalBlobReference.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); ExternalBlobReference.create = function create(properties) { return new ExternalBlobReference(properties); @@ -10476,6 +23782,91 @@ export const proto = $root.proto = (() => { return m; }; + ExternalBlobReference.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ExternalBlobReference) + return d; + var m = new $root.proto.ExternalBlobReference(); + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.handle != null) { + m.handle = String(d.handle); + } + if (d.fileSizeBytes != null) { + if ($util.Long) + (m.fileSizeBytes = $util.Long.fromValue(d.fileSizeBytes)).unsigned = true; + else if (typeof d.fileSizeBytes === "string") + m.fileSizeBytes = parseInt(d.fileSizeBytes, 10); + else if (typeof d.fileSizeBytes === "number") + m.fileSizeBytes = d.fileSizeBytes; + else if (typeof d.fileSizeBytes === "object") + m.fileSizeBytes = new $util.LongBits(d.fileSizeBytes.low >>> 0, d.fileSizeBytes.high >>> 0).toNumber(true); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + return m; + }; + + ExternalBlobReference.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.handle != null && m.hasOwnProperty("handle")) { + d.handle = m.handle; + if (o.oneofs) + d._handle = "handle"; + } + if (m.fileSizeBytes != null && m.hasOwnProperty("fileSizeBytes")) { + if (typeof m.fileSizeBytes === "number") + d.fileSizeBytes = o.longs === String ? String(m.fileSizeBytes) : m.fileSizeBytes; + else + d.fileSizeBytes = o.longs === String ? $util.Long.prototype.toString.call(m.fileSizeBytes) : o.longs === Number ? new $util.LongBits(m.fileSizeBytes.low >>> 0, m.fileSizeBytes.high >>> 0).toNumber(true) : m.fileSizeBytes; + if (o.oneofs) + d._fileSizeBytes = "fileSizeBytes"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + return d; + }; + + ExternalBlobReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExternalBlobReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10496,12 +23887,38 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Field.prototype.minVersion = 0; - Field.prototype.maxVersion = 0; - Field.prototype.notReportableMinVersion = 0; - Field.prototype.isMessage = false; + Field.prototype.minVersion = null; + Field.prototype.maxVersion = null; + Field.prototype.notReportableMinVersion = null; + Field.prototype.isMessage = null; Field.prototype.subfield = $util.emptyObject; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Field.prototype, "_minVersion", { + get: $util.oneOfGetter($oneOfFields = ["minVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Field.prototype, "_maxVersion", { + get: $util.oneOfGetter($oneOfFields = ["maxVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Field.prototype, "_notReportableMinVersion", { + get: $util.oneOfGetter($oneOfFields = ["notReportableMinVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Field.prototype, "_isMessage", { + get: $util.oneOfGetter($oneOfFields = ["isMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + Field.create = function create(properties) { return new Field(properties); }; @@ -10582,6 +23999,76 @@ export const proto = $root.proto = (() => { return m; }; + Field.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Field) + return d; + var m = new $root.proto.Field(); + if (d.minVersion != null) { + m.minVersion = d.minVersion >>> 0; + } + if (d.maxVersion != null) { + m.maxVersion = d.maxVersion >>> 0; + } + if (d.notReportableMinVersion != null) { + m.notReportableMinVersion = d.notReportableMinVersion >>> 0; + } + if (d.isMessage != null) { + m.isMessage = Boolean(d.isMessage); + } + if (d.subfield) { + if (typeof d.subfield !== "object") + throw TypeError(".proto.Field.subfield: object expected"); + m.subfield = {}; + for (var ks = Object.keys(d.subfield), i = 0; i < ks.length; ++i) { + if (typeof d.subfield[ks[i]] !== "object") + throw TypeError(".proto.Field.subfield: object expected"); + m.subfield[ks[i]] = $root.proto.Field.fromObject(d.subfield[ks[i]]); + } + } + return m; + }; + + Field.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.objects || o.defaults) { + d.subfield = {}; + } + if (m.minVersion != null && m.hasOwnProperty("minVersion")) { + d.minVersion = m.minVersion; + if (o.oneofs) + d._minVersion = "minVersion"; + } + if (m.maxVersion != null && m.hasOwnProperty("maxVersion")) { + d.maxVersion = m.maxVersion; + if (o.oneofs) + d._maxVersion = "maxVersion"; + } + if (m.notReportableMinVersion != null && m.hasOwnProperty("notReportableMinVersion")) { + d.notReportableMinVersion = m.notReportableMinVersion; + if (o.oneofs) + d._notReportableMinVersion = "notReportableMinVersion"; + } + if (m.isMessage != null && m.hasOwnProperty("isMessage")) { + d.isMessage = m.isMessage; + if (o.oneofs) + d._isMessage = "isMessage"; + } + var ks2; + if (m.subfield && (ks2 = Object.keys(m.subfield)).length) { + d.subfield = {}; + for (var j = 0; j < ks2.length; ++j) { + d.subfield[ks2[j]] = $root.proto.Field.toObject(m.subfield[ks2[j]], o); + } + } + return d; + }; + + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10602,25 +24089,147 @@ export const proto = $root.proto = (() => { } GlobalSettings.prototype.lightThemeWallpaper = null; - GlobalSettings.prototype.mediaVisibility = 0; + GlobalSettings.prototype.mediaVisibility = null; GlobalSettings.prototype.darkThemeWallpaper = null; GlobalSettings.prototype.autoDownloadWiFi = null; GlobalSettings.prototype.autoDownloadCellular = null; GlobalSettings.prototype.autoDownloadRoaming = null; - GlobalSettings.prototype.showIndividualNotificationsPreview = false; - GlobalSettings.prototype.showGroupNotificationsPreview = false; - GlobalSettings.prototype.disappearingModeDuration = 0; - GlobalSettings.prototype.disappearingModeTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GlobalSettings.prototype.showIndividualNotificationsPreview = null; + GlobalSettings.prototype.showGroupNotificationsPreview = null; + GlobalSettings.prototype.disappearingModeDuration = null; + GlobalSettings.prototype.disappearingModeTimestamp = null; GlobalSettings.prototype.avatarUserSettings = null; - GlobalSettings.prototype.fontSize = 0; - GlobalSettings.prototype.securityNotifications = false; - GlobalSettings.prototype.autoUnarchiveChats = false; - GlobalSettings.prototype.videoQualityMode = 0; - GlobalSettings.prototype.photoQualityMode = 0; + GlobalSettings.prototype.fontSize = null; + GlobalSettings.prototype.securityNotifications = null; + GlobalSettings.prototype.autoUnarchiveChats = null; + GlobalSettings.prototype.videoQualityMode = null; + GlobalSettings.prototype.photoQualityMode = null; GlobalSettings.prototype.individualNotificationSettings = null; GlobalSettings.prototype.groupNotificationSettings = null; GlobalSettings.prototype.chatLockSettings = null; - GlobalSettings.prototype.chatDbLidMigrationTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GlobalSettings.prototype.chatDbLidMigrationTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_lightThemeWallpaper", { + get: $util.oneOfGetter($oneOfFields = ["lightThemeWallpaper"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_mediaVisibility", { + get: $util.oneOfGetter($oneOfFields = ["mediaVisibility"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_darkThemeWallpaper", { + get: $util.oneOfGetter($oneOfFields = ["darkThemeWallpaper"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_autoDownloadWiFi", { + get: $util.oneOfGetter($oneOfFields = ["autoDownloadWiFi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_autoDownloadCellular", { + get: $util.oneOfGetter($oneOfFields = ["autoDownloadCellular"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_autoDownloadRoaming", { + get: $util.oneOfGetter($oneOfFields = ["autoDownloadRoaming"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_showIndividualNotificationsPreview", { + get: $util.oneOfGetter($oneOfFields = ["showIndividualNotificationsPreview"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_showGroupNotificationsPreview", { + get: $util.oneOfGetter($oneOfFields = ["showGroupNotificationsPreview"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_disappearingModeDuration", { + get: $util.oneOfGetter($oneOfFields = ["disappearingModeDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_disappearingModeTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["disappearingModeTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_avatarUserSettings", { + get: $util.oneOfGetter($oneOfFields = ["avatarUserSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_fontSize", { + get: $util.oneOfGetter($oneOfFields = ["fontSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_securityNotifications", { + get: $util.oneOfGetter($oneOfFields = ["securityNotifications"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_autoUnarchiveChats", { + get: $util.oneOfGetter($oneOfFields = ["autoUnarchiveChats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_videoQualityMode", { + get: $util.oneOfGetter($oneOfFields = ["videoQualityMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_photoQualityMode", { + get: $util.oneOfGetter($oneOfFields = ["photoQualityMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_individualNotificationSettings", { + get: $util.oneOfGetter($oneOfFields = ["individualNotificationSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_groupNotificationSettings", { + get: $util.oneOfGetter($oneOfFields = ["groupNotificationSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_chatLockSettings", { + get: $util.oneOfGetter($oneOfFields = ["chatLockSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GlobalSettings.prototype, "_chatDbLidMigrationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["chatDbLidMigrationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); GlobalSettings.create = function create(properties) { return new GlobalSettings(properties); @@ -10769,6 +24378,239 @@ export const proto = $root.proto = (() => { return m; }; + GlobalSettings.fromObject = function fromObject(d) { + if (d instanceof $root.proto.GlobalSettings) + return d; + var m = new $root.proto.GlobalSettings(); + if (d.lightThemeWallpaper != null) { + if (typeof d.lightThemeWallpaper !== "object") + throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected"); + m.lightThemeWallpaper = $root.proto.WallpaperSettings.fromObject(d.lightThemeWallpaper); + } + switch (d.mediaVisibility) { + default: + if (typeof d.mediaVisibility === "number") { + m.mediaVisibility = d.mediaVisibility; + break; + } + break; + case "DEFAULT": + case 0: + m.mediaVisibility = 0; + break; + case "OFF": + case 1: + m.mediaVisibility = 1; + break; + case "ON": + case 2: + m.mediaVisibility = 2; + break; + } + if (d.darkThemeWallpaper != null) { + if (typeof d.darkThemeWallpaper !== "object") + throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected"); + m.darkThemeWallpaper = $root.proto.WallpaperSettings.fromObject(d.darkThemeWallpaper); + } + if (d.autoDownloadWiFi != null) { + if (typeof d.autoDownloadWiFi !== "object") + throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected"); + m.autoDownloadWiFi = $root.proto.AutoDownloadSettings.fromObject(d.autoDownloadWiFi); + } + if (d.autoDownloadCellular != null) { + if (typeof d.autoDownloadCellular !== "object") + throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected"); + m.autoDownloadCellular = $root.proto.AutoDownloadSettings.fromObject(d.autoDownloadCellular); + } + if (d.autoDownloadRoaming != null) { + if (typeof d.autoDownloadRoaming !== "object") + throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected"); + m.autoDownloadRoaming = $root.proto.AutoDownloadSettings.fromObject(d.autoDownloadRoaming); + } + if (d.showIndividualNotificationsPreview != null) { + m.showIndividualNotificationsPreview = Boolean(d.showIndividualNotificationsPreview); + } + if (d.showGroupNotificationsPreview != null) { + m.showGroupNotificationsPreview = Boolean(d.showGroupNotificationsPreview); + } + if (d.disappearingModeDuration != null) { + m.disappearingModeDuration = d.disappearingModeDuration | 0; + } + if (d.disappearingModeTimestamp != null) { + if ($util.Long) + (m.disappearingModeTimestamp = $util.Long.fromValue(d.disappearingModeTimestamp)).unsigned = false; + else if (typeof d.disappearingModeTimestamp === "string") + m.disappearingModeTimestamp = parseInt(d.disappearingModeTimestamp, 10); + else if (typeof d.disappearingModeTimestamp === "number") + m.disappearingModeTimestamp = d.disappearingModeTimestamp; + else if (typeof d.disappearingModeTimestamp === "object") + m.disappearingModeTimestamp = new $util.LongBits(d.disappearingModeTimestamp.low >>> 0, d.disappearingModeTimestamp.high >>> 0).toNumber(); + } + if (d.avatarUserSettings != null) { + if (typeof d.avatarUserSettings !== "object") + throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected"); + m.avatarUserSettings = $root.proto.AvatarUserSettings.fromObject(d.avatarUserSettings); + } + if (d.fontSize != null) { + m.fontSize = d.fontSize | 0; + } + if (d.securityNotifications != null) { + m.securityNotifications = Boolean(d.securityNotifications); + } + if (d.autoUnarchiveChats != null) { + m.autoUnarchiveChats = Boolean(d.autoUnarchiveChats); + } + if (d.videoQualityMode != null) { + m.videoQualityMode = d.videoQualityMode | 0; + } + if (d.photoQualityMode != null) { + m.photoQualityMode = d.photoQualityMode | 0; + } + if (d.individualNotificationSettings != null) { + if (typeof d.individualNotificationSettings !== "object") + throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected"); + m.individualNotificationSettings = $root.proto.NotificationSettings.fromObject(d.individualNotificationSettings); + } + if (d.groupNotificationSettings != null) { + if (typeof d.groupNotificationSettings !== "object") + throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected"); + m.groupNotificationSettings = $root.proto.NotificationSettings.fromObject(d.groupNotificationSettings); + } + if (d.chatLockSettings != null) { + if (typeof d.chatLockSettings !== "object") + throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected"); + m.chatLockSettings = $root.proto.ChatLockSettings.fromObject(d.chatLockSettings); + } + if (d.chatDbLidMigrationTimestamp != null) { + if ($util.Long) + (m.chatDbLidMigrationTimestamp = $util.Long.fromValue(d.chatDbLidMigrationTimestamp)).unsigned = false; + else if (typeof d.chatDbLidMigrationTimestamp === "string") + m.chatDbLidMigrationTimestamp = parseInt(d.chatDbLidMigrationTimestamp, 10); + else if (typeof d.chatDbLidMigrationTimestamp === "number") + m.chatDbLidMigrationTimestamp = d.chatDbLidMigrationTimestamp; + else if (typeof d.chatDbLidMigrationTimestamp === "object") + m.chatDbLidMigrationTimestamp = new $util.LongBits(d.chatDbLidMigrationTimestamp.low >>> 0, d.chatDbLidMigrationTimestamp.high >>> 0).toNumber(); + } + return m; + }; + + GlobalSettings.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.lightThemeWallpaper != null && m.hasOwnProperty("lightThemeWallpaper")) { + d.lightThemeWallpaper = $root.proto.WallpaperSettings.toObject(m.lightThemeWallpaper, o); + if (o.oneofs) + d._lightThemeWallpaper = "lightThemeWallpaper"; + } + if (m.mediaVisibility != null && m.hasOwnProperty("mediaVisibility")) { + d.mediaVisibility = o.enums === String ? $root.proto.MediaVisibility[m.mediaVisibility] === undefined ? m.mediaVisibility : $root.proto.MediaVisibility[m.mediaVisibility] : m.mediaVisibility; + if (o.oneofs) + d._mediaVisibility = "mediaVisibility"; + } + if (m.darkThemeWallpaper != null && m.hasOwnProperty("darkThemeWallpaper")) { + d.darkThemeWallpaper = $root.proto.WallpaperSettings.toObject(m.darkThemeWallpaper, o); + if (o.oneofs) + d._darkThemeWallpaper = "darkThemeWallpaper"; + } + if (m.autoDownloadWiFi != null && m.hasOwnProperty("autoDownloadWiFi")) { + d.autoDownloadWiFi = $root.proto.AutoDownloadSettings.toObject(m.autoDownloadWiFi, o); + if (o.oneofs) + d._autoDownloadWiFi = "autoDownloadWiFi"; + } + if (m.autoDownloadCellular != null && m.hasOwnProperty("autoDownloadCellular")) { + d.autoDownloadCellular = $root.proto.AutoDownloadSettings.toObject(m.autoDownloadCellular, o); + if (o.oneofs) + d._autoDownloadCellular = "autoDownloadCellular"; + } + if (m.autoDownloadRoaming != null && m.hasOwnProperty("autoDownloadRoaming")) { + d.autoDownloadRoaming = $root.proto.AutoDownloadSettings.toObject(m.autoDownloadRoaming, o); + if (o.oneofs) + d._autoDownloadRoaming = "autoDownloadRoaming"; + } + if (m.showIndividualNotificationsPreview != null && m.hasOwnProperty("showIndividualNotificationsPreview")) { + d.showIndividualNotificationsPreview = m.showIndividualNotificationsPreview; + if (o.oneofs) + d._showIndividualNotificationsPreview = "showIndividualNotificationsPreview"; + } + if (m.showGroupNotificationsPreview != null && m.hasOwnProperty("showGroupNotificationsPreview")) { + d.showGroupNotificationsPreview = m.showGroupNotificationsPreview; + if (o.oneofs) + d._showGroupNotificationsPreview = "showGroupNotificationsPreview"; + } + if (m.disappearingModeDuration != null && m.hasOwnProperty("disappearingModeDuration")) { + d.disappearingModeDuration = m.disappearingModeDuration; + if (o.oneofs) + d._disappearingModeDuration = "disappearingModeDuration"; + } + if (m.disappearingModeTimestamp != null && m.hasOwnProperty("disappearingModeTimestamp")) { + if (typeof m.disappearingModeTimestamp === "number") + d.disappearingModeTimestamp = o.longs === String ? String(m.disappearingModeTimestamp) : m.disappearingModeTimestamp; + else + d.disappearingModeTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.disappearingModeTimestamp) : o.longs === Number ? new $util.LongBits(m.disappearingModeTimestamp.low >>> 0, m.disappearingModeTimestamp.high >>> 0).toNumber() : m.disappearingModeTimestamp; + if (o.oneofs) + d._disappearingModeTimestamp = "disappearingModeTimestamp"; + } + if (m.avatarUserSettings != null && m.hasOwnProperty("avatarUserSettings")) { + d.avatarUserSettings = $root.proto.AvatarUserSettings.toObject(m.avatarUserSettings, o); + if (o.oneofs) + d._avatarUserSettings = "avatarUserSettings"; + } + if (m.fontSize != null && m.hasOwnProperty("fontSize")) { + d.fontSize = m.fontSize; + if (o.oneofs) + d._fontSize = "fontSize"; + } + if (m.securityNotifications != null && m.hasOwnProperty("securityNotifications")) { + d.securityNotifications = m.securityNotifications; + if (o.oneofs) + d._securityNotifications = "securityNotifications"; + } + if (m.autoUnarchiveChats != null && m.hasOwnProperty("autoUnarchiveChats")) { + d.autoUnarchiveChats = m.autoUnarchiveChats; + if (o.oneofs) + d._autoUnarchiveChats = "autoUnarchiveChats"; + } + if (m.videoQualityMode != null && m.hasOwnProperty("videoQualityMode")) { + d.videoQualityMode = m.videoQualityMode; + if (o.oneofs) + d._videoQualityMode = "videoQualityMode"; + } + if (m.photoQualityMode != null && m.hasOwnProperty("photoQualityMode")) { + d.photoQualityMode = m.photoQualityMode; + if (o.oneofs) + d._photoQualityMode = "photoQualityMode"; + } + if (m.individualNotificationSettings != null && m.hasOwnProperty("individualNotificationSettings")) { + d.individualNotificationSettings = $root.proto.NotificationSettings.toObject(m.individualNotificationSettings, o); + if (o.oneofs) + d._individualNotificationSettings = "individualNotificationSettings"; + } + if (m.groupNotificationSettings != null && m.hasOwnProperty("groupNotificationSettings")) { + d.groupNotificationSettings = $root.proto.NotificationSettings.toObject(m.groupNotificationSettings, o); + if (o.oneofs) + d._groupNotificationSettings = "groupNotificationSettings"; + } + if (m.chatLockSettings != null && m.hasOwnProperty("chatLockSettings")) { + d.chatLockSettings = $root.proto.ChatLockSettings.toObject(m.chatLockSettings, o); + if (o.oneofs) + d._chatLockSettings = "chatLockSettings"; + } + if (m.chatDbLidMigrationTimestamp != null && m.hasOwnProperty("chatDbLidMigrationTimestamp")) { + if (typeof m.chatDbLidMigrationTimestamp === "number") + d.chatDbLidMigrationTimestamp = o.longs === String ? String(m.chatDbLidMigrationTimestamp) : m.chatDbLidMigrationTimestamp; + else + d.chatDbLidMigrationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.chatDbLidMigrationTimestamp) : o.longs === Number ? new $util.LongBits(m.chatDbLidMigrationTimestamp.low >>> 0, m.chatDbLidMigrationTimestamp.high >>> 0).toNumber() : m.chatDbLidMigrationTimestamp; + if (o.oneofs) + d._chatDbLidMigrationTimestamp = "chatDbLidMigrationTimestamp"; + } + return d; + }; + + GlobalSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + GlobalSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10788,8 +24630,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - GroupMention.prototype.groupJid = ""; - GroupMention.prototype.groupSubject = ""; + GroupMention.prototype.groupJid = null; + GroupMention.prototype.groupSubject = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupMention.prototype, "_groupJid", { + get: $util.oneOfGetter($oneOfFields = ["groupJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupMention.prototype, "_groupSubject", { + get: $util.oneOfGetter($oneOfFields = ["groupSubject"]), + set: $util.oneOfSetter($oneOfFields) + }); GroupMention.create = function create(properties) { return new GroupMention(properties); @@ -10830,6 +24686,40 @@ export const proto = $root.proto = (() => { return m; }; + GroupMention.fromObject = function fromObject(d) { + if (d instanceof $root.proto.GroupMention) + return d; + var m = new $root.proto.GroupMention(); + if (d.groupJid != null) { + m.groupJid = String(d.groupJid); + } + if (d.groupSubject != null) { + m.groupSubject = String(d.groupSubject); + } + return m; + }; + + GroupMention.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.groupJid != null && m.hasOwnProperty("groupJid")) { + d.groupJid = m.groupJid; + if (o.oneofs) + d._groupJid = "groupJid"; + } + if (m.groupSubject != null && m.hasOwnProperty("groupSubject")) { + d.groupSubject = m.groupSubject; + if (o.oneofs) + d._groupSubject = "groupSubject"; + } + return d; + }; + + GroupMention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + GroupMention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10850,7 +24740,15 @@ export const proto = $root.proto = (() => { } GroupParticipant.prototype.userJid = ""; - GroupParticipant.prototype.rank = 0; + GroupParticipant.prototype.rank = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupParticipant.prototype, "_rank", { + get: $util.oneOfGetter($oneOfFields = ["rank"]), + set: $util.oneOfSetter($oneOfFields) + }); GroupParticipant.create = function create(properties) { return new GroupParticipant(properties); @@ -10859,7 +24757,8 @@ export const proto = $root.proto = (() => { GroupParticipant.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(10).string(m.userJid); + if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid")) + w.uint32(10).string(m.userJid); if (m.rank != null && Object.hasOwnProperty.call(m, "rank")) w.uint32(16).int32(m.rank); return w; @@ -10887,11 +24786,61 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("userJid")) - throw $util.ProtocolError("missing required 'userJid'", { instance: m }); return m; }; + GroupParticipant.fromObject = function fromObject(d) { + if (d instanceof $root.proto.GroupParticipant) + return d; + var m = new $root.proto.GroupParticipant(); + if (d.userJid != null) { + m.userJid = String(d.userJid); + } + switch (d.rank) { + default: + if (typeof d.rank === "number") { + m.rank = d.rank; + break; + } + break; + case "REGULAR": + case 0: + m.rank = 0; + break; + case "ADMIN": + case 1: + m.rank = 1; + break; + case "SUPERADMIN": + case 2: + m.rank = 2; + break; + } + return m; + }; + + GroupParticipant.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.userJid = ""; + } + if (m.userJid != null && m.hasOwnProperty("userJid")) { + d.userJid = m.userJid; + } + if (m.rank != null && m.hasOwnProperty("rank")) { + d.rank = o.enums === String ? $root.proto.GroupParticipant.Rank[m.rank] === undefined ? m.rank : $root.proto.GroupParticipant.Rank[m.rank] : m.rank; + if (o.oneofs) + d._rank = "rank"; + } + return d; + }; + + GroupParticipant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + GroupParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10923,6 +24872,26 @@ export const proto = $root.proto = (() => { HandshakeMessage.prototype.serverHello = null; HandshakeMessage.prototype.clientFinish = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandshakeMessage.prototype, "_clientHello", { + get: $util.oneOfGetter($oneOfFields = ["clientHello"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandshakeMessage.prototype, "_serverHello", { + get: $util.oneOfGetter($oneOfFields = ["serverHello"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandshakeMessage.prototype, "_clientFinish", { + get: $util.oneOfGetter($oneOfFields = ["clientFinish"]), + set: $util.oneOfSetter($oneOfFields) + }); + HandshakeMessage.create = function create(properties) { return new HandshakeMessage(properties); }; @@ -10968,6 +24937,54 @@ export const proto = $root.proto = (() => { return m; }; + HandshakeMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HandshakeMessage) + return d; + var m = new $root.proto.HandshakeMessage(); + if (d.clientHello != null) { + if (typeof d.clientHello !== "object") + throw TypeError(".proto.HandshakeMessage.clientHello: object expected"); + m.clientHello = $root.proto.HandshakeMessage.ClientHello.fromObject(d.clientHello); + } + if (d.serverHello != null) { + if (typeof d.serverHello !== "object") + throw TypeError(".proto.HandshakeMessage.serverHello: object expected"); + m.serverHello = $root.proto.HandshakeMessage.ServerHello.fromObject(d.serverHello); + } + if (d.clientFinish != null) { + if (typeof d.clientFinish !== "object") + throw TypeError(".proto.HandshakeMessage.clientFinish: object expected"); + m.clientFinish = $root.proto.HandshakeMessage.ClientFinish.fromObject(d.clientFinish); + } + return m; + }; + + HandshakeMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.clientHello != null && m.hasOwnProperty("clientHello")) { + d.clientHello = $root.proto.HandshakeMessage.ClientHello.toObject(m.clientHello, o); + if (o.oneofs) + d._clientHello = "clientHello"; + } + if (m.serverHello != null && m.hasOwnProperty("serverHello")) { + d.serverHello = $root.proto.HandshakeMessage.ServerHello.toObject(m.serverHello, o); + if (o.oneofs) + d._serverHello = "serverHello"; + } + if (m.clientFinish != null && m.hasOwnProperty("clientFinish")) { + d.clientFinish = $root.proto.HandshakeMessage.ClientFinish.toObject(m.clientFinish, o); + if (o.oneofs) + d._clientFinish = "clientFinish"; + } + return d; + }; + + HandshakeMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HandshakeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -10984,8 +25001,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ClientFinish.prototype["static"] = $util.newBuffer([]); - ClientFinish.prototype.payload = $util.newBuffer([]); + ClientFinish.prototype["static"] = null; + ClientFinish.prototype.payload = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientFinish.prototype, "_static", { + get: $util.oneOfGetter($oneOfFields = ["static"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientFinish.prototype, "_payload", { + get: $util.oneOfGetter($oneOfFields = ["payload"]), + set: $util.oneOfSetter($oneOfFields) + }); ClientFinish.create = function create(properties) { return new ClientFinish(properties); @@ -11026,6 +25057,46 @@ export const proto = $root.proto = (() => { return m; }; + ClientFinish.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HandshakeMessage.ClientFinish) + return d; + var m = new $root.proto.HandshakeMessage.ClientFinish(); + if (d["static"] != null) { + if (typeof d["static"] === "string") + $util.base64.decode(d["static"], m["static"] = $util.newBuffer($util.base64.length(d["static"])), 0); + else if (d["static"].length >= 0) + m["static"] = d["static"]; + } + if (d.payload != null) { + if (typeof d.payload === "string") + $util.base64.decode(d.payload, m.payload = $util.newBuffer($util.base64.length(d.payload)), 0); + else if (d.payload.length >= 0) + m.payload = d.payload; + } + return m; + }; + + ClientFinish.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m["static"] != null && m.hasOwnProperty("static")) { + d["static"] = o.bytes === String ? $util.base64.encode(m["static"], 0, m["static"].length) : o.bytes === Array ? Array.prototype.slice.call(m["static"]) : m["static"]; + if (o.oneofs) + d._static = "static"; + } + if (m.payload != null && m.hasOwnProperty("payload")) { + d.payload = o.bytes === String ? $util.base64.encode(m.payload, 0, m.payload.length) : o.bytes === Array ? Array.prototype.slice.call(m.payload) : m.payload; + if (o.oneofs) + d._payload = "payload"; + } + return d; + }; + + ClientFinish.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ClientFinish.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11045,9 +25116,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ClientHello.prototype.ephemeral = $util.newBuffer([]); - ClientHello.prototype["static"] = $util.newBuffer([]); - ClientHello.prototype.payload = $util.newBuffer([]); + ClientHello.prototype.ephemeral = null; + ClientHello.prototype["static"] = null; + ClientHello.prototype.payload = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientHello.prototype, "_ephemeral", { + get: $util.oneOfGetter($oneOfFields = ["ephemeral"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientHello.prototype, "_static", { + get: $util.oneOfGetter($oneOfFields = ["static"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClientHello.prototype, "_payload", { + get: $util.oneOfGetter($oneOfFields = ["payload"]), + set: $util.oneOfSetter($oneOfFields) + }); ClientHello.create = function create(properties) { return new ClientHello(properties); @@ -11094,6 +25185,57 @@ export const proto = $root.proto = (() => { return m; }; + ClientHello.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HandshakeMessage.ClientHello) + return d; + var m = new $root.proto.HandshakeMessage.ClientHello(); + if (d.ephemeral != null) { + if (typeof d.ephemeral === "string") + $util.base64.decode(d.ephemeral, m.ephemeral = $util.newBuffer($util.base64.length(d.ephemeral)), 0); + else if (d.ephemeral.length >= 0) + m.ephemeral = d.ephemeral; + } + if (d["static"] != null) { + if (typeof d["static"] === "string") + $util.base64.decode(d["static"], m["static"] = $util.newBuffer($util.base64.length(d["static"])), 0); + else if (d["static"].length >= 0) + m["static"] = d["static"]; + } + if (d.payload != null) { + if (typeof d.payload === "string") + $util.base64.decode(d.payload, m.payload = $util.newBuffer($util.base64.length(d.payload)), 0); + else if (d.payload.length >= 0) + m.payload = d.payload; + } + return m; + }; + + ClientHello.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.ephemeral != null && m.hasOwnProperty("ephemeral")) { + d.ephemeral = o.bytes === String ? $util.base64.encode(m.ephemeral, 0, m.ephemeral.length) : o.bytes === Array ? Array.prototype.slice.call(m.ephemeral) : m.ephemeral; + if (o.oneofs) + d._ephemeral = "ephemeral"; + } + if (m["static"] != null && m.hasOwnProperty("static")) { + d["static"] = o.bytes === String ? $util.base64.encode(m["static"], 0, m["static"].length) : o.bytes === Array ? Array.prototype.slice.call(m["static"]) : m["static"]; + if (o.oneofs) + d._static = "static"; + } + if (m.payload != null && m.hasOwnProperty("payload")) { + d.payload = o.bytes === String ? $util.base64.encode(m.payload, 0, m.payload.length) : o.bytes === Array ? Array.prototype.slice.call(m.payload) : m.payload; + if (o.oneofs) + d._payload = "payload"; + } + return d; + }; + + ClientHello.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ClientHello.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11113,9 +25255,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ServerHello.prototype.ephemeral = $util.newBuffer([]); - ServerHello.prototype["static"] = $util.newBuffer([]); - ServerHello.prototype.payload = $util.newBuffer([]); + ServerHello.prototype.ephemeral = null; + ServerHello.prototype["static"] = null; + ServerHello.prototype.payload = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ServerHello.prototype, "_ephemeral", { + get: $util.oneOfGetter($oneOfFields = ["ephemeral"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ServerHello.prototype, "_static", { + get: $util.oneOfGetter($oneOfFields = ["static"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ServerHello.prototype, "_payload", { + get: $util.oneOfGetter($oneOfFields = ["payload"]), + set: $util.oneOfSetter($oneOfFields) + }); ServerHello.create = function create(properties) { return new ServerHello(properties); @@ -11162,6 +25324,57 @@ export const proto = $root.proto = (() => { return m; }; + ServerHello.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HandshakeMessage.ServerHello) + return d; + var m = new $root.proto.HandshakeMessage.ServerHello(); + if (d.ephemeral != null) { + if (typeof d.ephemeral === "string") + $util.base64.decode(d.ephemeral, m.ephemeral = $util.newBuffer($util.base64.length(d.ephemeral)), 0); + else if (d.ephemeral.length >= 0) + m.ephemeral = d.ephemeral; + } + if (d["static"] != null) { + if (typeof d["static"] === "string") + $util.base64.decode(d["static"], m["static"] = $util.newBuffer($util.base64.length(d["static"])), 0); + else if (d["static"].length >= 0) + m["static"] = d["static"]; + } + if (d.payload != null) { + if (typeof d.payload === "string") + $util.base64.decode(d.payload, m.payload = $util.newBuffer($util.base64.length(d.payload)), 0); + else if (d.payload.length >= 0) + m.payload = d.payload; + } + return m; + }; + + ServerHello.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.ephemeral != null && m.hasOwnProperty("ephemeral")) { + d.ephemeral = o.bytes === String ? $util.base64.encode(m.ephemeral, 0, m.ephemeral.length) : o.bytes === Array ? Array.prototype.slice.call(m.ephemeral) : m.ephemeral; + if (o.oneofs) + d._ephemeral = "ephemeral"; + } + if (m["static"] != null && m.hasOwnProperty("static")) { + d["static"] = o.bytes === String ? $util.base64.encode(m["static"], 0, m["static"].length) : o.bytes === Array ? Array.prototype.slice.call(m["static"]) : m["static"]; + if (o.oneofs) + d._static = "static"; + } + if (m.payload != null && m.hasOwnProperty("payload")) { + d.payload = o.bytes === String ? $util.base64.encode(m.payload, 0, m.payload.length) : o.bytes === Array ? Array.prototype.slice.call(m.payload) : m.payload; + if (o.oneofs) + d._payload = "payload"; + } + return d; + }; + + ServerHello.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ServerHello.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11195,21 +25408,71 @@ export const proto = $root.proto = (() => { HistorySync.prototype.syncType = 0; HistorySync.prototype.conversations = $util.emptyArray; HistorySync.prototype.statusV3Messages = $util.emptyArray; - HistorySync.prototype.chunkOrder = 0; - HistorySync.prototype.progress = 0; + HistorySync.prototype.chunkOrder = null; + HistorySync.prototype.progress = null; HistorySync.prototype.pushnames = $util.emptyArray; HistorySync.prototype.globalSettings = null; - HistorySync.prototype.threadIdUserSecret = $util.newBuffer([]); - HistorySync.prototype.threadDsTimeframeOffset = 0; + HistorySync.prototype.threadIdUserSecret = null; + HistorySync.prototype.threadDsTimeframeOffset = null; HistorySync.prototype.recentStickers = $util.emptyArray; HistorySync.prototype.pastParticipants = $util.emptyArray; HistorySync.prototype.callLogRecords = $util.emptyArray; - HistorySync.prototype.aiWaitListState = 0; + HistorySync.prototype.aiWaitListState = null; HistorySync.prototype.phoneNumberToLidMappings = $util.emptyArray; - HistorySync.prototype.companionMetaNonce = ""; - HistorySync.prototype.shareableChatIdentifierEncryptionKey = $util.newBuffer([]); + HistorySync.prototype.companionMetaNonce = null; + HistorySync.prototype.shareableChatIdentifierEncryptionKey = null; HistorySync.prototype.accounts = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_chunkOrder", { + get: $util.oneOfGetter($oneOfFields = ["chunkOrder"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_progress", { + get: $util.oneOfGetter($oneOfFields = ["progress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_globalSettings", { + get: $util.oneOfGetter($oneOfFields = ["globalSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_threadIdUserSecret", { + get: $util.oneOfGetter($oneOfFields = ["threadIdUserSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_threadDsTimeframeOffset", { + get: $util.oneOfGetter($oneOfFields = ["threadDsTimeframeOffset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_aiWaitListState", { + get: $util.oneOfGetter($oneOfFields = ["aiWaitListState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_companionMetaNonce", { + get: $util.oneOfGetter($oneOfFields = ["companionMetaNonce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySync.prototype, "_shareableChatIdentifierEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["shareableChatIdentifierEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + HistorySync.create = function create(properties) { return new HistorySync(properties); }; @@ -11217,7 +25480,8 @@ export const proto = $root.proto = (() => { HistorySync.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(8).int32(m.syncType); + if (m.syncType != null && Object.hasOwnProperty.call(m, "syncType")) + w.uint32(8).int32(m.syncType); if (m.conversations != null && m.conversations.length) { for (var i = 0; i < m.conversations.length; ++i) $root.proto.Conversation.encode(m.conversations[i], w.uint32(18).fork()).ldelim(); @@ -11367,11 +25631,292 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("syncType")) - throw $util.ProtocolError("missing required 'syncType'", { instance: m }); return m; }; + HistorySync.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HistorySync) + return d; + var m = new $root.proto.HistorySync(); + switch (d.syncType) { + default: + if (typeof d.syncType === "number") { + m.syncType = d.syncType; + break; + } + break; + case "INITIAL_BOOTSTRAP": + case 0: + m.syncType = 0; + break; + case "INITIAL_STATUS_V3": + case 1: + m.syncType = 1; + break; + case "FULL": + case 2: + m.syncType = 2; + break; + case "RECENT": + case 3: + m.syncType = 3; + break; + case "PUSH_NAME": + case 4: + m.syncType = 4; + break; + case "NON_BLOCKING_DATA": + case 5: + m.syncType = 5; + break; + case "ON_DEMAND": + case 6: + m.syncType = 6; + break; + } + if (d.conversations) { + if (!Array.isArray(d.conversations)) + throw TypeError(".proto.HistorySync.conversations: array expected"); + m.conversations = []; + for (var i = 0; i < d.conversations.length; ++i) { + if (typeof d.conversations[i] !== "object") + throw TypeError(".proto.HistorySync.conversations: object expected"); + m.conversations[i] = $root.proto.Conversation.fromObject(d.conversations[i]); + } + } + if (d.statusV3Messages) { + if (!Array.isArray(d.statusV3Messages)) + throw TypeError(".proto.HistorySync.statusV3Messages: array expected"); + m.statusV3Messages = []; + for (var i = 0; i < d.statusV3Messages.length; ++i) { + if (typeof d.statusV3Messages[i] !== "object") + throw TypeError(".proto.HistorySync.statusV3Messages: object expected"); + m.statusV3Messages[i] = $root.proto.WebMessageInfo.fromObject(d.statusV3Messages[i]); + } + } + if (d.chunkOrder != null) { + m.chunkOrder = d.chunkOrder >>> 0; + } + if (d.progress != null) { + m.progress = d.progress >>> 0; + } + if (d.pushnames) { + if (!Array.isArray(d.pushnames)) + throw TypeError(".proto.HistorySync.pushnames: array expected"); + m.pushnames = []; + for (var i = 0; i < d.pushnames.length; ++i) { + if (typeof d.pushnames[i] !== "object") + throw TypeError(".proto.HistorySync.pushnames: object expected"); + m.pushnames[i] = $root.proto.Pushname.fromObject(d.pushnames[i]); + } + } + if (d.globalSettings != null) { + if (typeof d.globalSettings !== "object") + throw TypeError(".proto.HistorySync.globalSettings: object expected"); + m.globalSettings = $root.proto.GlobalSettings.fromObject(d.globalSettings); + } + if (d.threadIdUserSecret != null) { + if (typeof d.threadIdUserSecret === "string") + $util.base64.decode(d.threadIdUserSecret, m.threadIdUserSecret = $util.newBuffer($util.base64.length(d.threadIdUserSecret)), 0); + else if (d.threadIdUserSecret.length >= 0) + m.threadIdUserSecret = d.threadIdUserSecret; + } + if (d.threadDsTimeframeOffset != null) { + m.threadDsTimeframeOffset = d.threadDsTimeframeOffset >>> 0; + } + if (d.recentStickers) { + if (!Array.isArray(d.recentStickers)) + throw TypeError(".proto.HistorySync.recentStickers: array expected"); + m.recentStickers = []; + for (var i = 0; i < d.recentStickers.length; ++i) { + if (typeof d.recentStickers[i] !== "object") + throw TypeError(".proto.HistorySync.recentStickers: object expected"); + m.recentStickers[i] = $root.proto.StickerMetadata.fromObject(d.recentStickers[i]); + } + } + if (d.pastParticipants) { + if (!Array.isArray(d.pastParticipants)) + throw TypeError(".proto.HistorySync.pastParticipants: array expected"); + m.pastParticipants = []; + for (var i = 0; i < d.pastParticipants.length; ++i) { + if (typeof d.pastParticipants[i] !== "object") + throw TypeError(".proto.HistorySync.pastParticipants: object expected"); + m.pastParticipants[i] = $root.proto.PastParticipants.fromObject(d.pastParticipants[i]); + } + } + if (d.callLogRecords) { + if (!Array.isArray(d.callLogRecords)) + throw TypeError(".proto.HistorySync.callLogRecords: array expected"); + m.callLogRecords = []; + for (var i = 0; i < d.callLogRecords.length; ++i) { + if (typeof d.callLogRecords[i] !== "object") + throw TypeError(".proto.HistorySync.callLogRecords: object expected"); + m.callLogRecords[i] = $root.proto.CallLogRecord.fromObject(d.callLogRecords[i]); + } + } + switch (d.aiWaitListState) { + default: + if (typeof d.aiWaitListState === "number") { + m.aiWaitListState = d.aiWaitListState; + break; + } + break; + case "IN_WAITLIST": + case 0: + m.aiWaitListState = 0; + break; + case "AI_AVAILABLE": + case 1: + m.aiWaitListState = 1; + break; + } + if (d.phoneNumberToLidMappings) { + if (!Array.isArray(d.phoneNumberToLidMappings)) + throw TypeError(".proto.HistorySync.phoneNumberToLidMappings: array expected"); + m.phoneNumberToLidMappings = []; + for (var i = 0; i < d.phoneNumberToLidMappings.length; ++i) { + if (typeof d.phoneNumberToLidMappings[i] !== "object") + throw TypeError(".proto.HistorySync.phoneNumberToLidMappings: object expected"); + m.phoneNumberToLidMappings[i] = $root.proto.PhoneNumberToLIDMapping.fromObject(d.phoneNumberToLidMappings[i]); + } + } + if (d.companionMetaNonce != null) { + m.companionMetaNonce = String(d.companionMetaNonce); + } + if (d.shareableChatIdentifierEncryptionKey != null) { + if (typeof d.shareableChatIdentifierEncryptionKey === "string") + $util.base64.decode(d.shareableChatIdentifierEncryptionKey, m.shareableChatIdentifierEncryptionKey = $util.newBuffer($util.base64.length(d.shareableChatIdentifierEncryptionKey)), 0); + else if (d.shareableChatIdentifierEncryptionKey.length >= 0) + m.shareableChatIdentifierEncryptionKey = d.shareableChatIdentifierEncryptionKey; + } + if (d.accounts) { + if (!Array.isArray(d.accounts)) + throw TypeError(".proto.HistorySync.accounts: array expected"); + m.accounts = []; + for (var i = 0; i < d.accounts.length; ++i) { + if (typeof d.accounts[i] !== "object") + throw TypeError(".proto.HistorySync.accounts: object expected"); + m.accounts[i] = $root.proto.Account.fromObject(d.accounts[i]); + } + } + return m; + }; + + HistorySync.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.conversations = []; + d.statusV3Messages = []; + d.pushnames = []; + d.recentStickers = []; + d.pastParticipants = []; + d.callLogRecords = []; + d.phoneNumberToLidMappings = []; + d.accounts = []; + } + if (o.defaults) { + d.syncType = o.enums === String ? "INITIAL_BOOTSTRAP" : 0; + } + if (m.syncType != null && m.hasOwnProperty("syncType")) { + d.syncType = o.enums === String ? $root.proto.HistorySync.HistorySyncType[m.syncType] === undefined ? m.syncType : $root.proto.HistorySync.HistorySyncType[m.syncType] : m.syncType; + } + if (m.conversations && m.conversations.length) { + d.conversations = []; + for (var j = 0; j < m.conversations.length; ++j) { + d.conversations[j] = $root.proto.Conversation.toObject(m.conversations[j], o); + } + } + if (m.statusV3Messages && m.statusV3Messages.length) { + d.statusV3Messages = []; + for (var j = 0; j < m.statusV3Messages.length; ++j) { + d.statusV3Messages[j] = $root.proto.WebMessageInfo.toObject(m.statusV3Messages[j], o); + } + } + if (m.chunkOrder != null && m.hasOwnProperty("chunkOrder")) { + d.chunkOrder = m.chunkOrder; + if (o.oneofs) + d._chunkOrder = "chunkOrder"; + } + if (m.progress != null && m.hasOwnProperty("progress")) { + d.progress = m.progress; + if (o.oneofs) + d._progress = "progress"; + } + if (m.pushnames && m.pushnames.length) { + d.pushnames = []; + for (var j = 0; j < m.pushnames.length; ++j) { + d.pushnames[j] = $root.proto.Pushname.toObject(m.pushnames[j], o); + } + } + if (m.globalSettings != null && m.hasOwnProperty("globalSettings")) { + d.globalSettings = $root.proto.GlobalSettings.toObject(m.globalSettings, o); + if (o.oneofs) + d._globalSettings = "globalSettings"; + } + if (m.threadIdUserSecret != null && m.hasOwnProperty("threadIdUserSecret")) { + d.threadIdUserSecret = o.bytes === String ? $util.base64.encode(m.threadIdUserSecret, 0, m.threadIdUserSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.threadIdUserSecret) : m.threadIdUserSecret; + if (o.oneofs) + d._threadIdUserSecret = "threadIdUserSecret"; + } + if (m.threadDsTimeframeOffset != null && m.hasOwnProperty("threadDsTimeframeOffset")) { + d.threadDsTimeframeOffset = m.threadDsTimeframeOffset; + if (o.oneofs) + d._threadDsTimeframeOffset = "threadDsTimeframeOffset"; + } + if (m.recentStickers && m.recentStickers.length) { + d.recentStickers = []; + for (var j = 0; j < m.recentStickers.length; ++j) { + d.recentStickers[j] = $root.proto.StickerMetadata.toObject(m.recentStickers[j], o); + } + } + if (m.pastParticipants && m.pastParticipants.length) { + d.pastParticipants = []; + for (var j = 0; j < m.pastParticipants.length; ++j) { + d.pastParticipants[j] = $root.proto.PastParticipants.toObject(m.pastParticipants[j], o); + } + } + if (m.callLogRecords && m.callLogRecords.length) { + d.callLogRecords = []; + for (var j = 0; j < m.callLogRecords.length; ++j) { + d.callLogRecords[j] = $root.proto.CallLogRecord.toObject(m.callLogRecords[j], o); + } + } + if (m.aiWaitListState != null && m.hasOwnProperty("aiWaitListState")) { + d.aiWaitListState = o.enums === String ? $root.proto.HistorySync.BotAIWaitListState[m.aiWaitListState] === undefined ? m.aiWaitListState : $root.proto.HistorySync.BotAIWaitListState[m.aiWaitListState] : m.aiWaitListState; + if (o.oneofs) + d._aiWaitListState = "aiWaitListState"; + } + if (m.phoneNumberToLidMappings && m.phoneNumberToLidMappings.length) { + d.phoneNumberToLidMappings = []; + for (var j = 0; j < m.phoneNumberToLidMappings.length; ++j) { + d.phoneNumberToLidMappings[j] = $root.proto.PhoneNumberToLIDMapping.toObject(m.phoneNumberToLidMappings[j], o); + } + } + if (m.companionMetaNonce != null && m.hasOwnProperty("companionMetaNonce")) { + d.companionMetaNonce = m.companionMetaNonce; + if (o.oneofs) + d._companionMetaNonce = "companionMetaNonce"; + } + if (m.shareableChatIdentifierEncryptionKey != null && m.hasOwnProperty("shareableChatIdentifierEncryptionKey")) { + d.shareableChatIdentifierEncryptionKey = o.bytes === String ? $util.base64.encode(m.shareableChatIdentifierEncryptionKey, 0, m.shareableChatIdentifierEncryptionKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.shareableChatIdentifierEncryptionKey) : m.shareableChatIdentifierEncryptionKey; + if (o.oneofs) + d._shareableChatIdentifierEncryptionKey = "shareableChatIdentifierEncryptionKey"; + } + if (m.accounts && m.accounts.length) { + d.accounts = []; + for (var j = 0; j < m.accounts.length; ++j) { + d.accounts[j] = $root.proto.Account.toObject(m.accounts[j], o); + } + } + return d; + }; + + HistorySync.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HistorySync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11411,7 +25956,21 @@ export const proto = $root.proto = (() => { } HistorySyncMsg.prototype.message = null; - HistorySyncMsg.prototype.msgOrderId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + HistorySyncMsg.prototype.msgOrderId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncMsg.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncMsg.prototype, "_msgOrderId", { + get: $util.oneOfGetter($oneOfFields = ["msgOrderId"]), + set: $util.oneOfSetter($oneOfFields) + }); HistorySyncMsg.create = function create(properties) { return new HistorySyncMsg(properties); @@ -11452,6 +26011,52 @@ export const proto = $root.proto = (() => { return m; }; + HistorySyncMsg.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HistorySyncMsg) + return d; + var m = new $root.proto.HistorySyncMsg(); + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.HistorySyncMsg.message: object expected"); + m.message = $root.proto.WebMessageInfo.fromObject(d.message); + } + if (d.msgOrderId != null) { + if ($util.Long) + (m.msgOrderId = $util.Long.fromValue(d.msgOrderId)).unsigned = true; + else if (typeof d.msgOrderId === "string") + m.msgOrderId = parseInt(d.msgOrderId, 10); + else if (typeof d.msgOrderId === "number") + m.msgOrderId = d.msgOrderId; + else if (typeof d.msgOrderId === "object") + m.msgOrderId = new $util.LongBits(d.msgOrderId.low >>> 0, d.msgOrderId.high >>> 0).toNumber(true); + } + return m; + }; + + HistorySyncMsg.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.WebMessageInfo.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + if (m.msgOrderId != null && m.hasOwnProperty("msgOrderId")) { + if (typeof m.msgOrderId === "number") + d.msgOrderId = o.longs === String ? String(m.msgOrderId) : m.msgOrderId; + else + d.msgOrderId = o.longs === String ? $util.Long.prototype.toString.call(m.msgOrderId) : o.longs === Number ? new $util.LongBits(m.msgOrderId.low >>> 0, m.msgOrderId.high >>> 0).toNumber(true) : m.msgOrderId; + if (o.oneofs) + d._msgOrderId = "msgOrderId"; + } + return d; + }; + + HistorySyncMsg.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HistorySyncMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11471,13 +26076,19 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HydratedTemplateButton.prototype.index = 0; + HydratedTemplateButton.prototype.index = null; HydratedTemplateButton.prototype.quickReplyButton = null; HydratedTemplateButton.prototype.urlButton = null; HydratedTemplateButton.prototype.callButton = null; let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedTemplateButton.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(HydratedTemplateButton.prototype, "hydratedButton", { get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), set: $util.oneOfSetter($oneOfFields) @@ -11534,6 +26145,62 @@ export const proto = $root.proto = (() => { return m; }; + HydratedTemplateButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HydratedTemplateButton) + return d; + var m = new $root.proto.HydratedTemplateButton(); + if (d.index != null) { + m.index = d.index >>> 0; + } + if (d.quickReplyButton != null) { + if (typeof d.quickReplyButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected"); + m.quickReplyButton = $root.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(d.quickReplyButton); + } + if (d.urlButton != null) { + if (typeof d.urlButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected"); + m.urlButton = $root.proto.HydratedTemplateButton.HydratedURLButton.fromObject(d.urlButton); + } + if (d.callButton != null) { + if (typeof d.callButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.callButton: object expected"); + m.callButton = $root.proto.HydratedTemplateButton.HydratedCallButton.fromObject(d.callButton); + } + return m; + }; + + HydratedTemplateButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.quickReplyButton != null && m.hasOwnProperty("quickReplyButton")) { + d.quickReplyButton = $root.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(m.quickReplyButton, o); + if (o.oneofs) + d.hydratedButton = "quickReplyButton"; + } + if (m.urlButton != null && m.hasOwnProperty("urlButton")) { + d.urlButton = $root.proto.HydratedTemplateButton.HydratedURLButton.toObject(m.urlButton, o); + if (o.oneofs) + d.hydratedButton = "urlButton"; + } + if (m.callButton != null && m.hasOwnProperty("callButton")) { + d.callButton = $root.proto.HydratedTemplateButton.HydratedCallButton.toObject(m.callButton, o); + if (o.oneofs) + d.hydratedButton = "callButton"; + } + if (m.index != null && m.hasOwnProperty("index")) { + d.index = m.index; + if (o.oneofs) + d._index = "index"; + } + return d; + }; + + HydratedTemplateButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HydratedTemplateButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11550,8 +26217,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HydratedCallButton.prototype.displayText = ""; - HydratedCallButton.prototype.phoneNumber = ""; + HydratedCallButton.prototype.displayText = null; + HydratedCallButton.prototype.phoneNumber = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedCallButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedCallButton.prototype, "_phoneNumber", { + get: $util.oneOfGetter($oneOfFields = ["phoneNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); HydratedCallButton.create = function create(properties) { return new HydratedCallButton(properties); @@ -11592,6 +26273,40 @@ export const proto = $root.proto = (() => { return m; }; + HydratedCallButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HydratedTemplateButton.HydratedCallButton) + return d; + var m = new $root.proto.HydratedTemplateButton.HydratedCallButton(); + if (d.displayText != null) { + m.displayText = String(d.displayText); + } + if (d.phoneNumber != null) { + m.phoneNumber = String(d.phoneNumber); + } + return m; + }; + + HydratedCallButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = m.displayText; + if (o.oneofs) + d._displayText = "displayText"; + } + if (m.phoneNumber != null && m.hasOwnProperty("phoneNumber")) { + d.phoneNumber = m.phoneNumber; + if (o.oneofs) + d._phoneNumber = "phoneNumber"; + } + return d; + }; + + HydratedCallButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HydratedCallButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11611,8 +26326,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HydratedQuickReplyButton.prototype.displayText = ""; - HydratedQuickReplyButton.prototype.id = ""; + HydratedQuickReplyButton.prototype.displayText = null; + HydratedQuickReplyButton.prototype.id = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedQuickReplyButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedQuickReplyButton.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); HydratedQuickReplyButton.create = function create(properties) { return new HydratedQuickReplyButton(properties); @@ -11653,6 +26382,40 @@ export const proto = $root.proto = (() => { return m; }; + HydratedQuickReplyButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HydratedTemplateButton.HydratedQuickReplyButton) + return d; + var m = new $root.proto.HydratedTemplateButton.HydratedQuickReplyButton(); + if (d.displayText != null) { + m.displayText = String(d.displayText); + } + if (d.id != null) { + m.id = String(d.id); + } + return m; + }; + + HydratedQuickReplyButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = m.displayText; + if (o.oneofs) + d._displayText = "displayText"; + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + return d; + }; + + HydratedQuickReplyButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HydratedQuickReplyButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11672,10 +26435,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HydratedURLButton.prototype.displayText = ""; - HydratedURLButton.prototype.url = ""; - HydratedURLButton.prototype.consentedUsersUrl = ""; - HydratedURLButton.prototype.webviewPresentation = 1; + HydratedURLButton.prototype.displayText = null; + HydratedURLButton.prototype.url = null; + HydratedURLButton.prototype.consentedUsersUrl = null; + HydratedURLButton.prototype.webviewPresentation = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedURLButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedURLButton.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedURLButton.prototype, "_consentedUsersUrl", { + get: $util.oneOfGetter($oneOfFields = ["consentedUsersUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedURLButton.prototype, "_webviewPresentation", { + get: $util.oneOfGetter($oneOfFields = ["webviewPresentation"]), + set: $util.oneOfSetter($oneOfFields) + }); HydratedURLButton.create = function create(properties) { return new HydratedURLButton(properties); @@ -11728,6 +26517,73 @@ export const proto = $root.proto = (() => { return m; }; + HydratedURLButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.HydratedTemplateButton.HydratedURLButton) + return d; + var m = new $root.proto.HydratedTemplateButton.HydratedURLButton(); + if (d.displayText != null) { + m.displayText = String(d.displayText); + } + if (d.url != null) { + m.url = String(d.url); + } + if (d.consentedUsersUrl != null) { + m.consentedUsersUrl = String(d.consentedUsersUrl); + } + switch (d.webviewPresentation) { + default: + if (typeof d.webviewPresentation === "number") { + m.webviewPresentation = d.webviewPresentation; + break; + } + break; + case "FULL": + case 1: + m.webviewPresentation = 1; + break; + case "TALL": + case 2: + m.webviewPresentation = 2; + break; + case "COMPACT": + case 3: + m.webviewPresentation = 3; + break; + } + return m; + }; + + HydratedURLButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = m.displayText; + if (o.oneofs) + d._displayText = "displayText"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.consentedUsersUrl != null && m.hasOwnProperty("consentedUsersUrl")) { + d.consentedUsersUrl = m.consentedUsersUrl; + if (o.oneofs) + d._consentedUsersUrl = "consentedUsersUrl"; + } + if (m.webviewPresentation != null && m.hasOwnProperty("webviewPresentation")) { + d.webviewPresentation = o.enums === String ? $root.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[m.webviewPresentation] === undefined ? m.webviewPresentation : $root.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[m.webviewPresentation] : m.webviewPresentation; + if (o.oneofs) + d._webviewPresentation = "webviewPresentation"; + } + return d; + }; + + HydratedURLButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HydratedURLButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11758,8 +26614,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - IdentityKeyPairStructure.prototype.publicKey = $util.newBuffer([]); - IdentityKeyPairStructure.prototype.privateKey = $util.newBuffer([]); + IdentityKeyPairStructure.prototype.publicKey = null; + IdentityKeyPairStructure.prototype.privateKey = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IdentityKeyPairStructure.prototype, "_publicKey", { + get: $util.oneOfGetter($oneOfFields = ["publicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IdentityKeyPairStructure.prototype, "_privateKey", { + get: $util.oneOfGetter($oneOfFields = ["privateKey"]), + set: $util.oneOfSetter($oneOfFields) + }); IdentityKeyPairStructure.create = function create(properties) { return new IdentityKeyPairStructure(properties); @@ -11800,6 +26670,46 @@ export const proto = $root.proto = (() => { return m; }; + IdentityKeyPairStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.IdentityKeyPairStructure) + return d; + var m = new $root.proto.IdentityKeyPairStructure(); + if (d.publicKey != null) { + if (typeof d.publicKey === "string") + $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0); + else if (d.publicKey.length >= 0) + m.publicKey = d.publicKey; + } + if (d.privateKey != null) { + if (typeof d.privateKey === "string") + $util.base64.decode(d.privateKey, m.privateKey = $util.newBuffer($util.base64.length(d.privateKey)), 0); + else if (d.privateKey.length >= 0) + m.privateKey = d.privateKey; + } + return m; + }; + + IdentityKeyPairStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.publicKey != null && m.hasOwnProperty("publicKey")) { + d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey; + if (o.oneofs) + d._publicKey = "publicKey"; + } + if (m.privateKey != null && m.hasOwnProperty("privateKey")) { + d.privateKey = o.bytes === String ? $util.base64.encode(m.privateKey, 0, m.privateKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privateKey) : m.privateKey; + if (o.oneofs) + d._privateKey = "privateKey"; + } + return d; + }; + + IdentityKeyPairStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + IdentityKeyPairStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11821,9 +26731,9 @@ export const proto = $root.proto = (() => { } InteractiveAnnotation.prototype.polygonVertices = $util.emptyArray; - InteractiveAnnotation.prototype.shouldSkipConfirmation = false; + InteractiveAnnotation.prototype.shouldSkipConfirmation = null; InteractiveAnnotation.prototype.embeddedContent = null; - InteractiveAnnotation.prototype.statusLinkType = 1; + InteractiveAnnotation.prototype.statusLinkType = null; InteractiveAnnotation.prototype.location = null; InteractiveAnnotation.prototype.newsletter = null; InteractiveAnnotation.prototype.embeddedAction = null; @@ -11831,6 +26741,24 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveAnnotation.prototype, "_shouldSkipConfirmation", { + get: $util.oneOfGetter($oneOfFields = ["shouldSkipConfirmation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveAnnotation.prototype, "_embeddedContent", { + get: $util.oneOfGetter($oneOfFields = ["embeddedContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveAnnotation.prototype, "_statusLinkType", { + get: $util.oneOfGetter($oneOfFields = ["statusLinkType"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(InteractiveAnnotation.prototype, "action", { get: $util.oneOfGetter($oneOfFields = ["location", "newsletter", "embeddedAction", "tapAction"]), set: $util.oneOfSetter($oneOfFields) @@ -11915,6 +26843,124 @@ export const proto = $root.proto = (() => { return m; }; + InteractiveAnnotation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.InteractiveAnnotation) + return d; + var m = new $root.proto.InteractiveAnnotation(); + if (d.polygonVertices) { + if (!Array.isArray(d.polygonVertices)) + throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected"); + m.polygonVertices = []; + for (var i = 0; i < d.polygonVertices.length; ++i) { + if (typeof d.polygonVertices[i] !== "object") + throw TypeError(".proto.InteractiveAnnotation.polygonVertices: object expected"); + m.polygonVertices[i] = $root.proto.Point.fromObject(d.polygonVertices[i]); + } + } + if (d.shouldSkipConfirmation != null) { + m.shouldSkipConfirmation = Boolean(d.shouldSkipConfirmation); + } + if (d.embeddedContent != null) { + if (typeof d.embeddedContent !== "object") + throw TypeError(".proto.InteractiveAnnotation.embeddedContent: object expected"); + m.embeddedContent = $root.proto.EmbeddedContent.fromObject(d.embeddedContent); + } + switch (d.statusLinkType) { + default: + if (typeof d.statusLinkType === "number") { + m.statusLinkType = d.statusLinkType; + break; + } + break; + case "RASTERIZED_LINK_PREVIEW": + case 1: + m.statusLinkType = 1; + break; + case "RASTERIZED_LINK_TRUNCATED": + case 2: + m.statusLinkType = 2; + break; + case "RASTERIZED_LINK_FULL_URL": + case 3: + m.statusLinkType = 3; + break; + } + if (d.location != null) { + if (typeof d.location !== "object") + throw TypeError(".proto.InteractiveAnnotation.location: object expected"); + m.location = $root.proto.Location.fromObject(d.location); + } + if (d.newsletter != null) { + if (typeof d.newsletter !== "object") + throw TypeError(".proto.InteractiveAnnotation.newsletter: object expected"); + m.newsletter = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.fromObject(d.newsletter); + } + if (d.embeddedAction != null) { + m.embeddedAction = Boolean(d.embeddedAction); + } + if (d.tapAction != null) { + if (typeof d.tapAction !== "object") + throw TypeError(".proto.InteractiveAnnotation.tapAction: object expected"); + m.tapAction = $root.proto.TapLinkAction.fromObject(d.tapAction); + } + return m; + }; + + InteractiveAnnotation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.polygonVertices = []; + } + if (m.polygonVertices && m.polygonVertices.length) { + d.polygonVertices = []; + for (var j = 0; j < m.polygonVertices.length; ++j) { + d.polygonVertices[j] = $root.proto.Point.toObject(m.polygonVertices[j], o); + } + } + if (m.location != null && m.hasOwnProperty("location")) { + d.location = $root.proto.Location.toObject(m.location, o); + if (o.oneofs) + d.action = "location"; + } + if (m.newsletter != null && m.hasOwnProperty("newsletter")) { + d.newsletter = $root.proto.ContextInfo.ForwardedNewsletterMessageInfo.toObject(m.newsletter, o); + if (o.oneofs) + d.action = "newsletter"; + } + if (m.shouldSkipConfirmation != null && m.hasOwnProperty("shouldSkipConfirmation")) { + d.shouldSkipConfirmation = m.shouldSkipConfirmation; + if (o.oneofs) + d._shouldSkipConfirmation = "shouldSkipConfirmation"; + } + if (m.embeddedContent != null && m.hasOwnProperty("embeddedContent")) { + d.embeddedContent = $root.proto.EmbeddedContent.toObject(m.embeddedContent, o); + if (o.oneofs) + d._embeddedContent = "embeddedContent"; + } + if (m.embeddedAction != null && m.hasOwnProperty("embeddedAction")) { + d.embeddedAction = m.embeddedAction; + if (o.oneofs) + d.action = "embeddedAction"; + } + if (m.tapAction != null && m.hasOwnProperty("tapAction")) { + d.tapAction = $root.proto.TapLinkAction.toObject(m.tapAction, o); + if (o.oneofs) + d.action = "tapAction"; + } + if (m.statusLinkType != null && m.hasOwnProperty("statusLinkType")) { + d.statusLinkType = o.enums === String ? $root.proto.InteractiveAnnotation.StatusLinkType[m.statusLinkType] === undefined ? m.statusLinkType : $root.proto.InteractiveAnnotation.StatusLinkType[m.statusLinkType] : m.statusLinkType; + if (o.oneofs) + d._statusLinkType = "statusLinkType"; + } + return d; + }; + + InteractiveAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InteractiveAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -11942,12 +26988,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - KeepInChat.prototype.keepType = 0; - KeepInChat.prototype.serverTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + KeepInChat.prototype.keepType = null; + KeepInChat.prototype.serverTimestamp = null; KeepInChat.prototype.key = null; - KeepInChat.prototype.deviceJid = ""; - KeepInChat.prototype.clientTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - KeepInChat.prototype.serverTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + KeepInChat.prototype.deviceJid = null; + KeepInChat.prototype.clientTimestampMs = null; + KeepInChat.prototype.serverTimestampMs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChat.prototype, "_keepType", { + get: $util.oneOfGetter($oneOfFields = ["keepType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChat.prototype, "_serverTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["serverTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChat.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChat.prototype, "_deviceJid", { + get: $util.oneOfGetter($oneOfFields = ["deviceJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChat.prototype, "_clientTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["clientTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChat.prototype, "_serverTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); KeepInChat.create = function create(properties) { return new KeepInChat(properties); @@ -12012,6 +27096,121 @@ export const proto = $root.proto = (() => { return m; }; + KeepInChat.fromObject = function fromObject(d) { + if (d instanceof $root.proto.KeepInChat) + return d; + var m = new $root.proto.KeepInChat(); + switch (d.keepType) { + default: + if (typeof d.keepType === "number") { + m.keepType = d.keepType; + break; + } + break; + case "UNKNOWN": + case 0: + m.keepType = 0; + break; + case "KEEP_FOR_ALL": + case 1: + m.keepType = 1; + break; + case "UNDO_KEEP_FOR_ALL": + case 2: + m.keepType = 2; + break; + } + if (d.serverTimestamp != null) { + if ($util.Long) + (m.serverTimestamp = $util.Long.fromValue(d.serverTimestamp)).unsigned = false; + else if (typeof d.serverTimestamp === "string") + m.serverTimestamp = parseInt(d.serverTimestamp, 10); + else if (typeof d.serverTimestamp === "number") + m.serverTimestamp = d.serverTimestamp; + else if (typeof d.serverTimestamp === "object") + m.serverTimestamp = new $util.LongBits(d.serverTimestamp.low >>> 0, d.serverTimestamp.high >>> 0).toNumber(); + } + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.KeepInChat.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.deviceJid != null) { + m.deviceJid = String(d.deviceJid); + } + if (d.clientTimestampMs != null) { + if ($util.Long) + (m.clientTimestampMs = $util.Long.fromValue(d.clientTimestampMs)).unsigned = false; + else if (typeof d.clientTimestampMs === "string") + m.clientTimestampMs = parseInt(d.clientTimestampMs, 10); + else if (typeof d.clientTimestampMs === "number") + m.clientTimestampMs = d.clientTimestampMs; + else if (typeof d.clientTimestampMs === "object") + m.clientTimestampMs = new $util.LongBits(d.clientTimestampMs.low >>> 0, d.clientTimestampMs.high >>> 0).toNumber(); + } + if (d.serverTimestampMs != null) { + if ($util.Long) + (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false; + else if (typeof d.serverTimestampMs === "string") + m.serverTimestampMs = parseInt(d.serverTimestampMs, 10); + else if (typeof d.serverTimestampMs === "number") + m.serverTimestampMs = d.serverTimestampMs; + else if (typeof d.serverTimestampMs === "object") + m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber(); + } + return m; + }; + + KeepInChat.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.keepType != null && m.hasOwnProperty("keepType")) { + d.keepType = o.enums === String ? $root.proto.KeepType[m.keepType] === undefined ? m.keepType : $root.proto.KeepType[m.keepType] : m.keepType; + if (o.oneofs) + d._keepType = "keepType"; + } + if (m.serverTimestamp != null && m.hasOwnProperty("serverTimestamp")) { + if (typeof m.serverTimestamp === "number") + d.serverTimestamp = o.longs === String ? String(m.serverTimestamp) : m.serverTimestamp; + else + d.serverTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestamp) : o.longs === Number ? new $util.LongBits(m.serverTimestamp.low >>> 0, m.serverTimestamp.high >>> 0).toNumber() : m.serverTimestamp; + if (o.oneofs) + d._serverTimestamp = "serverTimestamp"; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.deviceJid != null && m.hasOwnProperty("deviceJid")) { + d.deviceJid = m.deviceJid; + if (o.oneofs) + d._deviceJid = "deviceJid"; + } + if (m.clientTimestampMs != null && m.hasOwnProperty("clientTimestampMs")) { + if (typeof m.clientTimestampMs === "number") + d.clientTimestampMs = o.longs === String ? String(m.clientTimestampMs) : m.clientTimestampMs; + else + d.clientTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.clientTimestampMs) : o.longs === Number ? new $util.LongBits(m.clientTimestampMs.low >>> 0, m.clientTimestampMs.high >>> 0).toNumber() : m.clientTimestampMs; + if (o.oneofs) + d._clientTimestampMs = "clientTimestampMs"; + } + if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) { + if (typeof m.serverTimestampMs === "number") + d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; + else + d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + if (o.oneofs) + d._serverTimestampMs = "serverTimestampMs"; + } + return d; + }; + + KeepInChat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeepInChat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12039,11 +27238,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - KeyExchangeMessage.prototype.id = 0; - KeyExchangeMessage.prototype.baseKey = $util.newBuffer([]); - KeyExchangeMessage.prototype.ratchetKey = $util.newBuffer([]); - KeyExchangeMessage.prototype.identityKey = $util.newBuffer([]); - KeyExchangeMessage.prototype.baseKeySignature = $util.newBuffer([]); + KeyExchangeMessage.prototype.id = null; + KeyExchangeMessage.prototype.baseKey = null; + KeyExchangeMessage.prototype.ratchetKey = null; + KeyExchangeMessage.prototype.identityKey = null; + KeyExchangeMessage.prototype.baseKeySignature = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyExchangeMessage.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyExchangeMessage.prototype, "_baseKey", { + get: $util.oneOfGetter($oneOfFields = ["baseKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyExchangeMessage.prototype, "_ratchetKey", { + get: $util.oneOfGetter($oneOfFields = ["ratchetKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyExchangeMessage.prototype, "_identityKey", { + get: $util.oneOfGetter($oneOfFields = ["identityKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyExchangeMessage.prototype, "_baseKeySignature", { + get: $util.oneOfGetter($oneOfFields = ["baseKeySignature"]), + set: $util.oneOfSetter($oneOfFields) + }); KeyExchangeMessage.create = function create(properties) { return new KeyExchangeMessage(properties); @@ -12102,6 +27333,76 @@ export const proto = $root.proto = (() => { return m; }; + KeyExchangeMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.KeyExchangeMessage) + return d; + var m = new $root.proto.KeyExchangeMessage(); + if (d.id != null) { + m.id = d.id >>> 0; + } + if (d.baseKey != null) { + if (typeof d.baseKey === "string") + $util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0); + else if (d.baseKey.length >= 0) + m.baseKey = d.baseKey; + } + if (d.ratchetKey != null) { + if (typeof d.ratchetKey === "string") + $util.base64.decode(d.ratchetKey, m.ratchetKey = $util.newBuffer($util.base64.length(d.ratchetKey)), 0); + else if (d.ratchetKey.length >= 0) + m.ratchetKey = d.ratchetKey; + } + if (d.identityKey != null) { + if (typeof d.identityKey === "string") + $util.base64.decode(d.identityKey, m.identityKey = $util.newBuffer($util.base64.length(d.identityKey)), 0); + else if (d.identityKey.length >= 0) + m.identityKey = d.identityKey; + } + if (d.baseKeySignature != null) { + if (typeof d.baseKeySignature === "string") + $util.base64.decode(d.baseKeySignature, m.baseKeySignature = $util.newBuffer($util.base64.length(d.baseKeySignature)), 0); + else if (d.baseKeySignature.length >= 0) + m.baseKeySignature = d.baseKeySignature; + } + return m; + }; + + KeyExchangeMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.baseKey != null && m.hasOwnProperty("baseKey")) { + d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey; + if (o.oneofs) + d._baseKey = "baseKey"; + } + if (m.ratchetKey != null && m.hasOwnProperty("ratchetKey")) { + d.ratchetKey = o.bytes === String ? $util.base64.encode(m.ratchetKey, 0, m.ratchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.ratchetKey) : m.ratchetKey; + if (o.oneofs) + d._ratchetKey = "ratchetKey"; + } + if (m.identityKey != null && m.hasOwnProperty("identityKey")) { + d.identityKey = o.bytes === String ? $util.base64.encode(m.identityKey, 0, m.identityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.identityKey) : m.identityKey; + if (o.oneofs) + d._identityKey = "identityKey"; + } + if (m.baseKeySignature != null && m.hasOwnProperty("baseKeySignature")) { + d.baseKeySignature = o.bytes === String ? $util.base64.encode(m.baseKeySignature, 0, m.baseKeySignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKeySignature) : m.baseKeySignature; + if (o.oneofs) + d._baseKeySignature = "baseKeySignature"; + } + return d; + }; + + KeyExchangeMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeyExchangeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12121,7 +27422,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - KeyId.prototype.id = $util.newBuffer([]); + KeyId.prototype.id = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyId.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); KeyId.create = function create(properties) { return new KeyId(properties); @@ -12156,6 +27465,35 @@ export const proto = $root.proto = (() => { return m; }; + KeyId.fromObject = function fromObject(d) { + if (d instanceof $root.proto.KeyId) + return d; + var m = new $root.proto.KeyId(); + if (d.id != null) { + if (typeof d.id === "string") + $util.base64.decode(d.id, m.id = $util.newBuffer($util.base64.length(d.id)), 0); + else if (d.id.length >= 0) + m.id = d.id; + } + return m; + }; + + KeyId.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = o.bytes === String ? $util.base64.encode(m.id, 0, m.id.length) : o.bytes === Array ? Array.prototype.slice.call(m.id) : m.id; + if (o.oneofs) + d._id = "id"; + } + return d; + }; + + KeyId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12177,7 +27515,15 @@ export const proto = $root.proto = (() => { LIDMigrationMapping.prototype.pn = $util.Long ? $util.Long.fromBits(0,0,true) : 0; LIDMigrationMapping.prototype.assignedLid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - LIDMigrationMapping.prototype.latestLid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LIDMigrationMapping.prototype.latestLid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LIDMigrationMapping.prototype, "_latestLid", { + get: $util.oneOfGetter($oneOfFields = ["latestLid"]), + set: $util.oneOfSetter($oneOfFields) + }); LIDMigrationMapping.create = function create(properties) { return new LIDMigrationMapping(properties); @@ -12186,8 +27532,10 @@ export const proto = $root.proto = (() => { LIDMigrationMapping.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(8).uint64(m.pn); - w.uint32(16).uint64(m.assignedLid); + if (m.pn != null && Object.hasOwnProperty.call(m, "pn")) + w.uint32(8).uint64(m.pn); + if (m.assignedLid != null && Object.hasOwnProperty.call(m, "assignedLid")) + w.uint32(16).uint64(m.assignedLid); if (m.latestLid != null && Object.hasOwnProperty.call(m, "latestLid")) w.uint32(24).uint64(m.latestLid); return w; @@ -12219,13 +27567,89 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("pn")) - throw $util.ProtocolError("missing required 'pn'", { instance: m }); - if (!m.hasOwnProperty("assignedLid")) - throw $util.ProtocolError("missing required 'assignedLid'", { instance: m }); return m; }; + LIDMigrationMapping.fromObject = function fromObject(d) { + if (d instanceof $root.proto.LIDMigrationMapping) + return d; + var m = new $root.proto.LIDMigrationMapping(); + if (d.pn != null) { + if ($util.Long) + (m.pn = $util.Long.fromValue(d.pn)).unsigned = true; + else if (typeof d.pn === "string") + m.pn = parseInt(d.pn, 10); + else if (typeof d.pn === "number") + m.pn = d.pn; + else if (typeof d.pn === "object") + m.pn = new $util.LongBits(d.pn.low >>> 0, d.pn.high >>> 0).toNumber(true); + } + if (d.assignedLid != null) { + if ($util.Long) + (m.assignedLid = $util.Long.fromValue(d.assignedLid)).unsigned = true; + else if (typeof d.assignedLid === "string") + m.assignedLid = parseInt(d.assignedLid, 10); + else if (typeof d.assignedLid === "number") + m.assignedLid = d.assignedLid; + else if (typeof d.assignedLid === "object") + m.assignedLid = new $util.LongBits(d.assignedLid.low >>> 0, d.assignedLid.high >>> 0).toNumber(true); + } + if (d.latestLid != null) { + if ($util.Long) + (m.latestLid = $util.Long.fromValue(d.latestLid)).unsigned = true; + else if (typeof d.latestLid === "string") + m.latestLid = parseInt(d.latestLid, 10); + else if (typeof d.latestLid === "number") + m.latestLid = d.latestLid; + else if (typeof d.latestLid === "object") + m.latestLid = new $util.LongBits(d.latestLid.low >>> 0, d.latestLid.high >>> 0).toNumber(true); + } + return m; + }; + + LIDMigrationMapping.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + if ($util.Long) { + var n = new $util.Long(0, 0, true); + d.pn = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.pn = o.longs === String ? "0" : 0; + if ($util.Long) { + var n = new $util.Long(0, 0, true); + d.assignedLid = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.assignedLid = o.longs === String ? "0" : 0; + } + if (m.pn != null && m.hasOwnProperty("pn")) { + if (typeof m.pn === "number") + d.pn = o.longs === String ? String(m.pn) : m.pn; + else + d.pn = o.longs === String ? $util.Long.prototype.toString.call(m.pn) : o.longs === Number ? new $util.LongBits(m.pn.low >>> 0, m.pn.high >>> 0).toNumber(true) : m.pn; + } + if (m.assignedLid != null && m.hasOwnProperty("assignedLid")) { + if (typeof m.assignedLid === "number") + d.assignedLid = o.longs === String ? String(m.assignedLid) : m.assignedLid; + else + d.assignedLid = o.longs === String ? $util.Long.prototype.toString.call(m.assignedLid) : o.longs === Number ? new $util.LongBits(m.assignedLid.low >>> 0, m.assignedLid.high >>> 0).toNumber(true) : m.assignedLid; + } + if (m.latestLid != null && m.hasOwnProperty("latestLid")) { + if (typeof m.latestLid === "number") + d.latestLid = o.longs === String ? String(m.latestLid) : m.latestLid; + else + d.latestLid = o.longs === String ? $util.Long.prototype.toString.call(m.latestLid) : o.longs === Number ? new $util.LongBits(m.latestLid.low >>> 0, m.latestLid.high >>> 0).toNumber(true) : m.latestLid; + if (o.oneofs) + d._latestLid = "latestLid"; + } + return d; + }; + + LIDMigrationMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LIDMigrationMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12245,7 +27669,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LIDMigrationMappingSyncMessage.prototype.encodedMappingPayload = $util.newBuffer([]); + LIDMigrationMappingSyncMessage.prototype.encodedMappingPayload = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LIDMigrationMappingSyncMessage.prototype, "_encodedMappingPayload", { + get: $util.oneOfGetter($oneOfFields = ["encodedMappingPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); LIDMigrationMappingSyncMessage.create = function create(properties) { return new LIDMigrationMappingSyncMessage(properties); @@ -12280,6 +27712,35 @@ export const proto = $root.proto = (() => { return m; }; + LIDMigrationMappingSyncMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.LIDMigrationMappingSyncMessage) + return d; + var m = new $root.proto.LIDMigrationMappingSyncMessage(); + if (d.encodedMappingPayload != null) { + if (typeof d.encodedMappingPayload === "string") + $util.base64.decode(d.encodedMappingPayload, m.encodedMappingPayload = $util.newBuffer($util.base64.length(d.encodedMappingPayload)), 0); + else if (d.encodedMappingPayload.length >= 0) + m.encodedMappingPayload = d.encodedMappingPayload; + } + return m; + }; + + LIDMigrationMappingSyncMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.encodedMappingPayload != null && m.hasOwnProperty("encodedMappingPayload")) { + d.encodedMappingPayload = o.bytes === String ? $util.base64.encode(m.encodedMappingPayload, 0, m.encodedMappingPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encodedMappingPayload) : m.encodedMappingPayload; + if (o.oneofs) + d._encodedMappingPayload = "encodedMappingPayload"; + } + return d; + }; + + LIDMigrationMappingSyncMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LIDMigrationMappingSyncMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12301,7 +27762,15 @@ export const proto = $root.proto = (() => { } LIDMigrationMappingSyncPayload.prototype.pnToLidMappings = $util.emptyArray; - LIDMigrationMappingSyncPayload.prototype.chatDbMigrationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LIDMigrationMappingSyncPayload.prototype.chatDbMigrationTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LIDMigrationMappingSyncPayload.prototype, "_chatDbMigrationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["chatDbMigrationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); LIDMigrationMappingSyncPayload.create = function create(properties) { return new LIDMigrationMappingSyncPayload(properties); @@ -12346,6 +27815,61 @@ export const proto = $root.proto = (() => { return m; }; + LIDMigrationMappingSyncPayload.fromObject = function fromObject(d) { + if (d instanceof $root.proto.LIDMigrationMappingSyncPayload) + return d; + var m = new $root.proto.LIDMigrationMappingSyncPayload(); + if (d.pnToLidMappings) { + if (!Array.isArray(d.pnToLidMappings)) + throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected"); + m.pnToLidMappings = []; + for (var i = 0; i < d.pnToLidMappings.length; ++i) { + if (typeof d.pnToLidMappings[i] !== "object") + throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: object expected"); + m.pnToLidMappings[i] = $root.proto.LIDMigrationMapping.fromObject(d.pnToLidMappings[i]); + } + } + if (d.chatDbMigrationTimestamp != null) { + if ($util.Long) + (m.chatDbMigrationTimestamp = $util.Long.fromValue(d.chatDbMigrationTimestamp)).unsigned = true; + else if (typeof d.chatDbMigrationTimestamp === "string") + m.chatDbMigrationTimestamp = parseInt(d.chatDbMigrationTimestamp, 10); + else if (typeof d.chatDbMigrationTimestamp === "number") + m.chatDbMigrationTimestamp = d.chatDbMigrationTimestamp; + else if (typeof d.chatDbMigrationTimestamp === "object") + m.chatDbMigrationTimestamp = new $util.LongBits(d.chatDbMigrationTimestamp.low >>> 0, d.chatDbMigrationTimestamp.high >>> 0).toNumber(true); + } + return m; + }; + + LIDMigrationMappingSyncPayload.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.pnToLidMappings = []; + } + if (m.pnToLidMappings && m.pnToLidMappings.length) { + d.pnToLidMappings = []; + for (var j = 0; j < m.pnToLidMappings.length; ++j) { + d.pnToLidMappings[j] = $root.proto.LIDMigrationMapping.toObject(m.pnToLidMappings[j], o); + } + } + if (m.chatDbMigrationTimestamp != null && m.hasOwnProperty("chatDbMigrationTimestamp")) { + if (typeof m.chatDbMigrationTimestamp === "number") + d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp; + else + d.chatDbMigrationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.chatDbMigrationTimestamp) : o.longs === Number ? new $util.LongBits(m.chatDbMigrationTimestamp.low >>> 0, m.chatDbMigrationTimestamp.high >>> 0).toNumber(true) : m.chatDbMigrationTimestamp; + if (o.oneofs) + d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp"; + } + return d; + }; + + LIDMigrationMappingSyncPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LIDMigrationMappingSyncPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12368,6 +27892,20 @@ export const proto = $root.proto = (() => { LegacyMessage.prototype.eventResponseMessage = null; LegacyMessage.prototype.pollVote = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LegacyMessage.prototype, "_eventResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["eventResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LegacyMessage.prototype, "_pollVote", { + get: $util.oneOfGetter($oneOfFields = ["pollVote"]), + set: $util.oneOfSetter($oneOfFields) + }); + LegacyMessage.create = function create(properties) { return new LegacyMessage(properties); }; @@ -12407,6 +27945,44 @@ export const proto = $root.proto = (() => { return m; }; + LegacyMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.LegacyMessage) + return d; + var m = new $root.proto.LegacyMessage(); + if (d.eventResponseMessage != null) { + if (typeof d.eventResponseMessage !== "object") + throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected"); + m.eventResponseMessage = $root.proto.Message.EventResponseMessage.fromObject(d.eventResponseMessage); + } + if (d.pollVote != null) { + if (typeof d.pollVote !== "object") + throw TypeError(".proto.LegacyMessage.pollVote: object expected"); + m.pollVote = $root.proto.Message.PollVoteMessage.fromObject(d.pollVote); + } + return m; + }; + + LegacyMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.eventResponseMessage != null && m.hasOwnProperty("eventResponseMessage")) { + d.eventResponseMessage = $root.proto.Message.EventResponseMessage.toObject(m.eventResponseMessage, o); + if (o.oneofs) + d._eventResponseMessage = "eventResponseMessage"; + } + if (m.pollVote != null && m.hasOwnProperty("pollVote")) { + d.pollVote = $root.proto.Message.PollVoteMessage.toObject(m.pollVote, o); + if (o.oneofs) + d._pollVote = "pollVote"; + } + return d; + }; + + LegacyMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LegacyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12426,10 +28002,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LimitSharing.prototype.sharingLimited = false; - LimitSharing.prototype.trigger = 0; - LimitSharing.prototype.limitSharingSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - LimitSharing.prototype.initiatedByMe = false; + LimitSharing.prototype.sharingLimited = null; + LimitSharing.prototype.trigger = null; + LimitSharing.prototype.limitSharingSettingTimestamp = null; + LimitSharing.prototype.initiatedByMe = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LimitSharing.prototype, "_sharingLimited", { + get: $util.oneOfGetter($oneOfFields = ["sharingLimited"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LimitSharing.prototype, "_trigger", { + get: $util.oneOfGetter($oneOfFields = ["trigger"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LimitSharing.prototype, "_limitSharingSettingTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["limitSharingSettingTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LimitSharing.prototype, "_initiatedByMe", { + get: $util.oneOfGetter($oneOfFields = ["initiatedByMe"]), + set: $util.oneOfSetter($oneOfFields) + }); LimitSharing.create = function create(properties) { return new LimitSharing(properties); @@ -12482,6 +28084,87 @@ export const proto = $root.proto = (() => { return m; }; + LimitSharing.fromObject = function fromObject(d) { + if (d instanceof $root.proto.LimitSharing) + return d; + var m = new $root.proto.LimitSharing(); + if (d.sharingLimited != null) { + m.sharingLimited = Boolean(d.sharingLimited); + } + switch (d.trigger) { + default: + if (typeof d.trigger === "number") { + m.trigger = d.trigger; + break; + } + break; + case "UNKNOWN": + case 0: + m.trigger = 0; + break; + case "CHAT_SETTING": + case 1: + m.trigger = 1; + break; + case "BIZ_SUPPORTS_FB_HOSTING": + case 2: + m.trigger = 2; + break; + case "UNKNOWN_GROUP": + case 3: + m.trigger = 3; + break; + } + if (d.limitSharingSettingTimestamp != null) { + if ($util.Long) + (m.limitSharingSettingTimestamp = $util.Long.fromValue(d.limitSharingSettingTimestamp)).unsigned = false; + else if (typeof d.limitSharingSettingTimestamp === "string") + m.limitSharingSettingTimestamp = parseInt(d.limitSharingSettingTimestamp, 10); + else if (typeof d.limitSharingSettingTimestamp === "number") + m.limitSharingSettingTimestamp = d.limitSharingSettingTimestamp; + else if (typeof d.limitSharingSettingTimestamp === "object") + m.limitSharingSettingTimestamp = new $util.LongBits(d.limitSharingSettingTimestamp.low >>> 0, d.limitSharingSettingTimestamp.high >>> 0).toNumber(); + } + if (d.initiatedByMe != null) { + m.initiatedByMe = Boolean(d.initiatedByMe); + } + return m; + }; + + LimitSharing.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.sharingLimited != null && m.hasOwnProperty("sharingLimited")) { + d.sharingLimited = m.sharingLimited; + if (o.oneofs) + d._sharingLimited = "sharingLimited"; + } + if (m.trigger != null && m.hasOwnProperty("trigger")) { + d.trigger = o.enums === String ? $root.proto.LimitSharing.TriggerType[m.trigger] === undefined ? m.trigger : $root.proto.LimitSharing.TriggerType[m.trigger] : m.trigger; + if (o.oneofs) + d._trigger = "trigger"; + } + if (m.limitSharingSettingTimestamp != null && m.hasOwnProperty("limitSharingSettingTimestamp")) { + if (typeof m.limitSharingSettingTimestamp === "number") + d.limitSharingSettingTimestamp = o.longs === String ? String(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp; + else + d.limitSharingSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.limitSharingSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.limitSharingSettingTimestamp.low >>> 0, m.limitSharingSettingTimestamp.high >>> 0).toNumber() : m.limitSharingSettingTimestamp; + if (o.oneofs) + d._limitSharingSettingTimestamp = "limitSharingSettingTimestamp"; + } + if (m.initiatedByMe != null && m.hasOwnProperty("initiatedByMe")) { + d.initiatedByMe = m.initiatedByMe; + if (o.oneofs) + d._initiatedByMe = "initiatedByMe"; + } + return d; + }; + + LimitSharing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LimitSharing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12510,9 +28193,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LocalizedName.prototype.lg = ""; - LocalizedName.prototype.lc = ""; - LocalizedName.prototype.verifiedName = ""; + LocalizedName.prototype.lg = null; + LocalizedName.prototype.lc = null; + LocalizedName.prototype.verifiedName = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocalizedName.prototype, "_lg", { + get: $util.oneOfGetter($oneOfFields = ["lg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocalizedName.prototype, "_lc", { + get: $util.oneOfGetter($oneOfFields = ["lc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocalizedName.prototype, "_verifiedName", { + get: $util.oneOfGetter($oneOfFields = ["verifiedName"]), + set: $util.oneOfSetter($oneOfFields) + }); LocalizedName.create = function create(properties) { return new LocalizedName(properties); @@ -12559,6 +28262,48 @@ export const proto = $root.proto = (() => { return m; }; + LocalizedName.fromObject = function fromObject(d) { + if (d instanceof $root.proto.LocalizedName) + return d; + var m = new $root.proto.LocalizedName(); + if (d.lg != null) { + m.lg = String(d.lg); + } + if (d.lc != null) { + m.lc = String(d.lc); + } + if (d.verifiedName != null) { + m.verifiedName = String(d.verifiedName); + } + return m; + }; + + LocalizedName.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.lg != null && m.hasOwnProperty("lg")) { + d.lg = m.lg; + if (o.oneofs) + d._lg = "lg"; + } + if (m.lc != null && m.hasOwnProperty("lc")) { + d.lc = m.lc; + if (o.oneofs) + d._lc = "lc"; + } + if (m.verifiedName != null && m.hasOwnProperty("verifiedName")) { + d.verifiedName = m.verifiedName; + if (o.oneofs) + d._verifiedName = "verifiedName"; + } + return d; + }; + + LocalizedName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LocalizedName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12578,9 +28323,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Location.prototype.degreesLatitude = 0; - Location.prototype.degreesLongitude = 0; - Location.prototype.name = ""; + Location.prototype.degreesLatitude = null; + Location.prototype.degreesLongitude = null; + Location.prototype.name = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Location.prototype, "_degreesLatitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Location.prototype, "_degreesLongitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Location.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); Location.create = function create(properties) { return new Location(properties); @@ -12627,6 +28392,48 @@ export const proto = $root.proto = (() => { return m; }; + Location.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Location) + return d; + var m = new $root.proto.Location(); + if (d.degreesLatitude != null) { + m.degreesLatitude = Number(d.degreesLatitude); + } + if (d.degreesLongitude != null) { + m.degreesLongitude = Number(d.degreesLongitude); + } + if (d.name != null) { + m.name = String(d.name); + } + return m; + }; + + Location.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) { + d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude; + if (o.oneofs) + d._degreesLatitude = "degreesLatitude"; + } + if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) { + d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude; + if (o.oneofs) + d._degreesLongitude = "degreesLongitude"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + return d; + }; + + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12646,7 +28453,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MediaData.prototype.localPath = ""; + MediaData.prototype.localPath = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaData.prototype, "_localPath", { + get: $util.oneOfGetter($oneOfFields = ["localPath"]), + set: $util.oneOfSetter($oneOfFields) + }); MediaData.create = function create(properties) { return new MediaData(properties); @@ -12681,6 +28496,32 @@ export const proto = $root.proto = (() => { return m; }; + MediaData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MediaData) + return d; + var m = new $root.proto.MediaData(); + if (d.localPath != null) { + m.localPath = String(d.localPath); + } + return m; + }; + + MediaData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.localPath != null && m.hasOwnProperty("localPath")) { + d.localPath = m.localPath; + if (o.oneofs) + d._localPath = "localPath"; + } + return d; + }; + + MediaData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MediaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12700,9 +28541,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MediaNotifyMessage.prototype.expressPathUrl = ""; - MediaNotifyMessage.prototype.fileEncSha256 = $util.newBuffer([]); - MediaNotifyMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + MediaNotifyMessage.prototype.expressPathUrl = null; + MediaNotifyMessage.prototype.fileEncSha256 = null; + MediaNotifyMessage.prototype.fileLength = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaNotifyMessage.prototype, "_expressPathUrl", { + get: $util.oneOfGetter($oneOfFields = ["expressPathUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaNotifyMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaNotifyMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); MediaNotifyMessage.create = function create(properties) { return new MediaNotifyMessage(properties); @@ -12749,6 +28610,61 @@ export const proto = $root.proto = (() => { return m; }; + MediaNotifyMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MediaNotifyMessage) + return d; + var m = new $root.proto.MediaNotifyMessage(); + if (d.expressPathUrl != null) { + m.expressPathUrl = String(d.expressPathUrl); + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + return m; + }; + + MediaNotifyMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.expressPathUrl != null && m.hasOwnProperty("expressPathUrl")) { + d.expressPathUrl = m.expressPathUrl; + if (o.oneofs) + d._expressPathUrl = "expressPathUrl"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + return d; + }; + + MediaNotifyMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MediaNotifyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12768,10 +28684,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MediaRetryNotification.prototype.stanzaId = ""; - MediaRetryNotification.prototype.directPath = ""; - MediaRetryNotification.prototype.result = 0; - MediaRetryNotification.prototype.messageSecret = $util.newBuffer([]); + MediaRetryNotification.prototype.stanzaId = null; + MediaRetryNotification.prototype.directPath = null; + MediaRetryNotification.prototype.result = null; + MediaRetryNotification.prototype.messageSecret = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaRetryNotification.prototype, "_stanzaId", { + get: $util.oneOfGetter($oneOfFields = ["stanzaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaRetryNotification.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaRetryNotification.prototype, "_result", { + get: $util.oneOfGetter($oneOfFields = ["result"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaRetryNotification.prototype, "_messageSecret", { + get: $util.oneOfGetter($oneOfFields = ["messageSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); MediaRetryNotification.create = function create(properties) { return new MediaRetryNotification(properties); @@ -12824,6 +28766,80 @@ export const proto = $root.proto = (() => { return m; }; + MediaRetryNotification.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MediaRetryNotification) + return d; + var m = new $root.proto.MediaRetryNotification(); + if (d.stanzaId != null) { + m.stanzaId = String(d.stanzaId); + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + switch (d.result) { + default: + if (typeof d.result === "number") { + m.result = d.result; + break; + } + break; + case "GENERAL_ERROR": + case 0: + m.result = 0; + break; + case "SUCCESS": + case 1: + m.result = 1; + break; + case "NOT_FOUND": + case 2: + m.result = 2; + break; + case "DECRYPTION_ERROR": + case 3: + m.result = 3; + break; + } + if (d.messageSecret != null) { + if (typeof d.messageSecret === "string") + $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0); + else if (d.messageSecret.length >= 0) + m.messageSecret = d.messageSecret; + } + return m; + }; + + MediaRetryNotification.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) { + d.stanzaId = m.stanzaId; + if (o.oneofs) + d._stanzaId = "stanzaId"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.result != null && m.hasOwnProperty("result")) { + d.result = o.enums === String ? $root.proto.MediaRetryNotification.ResultType[m.result] === undefined ? m.result : $root.proto.MediaRetryNotification.ResultType[m.result] : m.result; + if (o.oneofs) + d._result = "result"; + } + if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) { + d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret; + if (o.oneofs) + d._messageSecret = "messageSecret"; + } + return d; + }; + + MediaRetryNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MediaRetryNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12860,8 +28876,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MemberLabel.prototype.label = ""; - MemberLabel.prototype.labelTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MemberLabel.prototype.label = null; + MemberLabel.prototype.labelTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MemberLabel.prototype, "_label", { + get: $util.oneOfGetter($oneOfFields = ["label"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MemberLabel.prototype, "_labelTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["labelTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); MemberLabel.create = function create(properties) { return new MemberLabel(properties); @@ -12902,6 +28932,50 @@ export const proto = $root.proto = (() => { return m; }; + MemberLabel.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MemberLabel) + return d; + var m = new $root.proto.MemberLabel(); + if (d.label != null) { + m.label = String(d.label); + } + if (d.labelTimestamp != null) { + if ($util.Long) + (m.labelTimestamp = $util.Long.fromValue(d.labelTimestamp)).unsigned = false; + else if (typeof d.labelTimestamp === "string") + m.labelTimestamp = parseInt(d.labelTimestamp, 10); + else if (typeof d.labelTimestamp === "number") + m.labelTimestamp = d.labelTimestamp; + else if (typeof d.labelTimestamp === "object") + m.labelTimestamp = new $util.LongBits(d.labelTimestamp.low >>> 0, d.labelTimestamp.high >>> 0).toNumber(); + } + return m; + }; + + MemberLabel.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.label != null && m.hasOwnProperty("label")) { + d.label = m.label; + if (o.oneofs) + d._label = "label"; + } + if (m.labelTimestamp != null && m.hasOwnProperty("labelTimestamp")) { + if (typeof m.labelTimestamp === "number") + d.labelTimestamp = o.longs === String ? String(m.labelTimestamp) : m.labelTimestamp; + else + d.labelTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.labelTimestamp) : o.longs === Number ? new $util.LongBits(m.labelTimestamp.low >>> 0, m.labelTimestamp.high >>> 0).toNumber() : m.labelTimestamp; + if (o.oneofs) + d._labelTimestamp = "labelTimestamp"; + } + return d; + }; + + MemberLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MemberLabel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -12921,7 +28995,7 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Message.prototype.conversation = ""; + Message.prototype.conversation = null; Message.prototype.senderKeyDistributionMessage = null; Message.prototype.imageMessage = null; Message.prototype.contactMessage = null; @@ -13008,6 +29082,524 @@ export const proto = $root.proto = (() => { Message.prototype.questionMessage = null; Message.prototype.messageHistoryNotice = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_conversation", { + get: $util.oneOfGetter($oneOfFields = ["conversation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_senderKeyDistributionMessage", { + get: $util.oneOfGetter($oneOfFields = ["senderKeyDistributionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_imageMessage", { + get: $util.oneOfGetter($oneOfFields = ["imageMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_contactMessage", { + get: $util.oneOfGetter($oneOfFields = ["contactMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_locationMessage", { + get: $util.oneOfGetter($oneOfFields = ["locationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_extendedTextMessage", { + get: $util.oneOfGetter($oneOfFields = ["extendedTextMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_documentMessage", { + get: $util.oneOfGetter($oneOfFields = ["documentMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_audioMessage", { + get: $util.oneOfGetter($oneOfFields = ["audioMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_videoMessage", { + get: $util.oneOfGetter($oneOfFields = ["videoMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_call", { + get: $util.oneOfGetter($oneOfFields = ["call"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_chat", { + get: $util.oneOfGetter($oneOfFields = ["chat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_protocolMessage", { + get: $util.oneOfGetter($oneOfFields = ["protocolMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_contactsArrayMessage", { + get: $util.oneOfGetter($oneOfFields = ["contactsArrayMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_highlyStructuredMessage", { + get: $util.oneOfGetter($oneOfFields = ["highlyStructuredMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_fastRatchetKeySenderKeyDistributionMessage", { + get: $util.oneOfGetter($oneOfFields = ["fastRatchetKeySenderKeyDistributionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_sendPaymentMessage", { + get: $util.oneOfGetter($oneOfFields = ["sendPaymentMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_liveLocationMessage", { + get: $util.oneOfGetter($oneOfFields = ["liveLocationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_requestPaymentMessage", { + get: $util.oneOfGetter($oneOfFields = ["requestPaymentMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_declinePaymentRequestMessage", { + get: $util.oneOfGetter($oneOfFields = ["declinePaymentRequestMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_cancelPaymentRequestMessage", { + get: $util.oneOfGetter($oneOfFields = ["cancelPaymentRequestMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_templateMessage", { + get: $util.oneOfGetter($oneOfFields = ["templateMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_stickerMessage", { + get: $util.oneOfGetter($oneOfFields = ["stickerMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_groupInviteMessage", { + get: $util.oneOfGetter($oneOfFields = ["groupInviteMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_templateButtonReplyMessage", { + get: $util.oneOfGetter($oneOfFields = ["templateButtonReplyMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_productMessage", { + get: $util.oneOfGetter($oneOfFields = ["productMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_deviceSentMessage", { + get: $util.oneOfGetter($oneOfFields = ["deviceSentMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_messageContextInfo", { + get: $util.oneOfGetter($oneOfFields = ["messageContextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_listMessage", { + get: $util.oneOfGetter($oneOfFields = ["listMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_viewOnceMessage", { + get: $util.oneOfGetter($oneOfFields = ["viewOnceMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_orderMessage", { + get: $util.oneOfGetter($oneOfFields = ["orderMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_listResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["listResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_ephemeralMessage", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_invoiceMessage", { + get: $util.oneOfGetter($oneOfFields = ["invoiceMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_buttonsMessage", { + get: $util.oneOfGetter($oneOfFields = ["buttonsMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_buttonsResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["buttonsResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_paymentInviteMessage", { + get: $util.oneOfGetter($oneOfFields = ["paymentInviteMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_interactiveMessage", { + get: $util.oneOfGetter($oneOfFields = ["interactiveMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_reactionMessage", { + get: $util.oneOfGetter($oneOfFields = ["reactionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_stickerSyncRmrMessage", { + get: $util.oneOfGetter($oneOfFields = ["stickerSyncRmrMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_interactiveResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["interactiveResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollCreationMessage", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollUpdateMessage", { + get: $util.oneOfGetter($oneOfFields = ["pollUpdateMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_keepInChatMessage", { + get: $util.oneOfGetter($oneOfFields = ["keepInChatMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_documentWithCaptionMessage", { + get: $util.oneOfGetter($oneOfFields = ["documentWithCaptionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_requestPhoneNumberMessage", { + get: $util.oneOfGetter($oneOfFields = ["requestPhoneNumberMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_viewOnceMessageV2", { + get: $util.oneOfGetter($oneOfFields = ["viewOnceMessageV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_encReactionMessage", { + get: $util.oneOfGetter($oneOfFields = ["encReactionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_editedMessage", { + get: $util.oneOfGetter($oneOfFields = ["editedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_viewOnceMessageV2Extension", { + get: $util.oneOfGetter($oneOfFields = ["viewOnceMessageV2Extension"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollCreationMessageV2", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_scheduledCallCreationMessage", { + get: $util.oneOfGetter($oneOfFields = ["scheduledCallCreationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_groupMentionedMessage", { + get: $util.oneOfGetter($oneOfFields = ["groupMentionedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pinInChatMessage", { + get: $util.oneOfGetter($oneOfFields = ["pinInChatMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollCreationMessageV3", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV3"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_scheduledCallEditMessage", { + get: $util.oneOfGetter($oneOfFields = ["scheduledCallEditMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_ptvMessage", { + get: $util.oneOfGetter($oneOfFields = ["ptvMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_botInvokeMessage", { + get: $util.oneOfGetter($oneOfFields = ["botInvokeMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_callLogMesssage", { + get: $util.oneOfGetter($oneOfFields = ["callLogMesssage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_messageHistoryBundle", { + get: $util.oneOfGetter($oneOfFields = ["messageHistoryBundle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_encCommentMessage", { + get: $util.oneOfGetter($oneOfFields = ["encCommentMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_bcallMessage", { + get: $util.oneOfGetter($oneOfFields = ["bcallMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_lottieStickerMessage", { + get: $util.oneOfGetter($oneOfFields = ["lottieStickerMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_eventMessage", { + get: $util.oneOfGetter($oneOfFields = ["eventMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_encEventResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["encEventResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_commentMessage", { + get: $util.oneOfGetter($oneOfFields = ["commentMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_newsletterAdminInviteMessage", { + get: $util.oneOfGetter($oneOfFields = ["newsletterAdminInviteMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_placeholderMessage", { + get: $util.oneOfGetter($oneOfFields = ["placeholderMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_secretEncryptedMessage", { + get: $util.oneOfGetter($oneOfFields = ["secretEncryptedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_albumMessage", { + get: $util.oneOfGetter($oneOfFields = ["albumMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_eventCoverImage", { + get: $util.oneOfGetter($oneOfFields = ["eventCoverImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_stickerPackMessage", { + get: $util.oneOfGetter($oneOfFields = ["stickerPackMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_statusMentionMessage", { + get: $util.oneOfGetter($oneOfFields = ["statusMentionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollResultSnapshotMessage", { + get: $util.oneOfGetter($oneOfFields = ["pollResultSnapshotMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollCreationOptionImageMessage", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationOptionImageMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_associatedChildMessage", { + get: $util.oneOfGetter($oneOfFields = ["associatedChildMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_groupStatusMentionMessage", { + get: $util.oneOfGetter($oneOfFields = ["groupStatusMentionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollCreationMessageV4", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV4"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_pollCreationMessageV5", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageV5"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_statusAddYours", { + get: $util.oneOfGetter($oneOfFields = ["statusAddYours"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_groupStatusMessage", { + get: $util.oneOfGetter($oneOfFields = ["groupStatusMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_richResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["richResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_statusNotificationMessage", { + get: $util.oneOfGetter($oneOfFields = ["statusNotificationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_limitSharingMessage", { + get: $util.oneOfGetter($oneOfFields = ["limitSharingMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_botTaskMessage", { + get: $util.oneOfGetter($oneOfFields = ["botTaskMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_questionMessage", { + get: $util.oneOfGetter($oneOfFields = ["questionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Message.prototype, "_messageHistoryNotice", { + get: $util.oneOfGetter($oneOfFields = ["messageHistoryNotice"]), + set: $util.oneOfSetter($oneOfFields) + }); + Message.create = function create(properties) { return new Message(properties); }; @@ -13551,6 +30143,882 @@ export const proto = $root.proto = (() => { return m; }; + Message.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message) + return d; + var m = new $root.proto.Message(); + if (d.conversation != null) { + m.conversation = String(d.conversation); + } + if (d.senderKeyDistributionMessage != null) { + if (typeof d.senderKeyDistributionMessage !== "object") + throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected"); + m.senderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.fromObject(d.senderKeyDistributionMessage); + } + if (d.imageMessage != null) { + if (typeof d.imageMessage !== "object") + throw TypeError(".proto.Message.imageMessage: object expected"); + m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage); + } + if (d.contactMessage != null) { + if (typeof d.contactMessage !== "object") + throw TypeError(".proto.Message.contactMessage: object expected"); + m.contactMessage = $root.proto.Message.ContactMessage.fromObject(d.contactMessage); + } + if (d.locationMessage != null) { + if (typeof d.locationMessage !== "object") + throw TypeError(".proto.Message.locationMessage: object expected"); + m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage); + } + if (d.extendedTextMessage != null) { + if (typeof d.extendedTextMessage !== "object") + throw TypeError(".proto.Message.extendedTextMessage: object expected"); + m.extendedTextMessage = $root.proto.Message.ExtendedTextMessage.fromObject(d.extendedTextMessage); + } + if (d.documentMessage != null) { + if (typeof d.documentMessage !== "object") + throw TypeError(".proto.Message.documentMessage: object expected"); + m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage); + } + if (d.audioMessage != null) { + if (typeof d.audioMessage !== "object") + throw TypeError(".proto.Message.audioMessage: object expected"); + m.audioMessage = $root.proto.Message.AudioMessage.fromObject(d.audioMessage); + } + if (d.videoMessage != null) { + if (typeof d.videoMessage !== "object") + throw TypeError(".proto.Message.videoMessage: object expected"); + m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage); + } + if (d.call != null) { + if (typeof d.call !== "object") + throw TypeError(".proto.Message.call: object expected"); + m.call = $root.proto.Message.Call.fromObject(d.call); + } + if (d.chat != null) { + if (typeof d.chat !== "object") + throw TypeError(".proto.Message.chat: object expected"); + m.chat = $root.proto.Message.Chat.fromObject(d.chat); + } + if (d.protocolMessage != null) { + if (typeof d.protocolMessage !== "object") + throw TypeError(".proto.Message.protocolMessage: object expected"); + m.protocolMessage = $root.proto.Message.ProtocolMessage.fromObject(d.protocolMessage); + } + if (d.contactsArrayMessage != null) { + if (typeof d.contactsArrayMessage !== "object") + throw TypeError(".proto.Message.contactsArrayMessage: object expected"); + m.contactsArrayMessage = $root.proto.Message.ContactsArrayMessage.fromObject(d.contactsArrayMessage); + } + if (d.highlyStructuredMessage != null) { + if (typeof d.highlyStructuredMessage !== "object") + throw TypeError(".proto.Message.highlyStructuredMessage: object expected"); + m.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.fromObject(d.highlyStructuredMessage); + } + if (d.fastRatchetKeySenderKeyDistributionMessage != null) { + if (typeof d.fastRatchetKeySenderKeyDistributionMessage !== "object") + throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected"); + m.fastRatchetKeySenderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.fromObject(d.fastRatchetKeySenderKeyDistributionMessage); + } + if (d.sendPaymentMessage != null) { + if (typeof d.sendPaymentMessage !== "object") + throw TypeError(".proto.Message.sendPaymentMessage: object expected"); + m.sendPaymentMessage = $root.proto.Message.SendPaymentMessage.fromObject(d.sendPaymentMessage); + } + if (d.liveLocationMessage != null) { + if (typeof d.liveLocationMessage !== "object") + throw TypeError(".proto.Message.liveLocationMessage: object expected"); + m.liveLocationMessage = $root.proto.Message.LiveLocationMessage.fromObject(d.liveLocationMessage); + } + if (d.requestPaymentMessage != null) { + if (typeof d.requestPaymentMessage !== "object") + throw TypeError(".proto.Message.requestPaymentMessage: object expected"); + m.requestPaymentMessage = $root.proto.Message.RequestPaymentMessage.fromObject(d.requestPaymentMessage); + } + if (d.declinePaymentRequestMessage != null) { + if (typeof d.declinePaymentRequestMessage !== "object") + throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected"); + m.declinePaymentRequestMessage = $root.proto.Message.DeclinePaymentRequestMessage.fromObject(d.declinePaymentRequestMessage); + } + if (d.cancelPaymentRequestMessage != null) { + if (typeof d.cancelPaymentRequestMessage !== "object") + throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected"); + m.cancelPaymentRequestMessage = $root.proto.Message.CancelPaymentRequestMessage.fromObject(d.cancelPaymentRequestMessage); + } + if (d.templateMessage != null) { + if (typeof d.templateMessage !== "object") + throw TypeError(".proto.Message.templateMessage: object expected"); + m.templateMessage = $root.proto.Message.TemplateMessage.fromObject(d.templateMessage); + } + if (d.stickerMessage != null) { + if (typeof d.stickerMessage !== "object") + throw TypeError(".proto.Message.stickerMessage: object expected"); + m.stickerMessage = $root.proto.Message.StickerMessage.fromObject(d.stickerMessage); + } + if (d.groupInviteMessage != null) { + if (typeof d.groupInviteMessage !== "object") + throw TypeError(".proto.Message.groupInviteMessage: object expected"); + m.groupInviteMessage = $root.proto.Message.GroupInviteMessage.fromObject(d.groupInviteMessage); + } + if (d.templateButtonReplyMessage != null) { + if (typeof d.templateButtonReplyMessage !== "object") + throw TypeError(".proto.Message.templateButtonReplyMessage: object expected"); + m.templateButtonReplyMessage = $root.proto.Message.TemplateButtonReplyMessage.fromObject(d.templateButtonReplyMessage); + } + if (d.productMessage != null) { + if (typeof d.productMessage !== "object") + throw TypeError(".proto.Message.productMessage: object expected"); + m.productMessage = $root.proto.Message.ProductMessage.fromObject(d.productMessage); + } + if (d.deviceSentMessage != null) { + if (typeof d.deviceSentMessage !== "object") + throw TypeError(".proto.Message.deviceSentMessage: object expected"); + m.deviceSentMessage = $root.proto.Message.DeviceSentMessage.fromObject(d.deviceSentMessage); + } + if (d.messageContextInfo != null) { + if (typeof d.messageContextInfo !== "object") + throw TypeError(".proto.Message.messageContextInfo: object expected"); + m.messageContextInfo = $root.proto.MessageContextInfo.fromObject(d.messageContextInfo); + } + if (d.listMessage != null) { + if (typeof d.listMessage !== "object") + throw TypeError(".proto.Message.listMessage: object expected"); + m.listMessage = $root.proto.Message.ListMessage.fromObject(d.listMessage); + } + if (d.viewOnceMessage != null) { + if (typeof d.viewOnceMessage !== "object") + throw TypeError(".proto.Message.viewOnceMessage: object expected"); + m.viewOnceMessage = $root.proto.Message.FutureProofMessage.fromObject(d.viewOnceMessage); + } + if (d.orderMessage != null) { + if (typeof d.orderMessage !== "object") + throw TypeError(".proto.Message.orderMessage: object expected"); + m.orderMessage = $root.proto.Message.OrderMessage.fromObject(d.orderMessage); + } + if (d.listResponseMessage != null) { + if (typeof d.listResponseMessage !== "object") + throw TypeError(".proto.Message.listResponseMessage: object expected"); + m.listResponseMessage = $root.proto.Message.ListResponseMessage.fromObject(d.listResponseMessage); + } + if (d.ephemeralMessage != null) { + if (typeof d.ephemeralMessage !== "object") + throw TypeError(".proto.Message.ephemeralMessage: object expected"); + m.ephemeralMessage = $root.proto.Message.FutureProofMessage.fromObject(d.ephemeralMessage); + } + if (d.invoiceMessage != null) { + if (typeof d.invoiceMessage !== "object") + throw TypeError(".proto.Message.invoiceMessage: object expected"); + m.invoiceMessage = $root.proto.Message.InvoiceMessage.fromObject(d.invoiceMessage); + } + if (d.buttonsMessage != null) { + if (typeof d.buttonsMessage !== "object") + throw TypeError(".proto.Message.buttonsMessage: object expected"); + m.buttonsMessage = $root.proto.Message.ButtonsMessage.fromObject(d.buttonsMessage); + } + if (d.buttonsResponseMessage != null) { + if (typeof d.buttonsResponseMessage !== "object") + throw TypeError(".proto.Message.buttonsResponseMessage: object expected"); + m.buttonsResponseMessage = $root.proto.Message.ButtonsResponseMessage.fromObject(d.buttonsResponseMessage); + } + if (d.paymentInviteMessage != null) { + if (typeof d.paymentInviteMessage !== "object") + throw TypeError(".proto.Message.paymentInviteMessage: object expected"); + m.paymentInviteMessage = $root.proto.Message.PaymentInviteMessage.fromObject(d.paymentInviteMessage); + } + if (d.interactiveMessage != null) { + if (typeof d.interactiveMessage !== "object") + throw TypeError(".proto.Message.interactiveMessage: object expected"); + m.interactiveMessage = $root.proto.Message.InteractiveMessage.fromObject(d.interactiveMessage); + } + if (d.reactionMessage != null) { + if (typeof d.reactionMessage !== "object") + throw TypeError(".proto.Message.reactionMessage: object expected"); + m.reactionMessage = $root.proto.Message.ReactionMessage.fromObject(d.reactionMessage); + } + if (d.stickerSyncRmrMessage != null) { + if (typeof d.stickerSyncRmrMessage !== "object") + throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected"); + m.stickerSyncRmrMessage = $root.proto.Message.StickerSyncRMRMessage.fromObject(d.stickerSyncRmrMessage); + } + if (d.interactiveResponseMessage != null) { + if (typeof d.interactiveResponseMessage !== "object") + throw TypeError(".proto.Message.interactiveResponseMessage: object expected"); + m.interactiveResponseMessage = $root.proto.Message.InteractiveResponseMessage.fromObject(d.interactiveResponseMessage); + } + if (d.pollCreationMessage != null) { + if (typeof d.pollCreationMessage !== "object") + throw TypeError(".proto.Message.pollCreationMessage: object expected"); + m.pollCreationMessage = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessage); + } + if (d.pollUpdateMessage != null) { + if (typeof d.pollUpdateMessage !== "object") + throw TypeError(".proto.Message.pollUpdateMessage: object expected"); + m.pollUpdateMessage = $root.proto.Message.PollUpdateMessage.fromObject(d.pollUpdateMessage); + } + if (d.keepInChatMessage != null) { + if (typeof d.keepInChatMessage !== "object") + throw TypeError(".proto.Message.keepInChatMessage: object expected"); + m.keepInChatMessage = $root.proto.Message.KeepInChatMessage.fromObject(d.keepInChatMessage); + } + if (d.documentWithCaptionMessage != null) { + if (typeof d.documentWithCaptionMessage !== "object") + throw TypeError(".proto.Message.documentWithCaptionMessage: object expected"); + m.documentWithCaptionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.documentWithCaptionMessage); + } + if (d.requestPhoneNumberMessage != null) { + if (typeof d.requestPhoneNumberMessage !== "object") + throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected"); + m.requestPhoneNumberMessage = $root.proto.Message.RequestPhoneNumberMessage.fromObject(d.requestPhoneNumberMessage); + } + if (d.viewOnceMessageV2 != null) { + if (typeof d.viewOnceMessageV2 !== "object") + throw TypeError(".proto.Message.viewOnceMessageV2: object expected"); + m.viewOnceMessageV2 = $root.proto.Message.FutureProofMessage.fromObject(d.viewOnceMessageV2); + } + if (d.encReactionMessage != null) { + if (typeof d.encReactionMessage !== "object") + throw TypeError(".proto.Message.encReactionMessage: object expected"); + m.encReactionMessage = $root.proto.Message.EncReactionMessage.fromObject(d.encReactionMessage); + } + if (d.editedMessage != null) { + if (typeof d.editedMessage !== "object") + throw TypeError(".proto.Message.editedMessage: object expected"); + m.editedMessage = $root.proto.Message.FutureProofMessage.fromObject(d.editedMessage); + } + if (d.viewOnceMessageV2Extension != null) { + if (typeof d.viewOnceMessageV2Extension !== "object") + throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected"); + m.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.fromObject(d.viewOnceMessageV2Extension); + } + if (d.pollCreationMessageV2 != null) { + if (typeof d.pollCreationMessageV2 !== "object") + throw TypeError(".proto.Message.pollCreationMessageV2: object expected"); + m.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessageV2); + } + if (d.scheduledCallCreationMessage != null) { + if (typeof d.scheduledCallCreationMessage !== "object") + throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected"); + m.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.fromObject(d.scheduledCallCreationMessage); + } + if (d.groupMentionedMessage != null) { + if (typeof d.groupMentionedMessage !== "object") + throw TypeError(".proto.Message.groupMentionedMessage: object expected"); + m.groupMentionedMessage = $root.proto.Message.FutureProofMessage.fromObject(d.groupMentionedMessage); + } + if (d.pinInChatMessage != null) { + if (typeof d.pinInChatMessage !== "object") + throw TypeError(".proto.Message.pinInChatMessage: object expected"); + m.pinInChatMessage = $root.proto.Message.PinInChatMessage.fromObject(d.pinInChatMessage); + } + if (d.pollCreationMessageV3 != null) { + if (typeof d.pollCreationMessageV3 !== "object") + throw TypeError(".proto.Message.pollCreationMessageV3: object expected"); + m.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.fromObject(d.pollCreationMessageV3); + } + if (d.scheduledCallEditMessage != null) { + if (typeof d.scheduledCallEditMessage !== "object") + throw TypeError(".proto.Message.scheduledCallEditMessage: object expected"); + m.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.fromObject(d.scheduledCallEditMessage); + } + if (d.ptvMessage != null) { + if (typeof d.ptvMessage !== "object") + throw TypeError(".proto.Message.ptvMessage: object expected"); + m.ptvMessage = $root.proto.Message.VideoMessage.fromObject(d.ptvMessage); + } + if (d.botInvokeMessage != null) { + if (typeof d.botInvokeMessage !== "object") + throw TypeError(".proto.Message.botInvokeMessage: object expected"); + m.botInvokeMessage = $root.proto.Message.FutureProofMessage.fromObject(d.botInvokeMessage); + } + if (d.callLogMesssage != null) { + if (typeof d.callLogMesssage !== "object") + throw TypeError(".proto.Message.callLogMesssage: object expected"); + m.callLogMesssage = $root.proto.Message.CallLogMessage.fromObject(d.callLogMesssage); + } + if (d.messageHistoryBundle != null) { + if (typeof d.messageHistoryBundle !== "object") + throw TypeError(".proto.Message.messageHistoryBundle: object expected"); + m.messageHistoryBundle = $root.proto.Message.MessageHistoryBundle.fromObject(d.messageHistoryBundle); + } + if (d.encCommentMessage != null) { + if (typeof d.encCommentMessage !== "object") + throw TypeError(".proto.Message.encCommentMessage: object expected"); + m.encCommentMessage = $root.proto.Message.EncCommentMessage.fromObject(d.encCommentMessage); + } + if (d.bcallMessage != null) { + if (typeof d.bcallMessage !== "object") + throw TypeError(".proto.Message.bcallMessage: object expected"); + m.bcallMessage = $root.proto.Message.BCallMessage.fromObject(d.bcallMessage); + } + if (d.lottieStickerMessage != null) { + if (typeof d.lottieStickerMessage !== "object") + throw TypeError(".proto.Message.lottieStickerMessage: object expected"); + m.lottieStickerMessage = $root.proto.Message.FutureProofMessage.fromObject(d.lottieStickerMessage); + } + if (d.eventMessage != null) { + if (typeof d.eventMessage !== "object") + throw TypeError(".proto.Message.eventMessage: object expected"); + m.eventMessage = $root.proto.Message.EventMessage.fromObject(d.eventMessage); + } + if (d.encEventResponseMessage != null) { + if (typeof d.encEventResponseMessage !== "object") + throw TypeError(".proto.Message.encEventResponseMessage: object expected"); + m.encEventResponseMessage = $root.proto.Message.EncEventResponseMessage.fromObject(d.encEventResponseMessage); + } + if (d.commentMessage != null) { + if (typeof d.commentMessage !== "object") + throw TypeError(".proto.Message.commentMessage: object expected"); + m.commentMessage = $root.proto.Message.CommentMessage.fromObject(d.commentMessage); + } + if (d.newsletterAdminInviteMessage != null) { + if (typeof d.newsletterAdminInviteMessage !== "object") + throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected"); + m.newsletterAdminInviteMessage = $root.proto.Message.NewsletterAdminInviteMessage.fromObject(d.newsletterAdminInviteMessage); + } + if (d.placeholderMessage != null) { + if (typeof d.placeholderMessage !== "object") + throw TypeError(".proto.Message.placeholderMessage: object expected"); + m.placeholderMessage = $root.proto.Message.PlaceholderMessage.fromObject(d.placeholderMessage); + } + if (d.secretEncryptedMessage != null) { + if (typeof d.secretEncryptedMessage !== "object") + throw TypeError(".proto.Message.secretEncryptedMessage: object expected"); + m.secretEncryptedMessage = $root.proto.Message.SecretEncryptedMessage.fromObject(d.secretEncryptedMessage); + } + if (d.albumMessage != null) { + if (typeof d.albumMessage !== "object") + throw TypeError(".proto.Message.albumMessage: object expected"); + m.albumMessage = $root.proto.Message.AlbumMessage.fromObject(d.albumMessage); + } + if (d.eventCoverImage != null) { + if (typeof d.eventCoverImage !== "object") + throw TypeError(".proto.Message.eventCoverImage: object expected"); + m.eventCoverImage = $root.proto.Message.FutureProofMessage.fromObject(d.eventCoverImage); + } + if (d.stickerPackMessage != null) { + if (typeof d.stickerPackMessage !== "object") + throw TypeError(".proto.Message.stickerPackMessage: object expected"); + m.stickerPackMessage = $root.proto.Message.StickerPackMessage.fromObject(d.stickerPackMessage); + } + if (d.statusMentionMessage != null) { + if (typeof d.statusMentionMessage !== "object") + throw TypeError(".proto.Message.statusMentionMessage: object expected"); + m.statusMentionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.statusMentionMessage); + } + if (d.pollResultSnapshotMessage != null) { + if (typeof d.pollResultSnapshotMessage !== "object") + throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected"); + m.pollResultSnapshotMessage = $root.proto.Message.PollResultSnapshotMessage.fromObject(d.pollResultSnapshotMessage); + } + if (d.pollCreationOptionImageMessage != null) { + if (typeof d.pollCreationOptionImageMessage !== "object") + throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected"); + m.pollCreationOptionImageMessage = $root.proto.Message.FutureProofMessage.fromObject(d.pollCreationOptionImageMessage); + } + if (d.associatedChildMessage != null) { + if (typeof d.associatedChildMessage !== "object") + throw TypeError(".proto.Message.associatedChildMessage: object expected"); + m.associatedChildMessage = $root.proto.Message.FutureProofMessage.fromObject(d.associatedChildMessage); + } + if (d.groupStatusMentionMessage != null) { + if (typeof d.groupStatusMentionMessage !== "object") + throw TypeError(".proto.Message.groupStatusMentionMessage: object expected"); + m.groupStatusMentionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.groupStatusMentionMessage); + } + if (d.pollCreationMessageV4 != null) { + if (typeof d.pollCreationMessageV4 !== "object") + throw TypeError(".proto.Message.pollCreationMessageV4: object expected"); + m.pollCreationMessageV4 = $root.proto.Message.FutureProofMessage.fromObject(d.pollCreationMessageV4); + } + if (d.pollCreationMessageV5 != null) { + if (typeof d.pollCreationMessageV5 !== "object") + throw TypeError(".proto.Message.pollCreationMessageV5: object expected"); + m.pollCreationMessageV5 = $root.proto.Message.FutureProofMessage.fromObject(d.pollCreationMessageV5); + } + if (d.statusAddYours != null) { + if (typeof d.statusAddYours !== "object") + throw TypeError(".proto.Message.statusAddYours: object expected"); + m.statusAddYours = $root.proto.Message.FutureProofMessage.fromObject(d.statusAddYours); + } + if (d.groupStatusMessage != null) { + if (typeof d.groupStatusMessage !== "object") + throw TypeError(".proto.Message.groupStatusMessage: object expected"); + m.groupStatusMessage = $root.proto.Message.FutureProofMessage.fromObject(d.groupStatusMessage); + } + if (d.richResponseMessage != null) { + if (typeof d.richResponseMessage !== "object") + throw TypeError(".proto.Message.richResponseMessage: object expected"); + m.richResponseMessage = $root.proto.AIRichResponseMessage.fromObject(d.richResponseMessage); + } + if (d.statusNotificationMessage != null) { + if (typeof d.statusNotificationMessage !== "object") + throw TypeError(".proto.Message.statusNotificationMessage: object expected"); + m.statusNotificationMessage = $root.proto.Message.StatusNotificationMessage.fromObject(d.statusNotificationMessage); + } + if (d.limitSharingMessage != null) { + if (typeof d.limitSharingMessage !== "object") + throw TypeError(".proto.Message.limitSharingMessage: object expected"); + m.limitSharingMessage = $root.proto.Message.FutureProofMessage.fromObject(d.limitSharingMessage); + } + if (d.botTaskMessage != null) { + if (typeof d.botTaskMessage !== "object") + throw TypeError(".proto.Message.botTaskMessage: object expected"); + m.botTaskMessage = $root.proto.Message.FutureProofMessage.fromObject(d.botTaskMessage); + } + if (d.questionMessage != null) { + if (typeof d.questionMessage !== "object") + throw TypeError(".proto.Message.questionMessage: object expected"); + m.questionMessage = $root.proto.Message.FutureProofMessage.fromObject(d.questionMessage); + } + if (d.messageHistoryNotice != null) { + if (typeof d.messageHistoryNotice !== "object") + throw TypeError(".proto.Message.messageHistoryNotice: object expected"); + m.messageHistoryNotice = $root.proto.Message.MessageHistoryNotice.fromObject(d.messageHistoryNotice); + } + return m; + }; + + Message.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.conversation != null && m.hasOwnProperty("conversation")) { + d.conversation = m.conversation; + if (o.oneofs) + d._conversation = "conversation"; + } + if (m.senderKeyDistributionMessage != null && m.hasOwnProperty("senderKeyDistributionMessage")) { + d.senderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.toObject(m.senderKeyDistributionMessage, o); + if (o.oneofs) + d._senderKeyDistributionMessage = "senderKeyDistributionMessage"; + } + if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) { + d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o); + if (o.oneofs) + d._imageMessage = "imageMessage"; + } + if (m.contactMessage != null && m.hasOwnProperty("contactMessage")) { + d.contactMessage = $root.proto.Message.ContactMessage.toObject(m.contactMessage, o); + if (o.oneofs) + d._contactMessage = "contactMessage"; + } + if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) { + d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o); + if (o.oneofs) + d._locationMessage = "locationMessage"; + } + if (m.extendedTextMessage != null && m.hasOwnProperty("extendedTextMessage")) { + d.extendedTextMessage = $root.proto.Message.ExtendedTextMessage.toObject(m.extendedTextMessage, o); + if (o.oneofs) + d._extendedTextMessage = "extendedTextMessage"; + } + if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) { + d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o); + if (o.oneofs) + d._documentMessage = "documentMessage"; + } + if (m.audioMessage != null && m.hasOwnProperty("audioMessage")) { + d.audioMessage = $root.proto.Message.AudioMessage.toObject(m.audioMessage, o); + if (o.oneofs) + d._audioMessage = "audioMessage"; + } + if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) { + d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o); + if (o.oneofs) + d._videoMessage = "videoMessage"; + } + if (m.call != null && m.hasOwnProperty("call")) { + d.call = $root.proto.Message.Call.toObject(m.call, o); + if (o.oneofs) + d._call = "call"; + } + if (m.chat != null && m.hasOwnProperty("chat")) { + d.chat = $root.proto.Message.Chat.toObject(m.chat, o); + if (o.oneofs) + d._chat = "chat"; + } + if (m.protocolMessage != null && m.hasOwnProperty("protocolMessage")) { + d.protocolMessage = $root.proto.Message.ProtocolMessage.toObject(m.protocolMessage, o); + if (o.oneofs) + d._protocolMessage = "protocolMessage"; + } + if (m.contactsArrayMessage != null && m.hasOwnProperty("contactsArrayMessage")) { + d.contactsArrayMessage = $root.proto.Message.ContactsArrayMessage.toObject(m.contactsArrayMessage, o); + if (o.oneofs) + d._contactsArrayMessage = "contactsArrayMessage"; + } + if (m.highlyStructuredMessage != null && m.hasOwnProperty("highlyStructuredMessage")) { + d.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.toObject(m.highlyStructuredMessage, o); + if (o.oneofs) + d._highlyStructuredMessage = "highlyStructuredMessage"; + } + if (m.fastRatchetKeySenderKeyDistributionMessage != null && m.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) { + d.fastRatchetKeySenderKeyDistributionMessage = $root.proto.Message.SenderKeyDistributionMessage.toObject(m.fastRatchetKeySenderKeyDistributionMessage, o); + if (o.oneofs) + d._fastRatchetKeySenderKeyDistributionMessage = "fastRatchetKeySenderKeyDistributionMessage"; + } + if (m.sendPaymentMessage != null && m.hasOwnProperty("sendPaymentMessage")) { + d.sendPaymentMessage = $root.proto.Message.SendPaymentMessage.toObject(m.sendPaymentMessage, o); + if (o.oneofs) + d._sendPaymentMessage = "sendPaymentMessage"; + } + if (m.liveLocationMessage != null && m.hasOwnProperty("liveLocationMessage")) { + d.liveLocationMessage = $root.proto.Message.LiveLocationMessage.toObject(m.liveLocationMessage, o); + if (o.oneofs) + d._liveLocationMessage = "liveLocationMessage"; + } + if (m.requestPaymentMessage != null && m.hasOwnProperty("requestPaymentMessage")) { + d.requestPaymentMessage = $root.proto.Message.RequestPaymentMessage.toObject(m.requestPaymentMessage, o); + if (o.oneofs) + d._requestPaymentMessage = "requestPaymentMessage"; + } + if (m.declinePaymentRequestMessage != null && m.hasOwnProperty("declinePaymentRequestMessage")) { + d.declinePaymentRequestMessage = $root.proto.Message.DeclinePaymentRequestMessage.toObject(m.declinePaymentRequestMessage, o); + if (o.oneofs) + d._declinePaymentRequestMessage = "declinePaymentRequestMessage"; + } + if (m.cancelPaymentRequestMessage != null && m.hasOwnProperty("cancelPaymentRequestMessage")) { + d.cancelPaymentRequestMessage = $root.proto.Message.CancelPaymentRequestMessage.toObject(m.cancelPaymentRequestMessage, o); + if (o.oneofs) + d._cancelPaymentRequestMessage = "cancelPaymentRequestMessage"; + } + if (m.templateMessage != null && m.hasOwnProperty("templateMessage")) { + d.templateMessage = $root.proto.Message.TemplateMessage.toObject(m.templateMessage, o); + if (o.oneofs) + d._templateMessage = "templateMessage"; + } + if (m.stickerMessage != null && m.hasOwnProperty("stickerMessage")) { + d.stickerMessage = $root.proto.Message.StickerMessage.toObject(m.stickerMessage, o); + if (o.oneofs) + d._stickerMessage = "stickerMessage"; + } + if (m.groupInviteMessage != null && m.hasOwnProperty("groupInviteMessage")) { + d.groupInviteMessage = $root.proto.Message.GroupInviteMessage.toObject(m.groupInviteMessage, o); + if (o.oneofs) + d._groupInviteMessage = "groupInviteMessage"; + } + if (m.templateButtonReplyMessage != null && m.hasOwnProperty("templateButtonReplyMessage")) { + d.templateButtonReplyMessage = $root.proto.Message.TemplateButtonReplyMessage.toObject(m.templateButtonReplyMessage, o); + if (o.oneofs) + d._templateButtonReplyMessage = "templateButtonReplyMessage"; + } + if (m.productMessage != null && m.hasOwnProperty("productMessage")) { + d.productMessage = $root.proto.Message.ProductMessage.toObject(m.productMessage, o); + if (o.oneofs) + d._productMessage = "productMessage"; + } + if (m.deviceSentMessage != null && m.hasOwnProperty("deviceSentMessage")) { + d.deviceSentMessage = $root.proto.Message.DeviceSentMessage.toObject(m.deviceSentMessage, o); + if (o.oneofs) + d._deviceSentMessage = "deviceSentMessage"; + } + if (m.messageContextInfo != null && m.hasOwnProperty("messageContextInfo")) { + d.messageContextInfo = $root.proto.MessageContextInfo.toObject(m.messageContextInfo, o); + if (o.oneofs) + d._messageContextInfo = "messageContextInfo"; + } + if (m.listMessage != null && m.hasOwnProperty("listMessage")) { + d.listMessage = $root.proto.Message.ListMessage.toObject(m.listMessage, o); + if (o.oneofs) + d._listMessage = "listMessage"; + } + if (m.viewOnceMessage != null && m.hasOwnProperty("viewOnceMessage")) { + d.viewOnceMessage = $root.proto.Message.FutureProofMessage.toObject(m.viewOnceMessage, o); + if (o.oneofs) + d._viewOnceMessage = "viewOnceMessage"; + } + if (m.orderMessage != null && m.hasOwnProperty("orderMessage")) { + d.orderMessage = $root.proto.Message.OrderMessage.toObject(m.orderMessage, o); + if (o.oneofs) + d._orderMessage = "orderMessage"; + } + if (m.listResponseMessage != null && m.hasOwnProperty("listResponseMessage")) { + d.listResponseMessage = $root.proto.Message.ListResponseMessage.toObject(m.listResponseMessage, o); + if (o.oneofs) + d._listResponseMessage = "listResponseMessage"; + } + if (m.ephemeralMessage != null && m.hasOwnProperty("ephemeralMessage")) { + d.ephemeralMessage = $root.proto.Message.FutureProofMessage.toObject(m.ephemeralMessage, o); + if (o.oneofs) + d._ephemeralMessage = "ephemeralMessage"; + } + if (m.invoiceMessage != null && m.hasOwnProperty("invoiceMessage")) { + d.invoiceMessage = $root.proto.Message.InvoiceMessage.toObject(m.invoiceMessage, o); + if (o.oneofs) + d._invoiceMessage = "invoiceMessage"; + } + if (m.buttonsMessage != null && m.hasOwnProperty("buttonsMessage")) { + d.buttonsMessage = $root.proto.Message.ButtonsMessage.toObject(m.buttonsMessage, o); + if (o.oneofs) + d._buttonsMessage = "buttonsMessage"; + } + if (m.buttonsResponseMessage != null && m.hasOwnProperty("buttonsResponseMessage")) { + d.buttonsResponseMessage = $root.proto.Message.ButtonsResponseMessage.toObject(m.buttonsResponseMessage, o); + if (o.oneofs) + d._buttonsResponseMessage = "buttonsResponseMessage"; + } + if (m.paymentInviteMessage != null && m.hasOwnProperty("paymentInviteMessage")) { + d.paymentInviteMessage = $root.proto.Message.PaymentInviteMessage.toObject(m.paymentInviteMessage, o); + if (o.oneofs) + d._paymentInviteMessage = "paymentInviteMessage"; + } + if (m.interactiveMessage != null && m.hasOwnProperty("interactiveMessage")) { + d.interactiveMessage = $root.proto.Message.InteractiveMessage.toObject(m.interactiveMessage, o); + if (o.oneofs) + d._interactiveMessage = "interactiveMessage"; + } + if (m.reactionMessage != null && m.hasOwnProperty("reactionMessage")) { + d.reactionMessage = $root.proto.Message.ReactionMessage.toObject(m.reactionMessage, o); + if (o.oneofs) + d._reactionMessage = "reactionMessage"; + } + if (m.stickerSyncRmrMessage != null && m.hasOwnProperty("stickerSyncRmrMessage")) { + d.stickerSyncRmrMessage = $root.proto.Message.StickerSyncRMRMessage.toObject(m.stickerSyncRmrMessage, o); + if (o.oneofs) + d._stickerSyncRmrMessage = "stickerSyncRmrMessage"; + } + if (m.interactiveResponseMessage != null && m.hasOwnProperty("interactiveResponseMessage")) { + d.interactiveResponseMessage = $root.proto.Message.InteractiveResponseMessage.toObject(m.interactiveResponseMessage, o); + if (o.oneofs) + d._interactiveResponseMessage = "interactiveResponseMessage"; + } + if (m.pollCreationMessage != null && m.hasOwnProperty("pollCreationMessage")) { + d.pollCreationMessage = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessage, o); + if (o.oneofs) + d._pollCreationMessage = "pollCreationMessage"; + } + if (m.pollUpdateMessage != null && m.hasOwnProperty("pollUpdateMessage")) { + d.pollUpdateMessage = $root.proto.Message.PollUpdateMessage.toObject(m.pollUpdateMessage, o); + if (o.oneofs) + d._pollUpdateMessage = "pollUpdateMessage"; + } + if (m.keepInChatMessage != null && m.hasOwnProperty("keepInChatMessage")) { + d.keepInChatMessage = $root.proto.Message.KeepInChatMessage.toObject(m.keepInChatMessage, o); + if (o.oneofs) + d._keepInChatMessage = "keepInChatMessage"; + } + if (m.documentWithCaptionMessage != null && m.hasOwnProperty("documentWithCaptionMessage")) { + d.documentWithCaptionMessage = $root.proto.Message.FutureProofMessage.toObject(m.documentWithCaptionMessage, o); + if (o.oneofs) + d._documentWithCaptionMessage = "documentWithCaptionMessage"; + } + if (m.requestPhoneNumberMessage != null && m.hasOwnProperty("requestPhoneNumberMessage")) { + d.requestPhoneNumberMessage = $root.proto.Message.RequestPhoneNumberMessage.toObject(m.requestPhoneNumberMessage, o); + if (o.oneofs) + d._requestPhoneNumberMessage = "requestPhoneNumberMessage"; + } + if (m.viewOnceMessageV2 != null && m.hasOwnProperty("viewOnceMessageV2")) { + d.viewOnceMessageV2 = $root.proto.Message.FutureProofMessage.toObject(m.viewOnceMessageV2, o); + if (o.oneofs) + d._viewOnceMessageV2 = "viewOnceMessageV2"; + } + if (m.encReactionMessage != null && m.hasOwnProperty("encReactionMessage")) { + d.encReactionMessage = $root.proto.Message.EncReactionMessage.toObject(m.encReactionMessage, o); + if (o.oneofs) + d._encReactionMessage = "encReactionMessage"; + } + if (m.editedMessage != null && m.hasOwnProperty("editedMessage")) { + d.editedMessage = $root.proto.Message.FutureProofMessage.toObject(m.editedMessage, o); + if (o.oneofs) + d._editedMessage = "editedMessage"; + } + if (m.viewOnceMessageV2Extension != null && m.hasOwnProperty("viewOnceMessageV2Extension")) { + d.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.toObject(m.viewOnceMessageV2Extension, o); + if (o.oneofs) + d._viewOnceMessageV2Extension = "viewOnceMessageV2Extension"; + } + if (m.pollCreationMessageV2 != null && m.hasOwnProperty("pollCreationMessageV2")) { + d.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessageV2, o); + if (o.oneofs) + d._pollCreationMessageV2 = "pollCreationMessageV2"; + } + if (m.scheduledCallCreationMessage != null && m.hasOwnProperty("scheduledCallCreationMessage")) { + d.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.toObject(m.scheduledCallCreationMessage, o); + if (o.oneofs) + d._scheduledCallCreationMessage = "scheduledCallCreationMessage"; + } + if (m.groupMentionedMessage != null && m.hasOwnProperty("groupMentionedMessage")) { + d.groupMentionedMessage = $root.proto.Message.FutureProofMessage.toObject(m.groupMentionedMessage, o); + if (o.oneofs) + d._groupMentionedMessage = "groupMentionedMessage"; + } + if (m.pinInChatMessage != null && m.hasOwnProperty("pinInChatMessage")) { + d.pinInChatMessage = $root.proto.Message.PinInChatMessage.toObject(m.pinInChatMessage, o); + if (o.oneofs) + d._pinInChatMessage = "pinInChatMessage"; + } + if (m.pollCreationMessageV3 != null && m.hasOwnProperty("pollCreationMessageV3")) { + d.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.toObject(m.pollCreationMessageV3, o); + if (o.oneofs) + d._pollCreationMessageV3 = "pollCreationMessageV3"; + } + if (m.scheduledCallEditMessage != null && m.hasOwnProperty("scheduledCallEditMessage")) { + d.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.toObject(m.scheduledCallEditMessage, o); + if (o.oneofs) + d._scheduledCallEditMessage = "scheduledCallEditMessage"; + } + if (m.ptvMessage != null && m.hasOwnProperty("ptvMessage")) { + d.ptvMessage = $root.proto.Message.VideoMessage.toObject(m.ptvMessage, o); + if (o.oneofs) + d._ptvMessage = "ptvMessage"; + } + if (m.botInvokeMessage != null && m.hasOwnProperty("botInvokeMessage")) { + d.botInvokeMessage = $root.proto.Message.FutureProofMessage.toObject(m.botInvokeMessage, o); + if (o.oneofs) + d._botInvokeMessage = "botInvokeMessage"; + } + if (m.callLogMesssage != null && m.hasOwnProperty("callLogMesssage")) { + d.callLogMesssage = $root.proto.Message.CallLogMessage.toObject(m.callLogMesssage, o); + if (o.oneofs) + d._callLogMesssage = "callLogMesssage"; + } + if (m.messageHistoryBundle != null && m.hasOwnProperty("messageHistoryBundle")) { + d.messageHistoryBundle = $root.proto.Message.MessageHistoryBundle.toObject(m.messageHistoryBundle, o); + if (o.oneofs) + d._messageHistoryBundle = "messageHistoryBundle"; + } + if (m.encCommentMessage != null && m.hasOwnProperty("encCommentMessage")) { + d.encCommentMessage = $root.proto.Message.EncCommentMessage.toObject(m.encCommentMessage, o); + if (o.oneofs) + d._encCommentMessage = "encCommentMessage"; + } + if (m.bcallMessage != null && m.hasOwnProperty("bcallMessage")) { + d.bcallMessage = $root.proto.Message.BCallMessage.toObject(m.bcallMessage, o); + if (o.oneofs) + d._bcallMessage = "bcallMessage"; + } + if (m.lottieStickerMessage != null && m.hasOwnProperty("lottieStickerMessage")) { + d.lottieStickerMessage = $root.proto.Message.FutureProofMessage.toObject(m.lottieStickerMessage, o); + if (o.oneofs) + d._lottieStickerMessage = "lottieStickerMessage"; + } + if (m.eventMessage != null && m.hasOwnProperty("eventMessage")) { + d.eventMessage = $root.proto.Message.EventMessage.toObject(m.eventMessage, o); + if (o.oneofs) + d._eventMessage = "eventMessage"; + } + if (m.encEventResponseMessage != null && m.hasOwnProperty("encEventResponseMessage")) { + d.encEventResponseMessage = $root.proto.Message.EncEventResponseMessage.toObject(m.encEventResponseMessage, o); + if (o.oneofs) + d._encEventResponseMessage = "encEventResponseMessage"; + } + if (m.commentMessage != null && m.hasOwnProperty("commentMessage")) { + d.commentMessage = $root.proto.Message.CommentMessage.toObject(m.commentMessage, o); + if (o.oneofs) + d._commentMessage = "commentMessage"; + } + if (m.newsletterAdminInviteMessage != null && m.hasOwnProperty("newsletterAdminInviteMessage")) { + d.newsletterAdminInviteMessage = $root.proto.Message.NewsletterAdminInviteMessage.toObject(m.newsletterAdminInviteMessage, o); + if (o.oneofs) + d._newsletterAdminInviteMessage = "newsletterAdminInviteMessage"; + } + if (m.placeholderMessage != null && m.hasOwnProperty("placeholderMessage")) { + d.placeholderMessage = $root.proto.Message.PlaceholderMessage.toObject(m.placeholderMessage, o); + if (o.oneofs) + d._placeholderMessage = "placeholderMessage"; + } + if (m.secretEncryptedMessage != null && m.hasOwnProperty("secretEncryptedMessage")) { + d.secretEncryptedMessage = $root.proto.Message.SecretEncryptedMessage.toObject(m.secretEncryptedMessage, o); + if (o.oneofs) + d._secretEncryptedMessage = "secretEncryptedMessage"; + } + if (m.albumMessage != null && m.hasOwnProperty("albumMessage")) { + d.albumMessage = $root.proto.Message.AlbumMessage.toObject(m.albumMessage, o); + if (o.oneofs) + d._albumMessage = "albumMessage"; + } + if (m.eventCoverImage != null && m.hasOwnProperty("eventCoverImage")) { + d.eventCoverImage = $root.proto.Message.FutureProofMessage.toObject(m.eventCoverImage, o); + if (o.oneofs) + d._eventCoverImage = "eventCoverImage"; + } + if (m.stickerPackMessage != null && m.hasOwnProperty("stickerPackMessage")) { + d.stickerPackMessage = $root.proto.Message.StickerPackMessage.toObject(m.stickerPackMessage, o); + if (o.oneofs) + d._stickerPackMessage = "stickerPackMessage"; + } + if (m.statusMentionMessage != null && m.hasOwnProperty("statusMentionMessage")) { + d.statusMentionMessage = $root.proto.Message.FutureProofMessage.toObject(m.statusMentionMessage, o); + if (o.oneofs) + d._statusMentionMessage = "statusMentionMessage"; + } + if (m.pollResultSnapshotMessage != null && m.hasOwnProperty("pollResultSnapshotMessage")) { + d.pollResultSnapshotMessage = $root.proto.Message.PollResultSnapshotMessage.toObject(m.pollResultSnapshotMessage, o); + if (o.oneofs) + d._pollResultSnapshotMessage = "pollResultSnapshotMessage"; + } + if (m.pollCreationOptionImageMessage != null && m.hasOwnProperty("pollCreationOptionImageMessage")) { + d.pollCreationOptionImageMessage = $root.proto.Message.FutureProofMessage.toObject(m.pollCreationOptionImageMessage, o); + if (o.oneofs) + d._pollCreationOptionImageMessage = "pollCreationOptionImageMessage"; + } + if (m.associatedChildMessage != null && m.hasOwnProperty("associatedChildMessage")) { + d.associatedChildMessage = $root.proto.Message.FutureProofMessage.toObject(m.associatedChildMessage, o); + if (o.oneofs) + d._associatedChildMessage = "associatedChildMessage"; + } + if (m.groupStatusMentionMessage != null && m.hasOwnProperty("groupStatusMentionMessage")) { + d.groupStatusMentionMessage = $root.proto.Message.FutureProofMessage.toObject(m.groupStatusMentionMessage, o); + if (o.oneofs) + d._groupStatusMentionMessage = "groupStatusMentionMessage"; + } + if (m.pollCreationMessageV4 != null && m.hasOwnProperty("pollCreationMessageV4")) { + d.pollCreationMessageV4 = $root.proto.Message.FutureProofMessage.toObject(m.pollCreationMessageV4, o); + if (o.oneofs) + d._pollCreationMessageV4 = "pollCreationMessageV4"; + } + if (m.pollCreationMessageV5 != null && m.hasOwnProperty("pollCreationMessageV5")) { + d.pollCreationMessageV5 = $root.proto.Message.FutureProofMessage.toObject(m.pollCreationMessageV5, o); + if (o.oneofs) + d._pollCreationMessageV5 = "pollCreationMessageV5"; + } + if (m.statusAddYours != null && m.hasOwnProperty("statusAddYours")) { + d.statusAddYours = $root.proto.Message.FutureProofMessage.toObject(m.statusAddYours, o); + if (o.oneofs) + d._statusAddYours = "statusAddYours"; + } + if (m.groupStatusMessage != null && m.hasOwnProperty("groupStatusMessage")) { + d.groupStatusMessage = $root.proto.Message.FutureProofMessage.toObject(m.groupStatusMessage, o); + if (o.oneofs) + d._groupStatusMessage = "groupStatusMessage"; + } + if (m.richResponseMessage != null && m.hasOwnProperty("richResponseMessage")) { + d.richResponseMessage = $root.proto.AIRichResponseMessage.toObject(m.richResponseMessage, o); + if (o.oneofs) + d._richResponseMessage = "richResponseMessage"; + } + if (m.statusNotificationMessage != null && m.hasOwnProperty("statusNotificationMessage")) { + d.statusNotificationMessage = $root.proto.Message.StatusNotificationMessage.toObject(m.statusNotificationMessage, o); + if (o.oneofs) + d._statusNotificationMessage = "statusNotificationMessage"; + } + if (m.limitSharingMessage != null && m.hasOwnProperty("limitSharingMessage")) { + d.limitSharingMessage = $root.proto.Message.FutureProofMessage.toObject(m.limitSharingMessage, o); + if (o.oneofs) + d._limitSharingMessage = "limitSharingMessage"; + } + if (m.botTaskMessage != null && m.hasOwnProperty("botTaskMessage")) { + d.botTaskMessage = $root.proto.Message.FutureProofMessage.toObject(m.botTaskMessage, o); + if (o.oneofs) + d._botTaskMessage = "botTaskMessage"; + } + if (m.questionMessage != null && m.hasOwnProperty("questionMessage")) { + d.questionMessage = $root.proto.Message.FutureProofMessage.toObject(m.questionMessage, o); + if (o.oneofs) + d._questionMessage = "questionMessage"; + } + if (m.messageHistoryNotice != null && m.hasOwnProperty("messageHistoryNotice")) { + d.messageHistoryNotice = $root.proto.Message.MessageHistoryNotice.toObject(m.messageHistoryNotice, o); + if (o.oneofs) + d._messageHistoryNotice = "messageHistoryNotice"; + } + return d; + }; + + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -13567,10 +31035,30 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AlbumMessage.prototype.expectedImageCount = 0; - AlbumMessage.prototype.expectedVideoCount = 0; + AlbumMessage.prototype.expectedImageCount = null; + AlbumMessage.prototype.expectedVideoCount = null; AlbumMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AlbumMessage.prototype, "_expectedImageCount", { + get: $util.oneOfGetter($oneOfFields = ["expectedImageCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AlbumMessage.prototype, "_expectedVideoCount", { + get: $util.oneOfGetter($oneOfFields = ["expectedVideoCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AlbumMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + AlbumMessage.create = function create(properties) { return new AlbumMessage(properties); }; @@ -13616,6 +31104,50 @@ export const proto = $root.proto = (() => { return m; }; + AlbumMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AlbumMessage) + return d; + var m = new $root.proto.Message.AlbumMessage(); + if (d.expectedImageCount != null) { + m.expectedImageCount = d.expectedImageCount >>> 0; + } + if (d.expectedVideoCount != null) { + m.expectedVideoCount = d.expectedVideoCount >>> 0; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + AlbumMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.expectedImageCount != null && m.hasOwnProperty("expectedImageCount")) { + d.expectedImageCount = m.expectedImageCount; + if (o.oneofs) + d._expectedImageCount = "expectedImageCount"; + } + if (m.expectedVideoCount != null && m.hasOwnProperty("expectedVideoCount")) { + d.expectedVideoCount = m.expectedVideoCount; + if (o.oneofs) + d._expectedVideoCount = "expectedVideoCount"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + AlbumMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AlbumMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -13637,7 +31169,15 @@ export const proto = $root.proto = (() => { } AppStateFatalExceptionNotification.prototype.collectionNames = $util.emptyArray; - AppStateFatalExceptionNotification.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AppStateFatalExceptionNotification.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateFatalExceptionNotification.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); AppStateFatalExceptionNotification.create = function create(properties) { return new AppStateFatalExceptionNotification(properties); @@ -13682,6 +31222,59 @@ export const proto = $root.proto = (() => { return m; }; + AppStateFatalExceptionNotification.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateFatalExceptionNotification) + return d; + var m = new $root.proto.Message.AppStateFatalExceptionNotification(); + if (d.collectionNames) { + if (!Array.isArray(d.collectionNames)) + throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected"); + m.collectionNames = []; + for (var i = 0; i < d.collectionNames.length; ++i) { + m.collectionNames[i] = String(d.collectionNames[i]); + } + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + AppStateFatalExceptionNotification.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.collectionNames = []; + } + if (m.collectionNames && m.collectionNames.length) { + d.collectionNames = []; + for (var j = 0; j < m.collectionNames.length; ++j) { + d.collectionNames[j] = m.collectionNames[j]; + } + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + AppStateFatalExceptionNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateFatalExceptionNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -13704,6 +31297,20 @@ export const proto = $root.proto = (() => { AppStateSyncKey.prototype.keyId = null; AppStateSyncKey.prototype.keyData = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKey.prototype, "_keyId", { + get: $util.oneOfGetter($oneOfFields = ["keyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKey.prototype, "_keyData", { + get: $util.oneOfGetter($oneOfFields = ["keyData"]), + set: $util.oneOfSetter($oneOfFields) + }); + AppStateSyncKey.create = function create(properties) { return new AppStateSyncKey(properties); }; @@ -13743,6 +31350,44 @@ export const proto = $root.proto = (() => { return m; }; + AppStateSyncKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateSyncKey) + return d; + var m = new $root.proto.Message.AppStateSyncKey(); + if (d.keyId != null) { + if (typeof d.keyId !== "object") + throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected"); + m.keyId = $root.proto.Message.AppStateSyncKeyId.fromObject(d.keyId); + } + if (d.keyData != null) { + if (typeof d.keyData !== "object") + throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected"); + m.keyData = $root.proto.Message.AppStateSyncKeyData.fromObject(d.keyData); + } + return m; + }; + + AppStateSyncKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.keyId != null && m.hasOwnProperty("keyId")) { + d.keyId = $root.proto.Message.AppStateSyncKeyId.toObject(m.keyId, o); + if (o.oneofs) + d._keyId = "keyId"; + } + if (m.keyData != null && m.hasOwnProperty("keyData")) { + d.keyData = $root.proto.Message.AppStateSyncKeyData.toObject(m.keyData, o); + if (o.oneofs) + d._keyData = "keyData"; + } + return d; + }; + + AppStateSyncKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateSyncKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -13762,9 +31407,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AppStateSyncKeyData.prototype.keyData = $util.newBuffer([]); + AppStateSyncKeyData.prototype.keyData = null; AppStateSyncKeyData.prototype.fingerprint = null; - AppStateSyncKeyData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AppStateSyncKeyData.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKeyData.prototype, "_keyData", { + get: $util.oneOfGetter($oneOfFields = ["keyData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKeyData.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKeyData.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); AppStateSyncKeyData.create = function create(properties) { return new AppStateSyncKeyData(properties); @@ -13811,6 +31476,63 @@ export const proto = $root.proto = (() => { return m; }; + AppStateSyncKeyData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateSyncKeyData) + return d; + var m = new $root.proto.Message.AppStateSyncKeyData(); + if (d.keyData != null) { + if (typeof d.keyData === "string") + $util.base64.decode(d.keyData, m.keyData = $util.newBuffer($util.base64.length(d.keyData)), 0); + else if (d.keyData.length >= 0) + m.keyData = d.keyData; + } + if (d.fingerprint != null) { + if (typeof d.fingerprint !== "object") + throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected"); + m.fingerprint = $root.proto.Message.AppStateSyncKeyFingerprint.fromObject(d.fingerprint); + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + AppStateSyncKeyData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.keyData != null && m.hasOwnProperty("keyData")) { + d.keyData = o.bytes === String ? $util.base64.encode(m.keyData, 0, m.keyData.length) : o.bytes === Array ? Array.prototype.slice.call(m.keyData) : m.keyData; + if (o.oneofs) + d._keyData = "keyData"; + } + if (m.fingerprint != null && m.hasOwnProperty("fingerprint")) { + d.fingerprint = $root.proto.Message.AppStateSyncKeyFingerprint.toObject(m.fingerprint, o); + if (o.oneofs) + d._fingerprint = "fingerprint"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + AppStateSyncKeyData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateSyncKeyData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -13831,10 +31553,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AppStateSyncKeyFingerprint.prototype.rawId = 0; - AppStateSyncKeyFingerprint.prototype.currentIndex = 0; + AppStateSyncKeyFingerprint.prototype.rawId = null; + AppStateSyncKeyFingerprint.prototype.currentIndex = null; AppStateSyncKeyFingerprint.prototype.deviceIndexes = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKeyFingerprint.prototype, "_rawId", { + get: $util.oneOfGetter($oneOfFields = ["rawId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKeyFingerprint.prototype, "_currentIndex", { + get: $util.oneOfGetter($oneOfFields = ["currentIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + AppStateSyncKeyFingerprint.create = function create(properties) { return new AppStateSyncKeyFingerprint(properties); }; @@ -13891,6 +31627,57 @@ export const proto = $root.proto = (() => { return m; }; + AppStateSyncKeyFingerprint.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateSyncKeyFingerprint) + return d; + var m = new $root.proto.Message.AppStateSyncKeyFingerprint(); + if (d.rawId != null) { + m.rawId = d.rawId >>> 0; + } + if (d.currentIndex != null) { + m.currentIndex = d.currentIndex >>> 0; + } + if (d.deviceIndexes) { + if (!Array.isArray(d.deviceIndexes)) + throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected"); + m.deviceIndexes = []; + for (var i = 0; i < d.deviceIndexes.length; ++i) { + m.deviceIndexes[i] = d.deviceIndexes[i] >>> 0; + } + } + return m; + }; + + AppStateSyncKeyFingerprint.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.deviceIndexes = []; + } + if (m.rawId != null && m.hasOwnProperty("rawId")) { + d.rawId = m.rawId; + if (o.oneofs) + d._rawId = "rawId"; + } + if (m.currentIndex != null && m.hasOwnProperty("currentIndex")) { + d.currentIndex = m.currentIndex; + if (o.oneofs) + d._currentIndex = "currentIndex"; + } + if (m.deviceIndexes && m.deviceIndexes.length) { + d.deviceIndexes = []; + for (var j = 0; j < m.deviceIndexes.length; ++j) { + d.deviceIndexes[j] = m.deviceIndexes[j]; + } + } + return d; + }; + + AppStateSyncKeyFingerprint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateSyncKeyFingerprint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -13910,7 +31697,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AppStateSyncKeyId.prototype.keyId = $util.newBuffer([]); + AppStateSyncKeyId.prototype.keyId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppStateSyncKeyId.prototype, "_keyId", { + get: $util.oneOfGetter($oneOfFields = ["keyId"]), + set: $util.oneOfSetter($oneOfFields) + }); AppStateSyncKeyId.create = function create(properties) { return new AppStateSyncKeyId(properties); @@ -13945,6 +31740,35 @@ export const proto = $root.proto = (() => { return m; }; + AppStateSyncKeyId.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateSyncKeyId) + return d; + var m = new $root.proto.Message.AppStateSyncKeyId(); + if (d.keyId != null) { + if (typeof d.keyId === "string") + $util.base64.decode(d.keyId, m.keyId = $util.newBuffer($util.base64.length(d.keyId)), 0); + else if (d.keyId.length >= 0) + m.keyId = d.keyId; + } + return m; + }; + + AppStateSyncKeyId.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.keyId != null && m.hasOwnProperty("keyId")) { + d.keyId = o.bytes === String ? $util.base64.encode(m.keyId, 0, m.keyId.length) : o.bytes === Array ? Array.prototype.slice.call(m.keyId) : m.keyId; + if (o.oneofs) + d._keyId = "keyId"; + } + return d; + }; + + AppStateSyncKeyId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateSyncKeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14004,6 +31828,43 @@ export const proto = $root.proto = (() => { return m; }; + AppStateSyncKeyRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateSyncKeyRequest) + return d; + var m = new $root.proto.Message.AppStateSyncKeyRequest(); + if (d.keyIds) { + if (!Array.isArray(d.keyIds)) + throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected"); + m.keyIds = []; + for (var i = 0; i < d.keyIds.length; ++i) { + if (typeof d.keyIds[i] !== "object") + throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: object expected"); + m.keyIds[i] = $root.proto.Message.AppStateSyncKeyId.fromObject(d.keyIds[i]); + } + } + return m; + }; + + AppStateSyncKeyRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.keyIds = []; + } + if (m.keyIds && m.keyIds.length) { + d.keyIds = []; + for (var j = 0; j < m.keyIds.length; ++j) { + d.keyIds[j] = $root.proto.Message.AppStateSyncKeyId.toObject(m.keyIds[j], o); + } + } + return d; + }; + + AppStateSyncKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateSyncKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14063,6 +31924,43 @@ export const proto = $root.proto = (() => { return m; }; + AppStateSyncKeyShare.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AppStateSyncKeyShare) + return d; + var m = new $root.proto.Message.AppStateSyncKeyShare(); + if (d.keys) { + if (!Array.isArray(d.keys)) + throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected"); + m.keys = []; + for (var i = 0; i < d.keys.length; ++i) { + if (typeof d.keys[i] !== "object") + throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: object expected"); + m.keys[i] = $root.proto.Message.AppStateSyncKey.fromObject(d.keys[i]); + } + } + return m; + }; + + AppStateSyncKeyShare.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.keys = []; + } + if (m.keys && m.keys.length) { + d.keys = []; + for (var j = 0; j < m.keys.length; ++j) { + d.keys[j] = $root.proto.Message.AppStateSyncKey.toObject(m.keys[j], o); + } + } + return d; + }; + + AppStateSyncKeyShare.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AppStateSyncKeyShare.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14082,22 +31980,120 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AudioMessage.prototype.url = ""; - AudioMessage.prototype.mimetype = ""; - AudioMessage.prototype.fileSha256 = $util.newBuffer([]); - AudioMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - AudioMessage.prototype.seconds = 0; - AudioMessage.prototype.ptt = false; - AudioMessage.prototype.mediaKey = $util.newBuffer([]); - AudioMessage.prototype.fileEncSha256 = $util.newBuffer([]); - AudioMessage.prototype.directPath = ""; - AudioMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AudioMessage.prototype.url = null; + AudioMessage.prototype.mimetype = null; + AudioMessage.prototype.fileSha256 = null; + AudioMessage.prototype.fileLength = null; + AudioMessage.prototype.seconds = null; + AudioMessage.prototype.ptt = null; + AudioMessage.prototype.mediaKey = null; + AudioMessage.prototype.fileEncSha256 = null; + AudioMessage.prototype.directPath = null; + AudioMessage.prototype.mediaKeyTimestamp = null; AudioMessage.prototype.contextInfo = null; - AudioMessage.prototype.streamingSidecar = $util.newBuffer([]); - AudioMessage.prototype.waveform = $util.newBuffer([]); - AudioMessage.prototype.backgroundArgb = 0; - AudioMessage.prototype.viewOnce = false; - AudioMessage.prototype.accessibilityLabel = ""; + AudioMessage.prototype.streamingSidecar = null; + AudioMessage.prototype.waveform = null; + AudioMessage.prototype.backgroundArgb = null; + AudioMessage.prototype.viewOnce = null; + AudioMessage.prototype.accessibilityLabel = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_seconds", { + get: $util.oneOfGetter($oneOfFields = ["seconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_ptt", { + get: $util.oneOfGetter($oneOfFields = ["ptt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_streamingSidecar", { + get: $util.oneOfGetter($oneOfFields = ["streamingSidecar"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_waveform", { + get: $util.oneOfGetter($oneOfFields = ["waveform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_backgroundArgb", { + get: $util.oneOfGetter($oneOfFields = ["backgroundArgb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_viewOnce", { + get: $util.oneOfGetter($oneOfFields = ["viewOnce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AudioMessage.prototype, "_accessibilityLabel", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); AudioMessage.create = function create(properties) { return new AudioMessage(properties); @@ -14222,6 +32218,189 @@ export const proto = $root.proto = (() => { return m; }; + AudioMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.AudioMessage) + return d; + var m = new $root.proto.Message.AudioMessage(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.seconds != null) { + m.seconds = d.seconds >>> 0; + } + if (d.ptt != null) { + m.ptt = Boolean(d.ptt); + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.streamingSidecar != null) { + if (typeof d.streamingSidecar === "string") + $util.base64.decode(d.streamingSidecar, m.streamingSidecar = $util.newBuffer($util.base64.length(d.streamingSidecar)), 0); + else if (d.streamingSidecar.length >= 0) + m.streamingSidecar = d.streamingSidecar; + } + if (d.waveform != null) { + if (typeof d.waveform === "string") + $util.base64.decode(d.waveform, m.waveform = $util.newBuffer($util.base64.length(d.waveform)), 0); + else if (d.waveform.length >= 0) + m.waveform = d.waveform; + } + if (d.backgroundArgb != null) { + m.backgroundArgb = d.backgroundArgb >>> 0; + } + if (d.viewOnce != null) { + m.viewOnce = Boolean(d.viewOnce); + } + if (d.accessibilityLabel != null) { + m.accessibilityLabel = String(d.accessibilityLabel); + } + return m; + }; + + AudioMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.seconds != null && m.hasOwnProperty("seconds")) { + d.seconds = m.seconds; + if (o.oneofs) + d._seconds = "seconds"; + } + if (m.ptt != null && m.hasOwnProperty("ptt")) { + d.ptt = m.ptt; + if (o.oneofs) + d._ptt = "ptt"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.streamingSidecar != null && m.hasOwnProperty("streamingSidecar")) { + d.streamingSidecar = o.bytes === String ? $util.base64.encode(m.streamingSidecar, 0, m.streamingSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.streamingSidecar) : m.streamingSidecar; + if (o.oneofs) + d._streamingSidecar = "streamingSidecar"; + } + if (m.waveform != null && m.hasOwnProperty("waveform")) { + d.waveform = o.bytes === String ? $util.base64.encode(m.waveform, 0, m.waveform.length) : o.bytes === Array ? Array.prototype.slice.call(m.waveform) : m.waveform; + if (o.oneofs) + d._waveform = "waveform"; + } + if (m.backgroundArgb != null && m.hasOwnProperty("backgroundArgb")) { + d.backgroundArgb = m.backgroundArgb; + if (o.oneofs) + d._backgroundArgb = "backgroundArgb"; + } + if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) { + d.viewOnce = m.viewOnce; + if (o.oneofs) + d._viewOnce = "viewOnce"; + } + if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) { + d.accessibilityLabel = m.accessibilityLabel; + if (o.oneofs) + d._accessibilityLabel = "accessibilityLabel"; + } + return d; + }; + + AudioMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AudioMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14241,10 +32420,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BCallMessage.prototype.sessionId = ""; - BCallMessage.prototype.mediaType = 0; - BCallMessage.prototype.masterKey = $util.newBuffer([]); - BCallMessage.prototype.caption = ""; + BCallMessage.prototype.sessionId = null; + BCallMessage.prototype.mediaType = null; + BCallMessage.prototype.masterKey = null; + BCallMessage.prototype.caption = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BCallMessage.prototype, "_sessionId", { + get: $util.oneOfGetter($oneOfFields = ["sessionId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BCallMessage.prototype, "_mediaType", { + get: $util.oneOfGetter($oneOfFields = ["mediaType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BCallMessage.prototype, "_masterKey", { + get: $util.oneOfGetter($oneOfFields = ["masterKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BCallMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); BCallMessage.create = function create(properties) { return new BCallMessage(properties); @@ -14297,6 +32502,76 @@ export const proto = $root.proto = (() => { return m; }; + BCallMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.BCallMessage) + return d; + var m = new $root.proto.Message.BCallMessage(); + if (d.sessionId != null) { + m.sessionId = String(d.sessionId); + } + switch (d.mediaType) { + default: + if (typeof d.mediaType === "number") { + m.mediaType = d.mediaType; + break; + } + break; + case "UNKNOWN": + case 0: + m.mediaType = 0; + break; + case "AUDIO": + case 1: + m.mediaType = 1; + break; + case "VIDEO": + case 2: + m.mediaType = 2; + break; + } + if (d.masterKey != null) { + if (typeof d.masterKey === "string") + $util.base64.decode(d.masterKey, m.masterKey = $util.newBuffer($util.base64.length(d.masterKey)), 0); + else if (d.masterKey.length >= 0) + m.masterKey = d.masterKey; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + return m; + }; + + BCallMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.sessionId != null && m.hasOwnProperty("sessionId")) { + d.sessionId = m.sessionId; + if (o.oneofs) + d._sessionId = "sessionId"; + } + if (m.mediaType != null && m.hasOwnProperty("mediaType")) { + d.mediaType = o.enums === String ? $root.proto.Message.BCallMessage.MediaType[m.mediaType] === undefined ? m.mediaType : $root.proto.Message.BCallMessage.MediaType[m.mediaType] : m.mediaType; + if (o.oneofs) + d._mediaType = "mediaType"; + } + if (m.masterKey != null && m.hasOwnProperty("masterKey")) { + d.masterKey = o.bytes === String ? $util.base64.encode(m.masterKey, 0, m.masterKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.masterKey) : m.masterKey; + if (o.oneofs) + d._masterKey = "masterKey"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + return d; + }; + + BCallMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BCallMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14325,11 +32600,49 @@ export const proto = $root.proto = (() => { } BotFeedbackMessage.prototype.messageKey = null; - BotFeedbackMessage.prototype.kind = 0; - BotFeedbackMessage.prototype.text = ""; - BotFeedbackMessage.prototype.kindNegative = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - BotFeedbackMessage.prototype.kindPositive = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - BotFeedbackMessage.prototype.kindReport = 0; + BotFeedbackMessage.prototype.kind = null; + BotFeedbackMessage.prototype.text = null; + BotFeedbackMessage.prototype.kindNegative = null; + BotFeedbackMessage.prototype.kindPositive = null; + BotFeedbackMessage.prototype.kindReport = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeedbackMessage.prototype, "_messageKey", { + get: $util.oneOfGetter($oneOfFields = ["messageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeedbackMessage.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeedbackMessage.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeedbackMessage.prototype, "_kindNegative", { + get: $util.oneOfGetter($oneOfFields = ["kindNegative"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeedbackMessage.prototype, "_kindPositive", { + get: $util.oneOfGetter($oneOfFields = ["kindPositive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotFeedbackMessage.prototype, "_kindReport", { + get: $util.oneOfGetter($oneOfFields = ["kindReport"]), + set: $util.oneOfSetter($oneOfFields) + }); BotFeedbackMessage.create = function create(properties) { return new BotFeedbackMessage(properties); @@ -14394,6 +32707,160 @@ export const proto = $root.proto = (() => { return m; }; + BotFeedbackMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.BotFeedbackMessage) + return d; + var m = new $root.proto.Message.BotFeedbackMessage(); + if (d.messageKey != null) { + if (typeof d.messageKey !== "object") + throw TypeError(".proto.Message.BotFeedbackMessage.messageKey: object expected"); + m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey); + } + switch (d.kind) { + default: + if (typeof d.kind === "number") { + m.kind = d.kind; + break; + } + break; + case "BOT_FEEDBACK_POSITIVE": + case 0: + m.kind = 0; + break; + case "BOT_FEEDBACK_NEGATIVE_GENERIC": + case 1: + m.kind = 1; + break; + case "BOT_FEEDBACK_NEGATIVE_HELPFUL": + case 2: + m.kind = 2; + break; + case "BOT_FEEDBACK_NEGATIVE_INTERESTING": + case 3: + m.kind = 3; + break; + case "BOT_FEEDBACK_NEGATIVE_ACCURATE": + case 4: + m.kind = 4; + break; + case "BOT_FEEDBACK_NEGATIVE_SAFE": + case 5: + m.kind = 5; + break; + case "BOT_FEEDBACK_NEGATIVE_OTHER": + case 6: + m.kind = 6; + break; + case "BOT_FEEDBACK_NEGATIVE_REFUSED": + case 7: + m.kind = 7; + break; + case "BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING": + case 8: + m.kind = 8; + break; + case "BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT": + case 9: + m.kind = 9; + break; + case "BOT_FEEDBACK_NEGATIVE_PERSONALIZED": + case 10: + m.kind = 10; + break; + case "BOT_FEEDBACK_NEGATIVE_CLARITY": + case 11: + m.kind = 11; + break; + case "BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON": + case 12: + m.kind = 12; + break; + } + if (d.text != null) { + m.text = String(d.text); + } + if (d.kindNegative != null) { + if ($util.Long) + (m.kindNegative = $util.Long.fromValue(d.kindNegative)).unsigned = true; + else if (typeof d.kindNegative === "string") + m.kindNegative = parseInt(d.kindNegative, 10); + else if (typeof d.kindNegative === "number") + m.kindNegative = d.kindNegative; + else if (typeof d.kindNegative === "object") + m.kindNegative = new $util.LongBits(d.kindNegative.low >>> 0, d.kindNegative.high >>> 0).toNumber(true); + } + if (d.kindPositive != null) { + if ($util.Long) + (m.kindPositive = $util.Long.fromValue(d.kindPositive)).unsigned = true; + else if (typeof d.kindPositive === "string") + m.kindPositive = parseInt(d.kindPositive, 10); + else if (typeof d.kindPositive === "number") + m.kindPositive = d.kindPositive; + else if (typeof d.kindPositive === "object") + m.kindPositive = new $util.LongBits(d.kindPositive.low >>> 0, d.kindPositive.high >>> 0).toNumber(true); + } + switch (d.kindReport) { + default: + if (typeof d.kindReport === "number") { + m.kindReport = d.kindReport; + break; + } + break; + case "GENERIC": + case 0: + m.kindReport = 0; + break; + } + return m; + }; + + BotFeedbackMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageKey != null && m.hasOwnProperty("messageKey")) { + d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o); + if (o.oneofs) + d._messageKey = "messageKey"; + } + if (m.kind != null && m.hasOwnProperty("kind")) { + d.kind = o.enums === String ? $root.proto.Message.BotFeedbackMessage.BotFeedbackKind[m.kind] === undefined ? m.kind : $root.proto.Message.BotFeedbackMessage.BotFeedbackKind[m.kind] : m.kind; + if (o.oneofs) + d._kind = "kind"; + } + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.kindNegative != null && m.hasOwnProperty("kindNegative")) { + if (typeof m.kindNegative === "number") + d.kindNegative = o.longs === String ? String(m.kindNegative) : m.kindNegative; + else + d.kindNegative = o.longs === String ? $util.Long.prototype.toString.call(m.kindNegative) : o.longs === Number ? new $util.LongBits(m.kindNegative.low >>> 0, m.kindNegative.high >>> 0).toNumber(true) : m.kindNegative; + if (o.oneofs) + d._kindNegative = "kindNegative"; + } + if (m.kindPositive != null && m.hasOwnProperty("kindPositive")) { + if (typeof m.kindPositive === "number") + d.kindPositive = o.longs === String ? String(m.kindPositive) : m.kindPositive; + else + d.kindPositive = o.longs === String ? $util.Long.prototype.toString.call(m.kindPositive) : o.longs === Number ? new $util.LongBits(m.kindPositive.low >>> 0, m.kindPositive.high >>> 0).toNumber(true) : m.kindPositive; + if (o.oneofs) + d._kindPositive = "kindPositive"; + } + if (m.kindReport != null && m.hasOwnProperty("kindReport")) { + d.kindReport = o.enums === String ? $root.proto.Message.BotFeedbackMessage.ReportKind[m.kindReport] === undefined ? m.kindReport : $root.proto.Message.BotFeedbackMessage.ReportKind[m.kindReport] : m.kindReport; + if (o.oneofs) + d._kindReport = "kindReport"; + } + return d; + }; + + BotFeedbackMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotFeedbackMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14458,11 +32925,11 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ButtonsMessage.prototype.contentText = ""; - ButtonsMessage.prototype.footerText = ""; + ButtonsMessage.prototype.contentText = null; + ButtonsMessage.prototype.footerText = null; ButtonsMessage.prototype.contextInfo = null; ButtonsMessage.prototype.buttons = $util.emptyArray; - ButtonsMessage.prototype.headerType = 0; + ButtonsMessage.prototype.headerType = null; ButtonsMessage.prototype.text = null; ButtonsMessage.prototype.documentMessage = null; ButtonsMessage.prototype.imageMessage = null; @@ -14471,6 +32938,30 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsMessage.prototype, "_contentText", { + get: $util.oneOfGetter($oneOfFields = ["contentText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsMessage.prototype, "_footerText", { + get: $util.oneOfGetter($oneOfFields = ["footerText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsMessage.prototype, "_headerType", { + get: $util.oneOfGetter($oneOfFields = ["headerType"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(ButtonsMessage.prototype, "header", { get: $util.oneOfGetter($oneOfFields = ["text", "documentMessage", "imageMessage", "videoMessage", "locationMessage"]), set: $util.oneOfSetter($oneOfFields) @@ -14567,6 +33058,158 @@ export const proto = $root.proto = (() => { return m; }; + ButtonsMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ButtonsMessage) + return d; + var m = new $root.proto.Message.ButtonsMessage(); + if (d.contentText != null) { + m.contentText = String(d.contentText); + } + if (d.footerText != null) { + m.footerText = String(d.footerText); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.buttons) { + if (!Array.isArray(d.buttons)) + throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected"); + m.buttons = []; + for (var i = 0; i < d.buttons.length; ++i) { + if (typeof d.buttons[i] !== "object") + throw TypeError(".proto.Message.ButtonsMessage.buttons: object expected"); + m.buttons[i] = $root.proto.Message.ButtonsMessage.Button.fromObject(d.buttons[i]); + } + } + switch (d.headerType) { + default: + if (typeof d.headerType === "number") { + m.headerType = d.headerType; + break; + } + break; + case "UNKNOWN": + case 0: + m.headerType = 0; + break; + case "EMPTY": + case 1: + m.headerType = 1; + break; + case "TEXT": + case 2: + m.headerType = 2; + break; + case "DOCUMENT": + case 3: + m.headerType = 3; + break; + case "IMAGE": + case 4: + m.headerType = 4; + break; + case "VIDEO": + case 5: + m.headerType = 5; + break; + case "LOCATION": + case 6: + m.headerType = 6; + break; + } + if (d.text != null) { + m.text = String(d.text); + } + if (d.documentMessage != null) { + if (typeof d.documentMessage !== "object") + throw TypeError(".proto.Message.ButtonsMessage.documentMessage: object expected"); + m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage); + } + if (d.imageMessage != null) { + if (typeof d.imageMessage !== "object") + throw TypeError(".proto.Message.ButtonsMessage.imageMessage: object expected"); + m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage); + } + if (d.videoMessage != null) { + if (typeof d.videoMessage !== "object") + throw TypeError(".proto.Message.ButtonsMessage.videoMessage: object expected"); + m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage); + } + if (d.locationMessage != null) { + if (typeof d.locationMessage !== "object") + throw TypeError(".proto.Message.ButtonsMessage.locationMessage: object expected"); + m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage); + } + return m; + }; + + ButtonsMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.buttons = []; + } + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d.header = "text"; + } + if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) { + d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o); + if (o.oneofs) + d.header = "documentMessage"; + } + if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) { + d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o); + if (o.oneofs) + d.header = "imageMessage"; + } + if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) { + d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o); + if (o.oneofs) + d.header = "videoMessage"; + } + if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) { + d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o); + if (o.oneofs) + d.header = "locationMessage"; + } + if (m.contentText != null && m.hasOwnProperty("contentText")) { + d.contentText = m.contentText; + if (o.oneofs) + d._contentText = "contentText"; + } + if (m.footerText != null && m.hasOwnProperty("footerText")) { + d.footerText = m.footerText; + if (o.oneofs) + d._footerText = "footerText"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.buttons && m.buttons.length) { + d.buttons = []; + for (var j = 0; j < m.buttons.length; ++j) { + d.buttons[j] = $root.proto.Message.ButtonsMessage.Button.toObject(m.buttons[j], o); + } + } + if (m.headerType != null && m.hasOwnProperty("headerType")) { + d.headerType = o.enums === String ? $root.proto.Message.ButtonsMessage.HeaderType[m.headerType] === undefined ? m.headerType : $root.proto.Message.ButtonsMessage.HeaderType[m.headerType] : m.headerType; + if (o.oneofs) + d._headerType = "headerType"; + } + return d; + }; + + ButtonsMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ButtonsMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14583,11 +33226,37 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Button.prototype.buttonId = ""; + Button.prototype.buttonId = null; Button.prototype.buttonText = null; - Button.prototype.type = 0; + Button.prototype.type = null; Button.prototype.nativeFlowInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Button.prototype, "_buttonId", { + get: $util.oneOfGetter($oneOfFields = ["buttonId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Button.prototype, "_buttonText", { + get: $util.oneOfGetter($oneOfFields = ["buttonText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Button.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Button.prototype, "_nativeFlowInfo", { + get: $util.oneOfGetter($oneOfFields = ["nativeFlowInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + Button.create = function create(properties) { return new Button(properties); }; @@ -14639,6 +33308,77 @@ export const proto = $root.proto = (() => { return m; }; + Button.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ButtonsMessage.Button) + return d; + var m = new $root.proto.Message.ButtonsMessage.Button(); + if (d.buttonId != null) { + m.buttonId = String(d.buttonId); + } + if (d.buttonText != null) { + if (typeof d.buttonText !== "object") + throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected"); + m.buttonText = $root.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(d.buttonText); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNKNOWN": + case 0: + m.type = 0; + break; + case "RESPONSE": + case 1: + m.type = 1; + break; + case "NATIVE_FLOW": + case 2: + m.type = 2; + break; + } + if (d.nativeFlowInfo != null) { + if (typeof d.nativeFlowInfo !== "object") + throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected"); + m.nativeFlowInfo = $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(d.nativeFlowInfo); + } + return m; + }; + + Button.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.buttonId != null && m.hasOwnProperty("buttonId")) { + d.buttonId = m.buttonId; + if (o.oneofs) + d._buttonId = "buttonId"; + } + if (m.buttonText != null && m.hasOwnProperty("buttonText")) { + d.buttonText = $root.proto.Message.ButtonsMessage.Button.ButtonText.toObject(m.buttonText, o); + if (o.oneofs) + d._buttonText = "buttonText"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.Message.ButtonsMessage.Button.Type[m.type] === undefined ? m.type : $root.proto.Message.ButtonsMessage.Button.Type[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.nativeFlowInfo != null && m.hasOwnProperty("nativeFlowInfo")) { + d.nativeFlowInfo = $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(m.nativeFlowInfo, o); + if (o.oneofs) + d._nativeFlowInfo = "nativeFlowInfo"; + } + return d; + }; + + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Button.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14655,7 +33395,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ButtonText.prototype.displayText = ""; + ButtonText.prototype.displayText = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonText.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); ButtonText.create = function create(properties) { return new ButtonText(properties); @@ -14690,6 +33438,32 @@ export const proto = $root.proto = (() => { return m; }; + ButtonText.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ButtonsMessage.Button.ButtonText) + return d; + var m = new $root.proto.Message.ButtonsMessage.Button.ButtonText(); + if (d.displayText != null) { + m.displayText = String(d.displayText); + } + return m; + }; + + ButtonText.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = m.displayText; + if (o.oneofs) + d._displayText = "displayText"; + } + return d; + }; + + ButtonText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ButtonText.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14709,8 +33483,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NativeFlowInfo.prototype.name = ""; - NativeFlowInfo.prototype.paramsJson = ""; + NativeFlowInfo.prototype.name = null; + NativeFlowInfo.prototype.paramsJson = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowInfo.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowInfo.prototype, "_paramsJson", { + get: $util.oneOfGetter($oneOfFields = ["paramsJson"]), + set: $util.oneOfSetter($oneOfFields) + }); NativeFlowInfo.create = function create(properties) { return new NativeFlowInfo(properties); @@ -14751,6 +33539,40 @@ export const proto = $root.proto = (() => { return m; }; + NativeFlowInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo) + return d; + var m = new $root.proto.Message.ButtonsMessage.Button.NativeFlowInfo(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.paramsJson != null) { + m.paramsJson = String(d.paramsJson); + } + return m; + }; + + NativeFlowInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.paramsJson != null && m.hasOwnProperty("paramsJson")) { + d.paramsJson = m.paramsJson; + if (o.oneofs) + d._paramsJson = "paramsJson"; + } + return d; + }; + + NativeFlowInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NativeFlowInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14796,13 +33618,31 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ButtonsResponseMessage.prototype.selectedButtonId = ""; + ButtonsResponseMessage.prototype.selectedButtonId = null; ButtonsResponseMessage.prototype.contextInfo = null; - ButtonsResponseMessage.prototype.type = 0; + ButtonsResponseMessage.prototype.type = null; ButtonsResponseMessage.prototype.selectedDisplayText = null; let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsResponseMessage.prototype, "_selectedButtonId", { + get: $util.oneOfGetter($oneOfFields = ["selectedButtonId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsResponseMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ButtonsResponseMessage.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(ButtonsResponseMessage.prototype, "response", { get: $util.oneOfGetter($oneOfFields = ["selectedDisplayText"]), set: $util.oneOfSetter($oneOfFields) @@ -14859,6 +33699,71 @@ export const proto = $root.proto = (() => { return m; }; + ButtonsResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ButtonsResponseMessage) + return d; + var m = new $root.proto.Message.ButtonsResponseMessage(); + if (d.selectedButtonId != null) { + m.selectedButtonId = String(d.selectedButtonId); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNKNOWN": + case 0: + m.type = 0; + break; + case "DISPLAY_TEXT": + case 1: + m.type = 1; + break; + } + if (d.selectedDisplayText != null) { + m.selectedDisplayText = String(d.selectedDisplayText); + } + return m; + }; + + ButtonsResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.selectedButtonId != null && m.hasOwnProperty("selectedButtonId")) { + d.selectedButtonId = m.selectedButtonId; + if (o.oneofs) + d._selectedButtonId = "selectedButtonId"; + } + if (m.selectedDisplayText != null && m.hasOwnProperty("selectedDisplayText")) { + d.selectedDisplayText = m.selectedDisplayText; + if (o.oneofs) + d.response = "selectedDisplayText"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.Message.ButtonsResponseMessage.Type[m.type] === undefined ? m.type : $root.proto.Message.ButtonsResponseMessage.Type[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + return d; + }; + + ButtonsResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ButtonsResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14885,14 +33790,58 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Call.prototype.callKey = $util.newBuffer([]); - Call.prototype.conversionSource = ""; - Call.prototype.conversionData = $util.newBuffer([]); - Call.prototype.conversionDelaySeconds = 0; - Call.prototype.ctwaSignals = ""; - Call.prototype.ctwaPayload = $util.newBuffer([]); + Call.prototype.callKey = null; + Call.prototype.conversionSource = null; + Call.prototype.conversionData = null; + Call.prototype.conversionDelaySeconds = null; + Call.prototype.ctwaSignals = null; + Call.prototype.ctwaPayload = null; Call.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_callKey", { + get: $util.oneOfGetter($oneOfFields = ["callKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_conversionSource", { + get: $util.oneOfGetter($oneOfFields = ["conversionSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_conversionData", { + get: $util.oneOfGetter($oneOfFields = ["conversionData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_conversionDelaySeconds", { + get: $util.oneOfGetter($oneOfFields = ["conversionDelaySeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_ctwaSignals", { + get: $util.oneOfGetter($oneOfFields = ["ctwaSignals"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_ctwaPayload", { + get: $util.oneOfGetter($oneOfFields = ["ctwaPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Call.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + Call.create = function create(properties) { return new Call(properties); }; @@ -14962,6 +33911,91 @@ export const proto = $root.proto = (() => { return m; }; + Call.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.Call) + return d; + var m = new $root.proto.Message.Call(); + if (d.callKey != null) { + if (typeof d.callKey === "string") + $util.base64.decode(d.callKey, m.callKey = $util.newBuffer($util.base64.length(d.callKey)), 0); + else if (d.callKey.length >= 0) + m.callKey = d.callKey; + } + if (d.conversionSource != null) { + m.conversionSource = String(d.conversionSource); + } + if (d.conversionData != null) { + if (typeof d.conversionData === "string") + $util.base64.decode(d.conversionData, m.conversionData = $util.newBuffer($util.base64.length(d.conversionData)), 0); + else if (d.conversionData.length >= 0) + m.conversionData = d.conversionData; + } + if (d.conversionDelaySeconds != null) { + m.conversionDelaySeconds = d.conversionDelaySeconds >>> 0; + } + if (d.ctwaSignals != null) { + m.ctwaSignals = String(d.ctwaSignals); + } + if (d.ctwaPayload != null) { + if (typeof d.ctwaPayload === "string") + $util.base64.decode(d.ctwaPayload, m.ctwaPayload = $util.newBuffer($util.base64.length(d.ctwaPayload)), 0); + else if (d.ctwaPayload.length >= 0) + m.ctwaPayload = d.ctwaPayload; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.Call.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + Call.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.callKey != null && m.hasOwnProperty("callKey")) { + d.callKey = o.bytes === String ? $util.base64.encode(m.callKey, 0, m.callKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.callKey) : m.callKey; + if (o.oneofs) + d._callKey = "callKey"; + } + if (m.conversionSource != null && m.hasOwnProperty("conversionSource")) { + d.conversionSource = m.conversionSource; + if (o.oneofs) + d._conversionSource = "conversionSource"; + } + if (m.conversionData != null && m.hasOwnProperty("conversionData")) { + d.conversionData = o.bytes === String ? $util.base64.encode(m.conversionData, 0, m.conversionData.length) : o.bytes === Array ? Array.prototype.slice.call(m.conversionData) : m.conversionData; + if (o.oneofs) + d._conversionData = "conversionData"; + } + if (m.conversionDelaySeconds != null && m.hasOwnProperty("conversionDelaySeconds")) { + d.conversionDelaySeconds = m.conversionDelaySeconds; + if (o.oneofs) + d._conversionDelaySeconds = "conversionDelaySeconds"; + } + if (m.ctwaSignals != null && m.hasOwnProperty("ctwaSignals")) { + d.ctwaSignals = m.ctwaSignals; + if (o.oneofs) + d._ctwaSignals = "ctwaSignals"; + } + if (m.ctwaPayload != null && m.hasOwnProperty("ctwaPayload")) { + d.ctwaPayload = o.bytes === String ? $util.base64.encode(m.ctwaPayload, 0, m.ctwaPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.ctwaPayload) : m.ctwaPayload; + if (o.oneofs) + d._ctwaPayload = "ctwaPayload"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + Call.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Call.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -14982,12 +34016,38 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CallLogMessage.prototype.isVideo = false; - CallLogMessage.prototype.callOutcome = 0; - CallLogMessage.prototype.durationSecs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - CallLogMessage.prototype.callType = 0; + CallLogMessage.prototype.isVideo = null; + CallLogMessage.prototype.callOutcome = null; + CallLogMessage.prototype.durationSecs = null; + CallLogMessage.prototype.callType = null; CallLogMessage.prototype.participants = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogMessage.prototype, "_isVideo", { + get: $util.oneOfGetter($oneOfFields = ["isVideo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogMessage.prototype, "_callOutcome", { + get: $util.oneOfGetter($oneOfFields = ["callOutcome"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogMessage.prototype, "_durationSecs", { + get: $util.oneOfGetter($oneOfFields = ["durationSecs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogMessage.prototype, "_callType", { + get: $util.oneOfGetter($oneOfFields = ["callType"]), + set: $util.oneOfSetter($oneOfFields) + }); + CallLogMessage.create = function create(properties) { return new CallLogMessage(properties); }; @@ -15049,6 +34109,139 @@ export const proto = $root.proto = (() => { return m; }; + CallLogMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.CallLogMessage) + return d; + var m = new $root.proto.Message.CallLogMessage(); + if (d.isVideo != null) { + m.isVideo = Boolean(d.isVideo); + } + switch (d.callOutcome) { + default: + if (typeof d.callOutcome === "number") { + m.callOutcome = d.callOutcome; + break; + } + break; + case "CONNECTED": + case 0: + m.callOutcome = 0; + break; + case "MISSED": + case 1: + m.callOutcome = 1; + break; + case "FAILED": + case 2: + m.callOutcome = 2; + break; + case "REJECTED": + case 3: + m.callOutcome = 3; + break; + case "ACCEPTED_ELSEWHERE": + case 4: + m.callOutcome = 4; + break; + case "ONGOING": + case 5: + m.callOutcome = 5; + break; + case "SILENCED_BY_DND": + case 6: + m.callOutcome = 6; + break; + case "SILENCED_UNKNOWN_CALLER": + case 7: + m.callOutcome = 7; + break; + } + if (d.durationSecs != null) { + if ($util.Long) + (m.durationSecs = $util.Long.fromValue(d.durationSecs)).unsigned = false; + else if (typeof d.durationSecs === "string") + m.durationSecs = parseInt(d.durationSecs, 10); + else if (typeof d.durationSecs === "number") + m.durationSecs = d.durationSecs; + else if (typeof d.durationSecs === "object") + m.durationSecs = new $util.LongBits(d.durationSecs.low >>> 0, d.durationSecs.high >>> 0).toNumber(); + } + switch (d.callType) { + default: + if (typeof d.callType === "number") { + m.callType = d.callType; + break; + } + break; + case "REGULAR": + case 0: + m.callType = 0; + break; + case "SCHEDULED_CALL": + case 1: + m.callType = 1; + break; + case "VOICE_CHAT": + case 2: + m.callType = 2; + break; + } + if (d.participants) { + if (!Array.isArray(d.participants)) + throw TypeError(".proto.Message.CallLogMessage.participants: array expected"); + m.participants = []; + for (var i = 0; i < d.participants.length; ++i) { + if (typeof d.participants[i] !== "object") + throw TypeError(".proto.Message.CallLogMessage.participants: object expected"); + m.participants[i] = $root.proto.Message.CallLogMessage.CallParticipant.fromObject(d.participants[i]); + } + } + return m; + }; + + CallLogMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.participants = []; + } + if (m.isVideo != null && m.hasOwnProperty("isVideo")) { + d.isVideo = m.isVideo; + if (o.oneofs) + d._isVideo = "isVideo"; + } + if (m.callOutcome != null && m.hasOwnProperty("callOutcome")) { + d.callOutcome = o.enums === String ? $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] === undefined ? m.callOutcome : $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] : m.callOutcome; + if (o.oneofs) + d._callOutcome = "callOutcome"; + } + if (m.durationSecs != null && m.hasOwnProperty("durationSecs")) { + if (typeof m.durationSecs === "number") + d.durationSecs = o.longs === String ? String(m.durationSecs) : m.durationSecs; + else + d.durationSecs = o.longs === String ? $util.Long.prototype.toString.call(m.durationSecs) : o.longs === Number ? new $util.LongBits(m.durationSecs.low >>> 0, m.durationSecs.high >>> 0).toNumber() : m.durationSecs; + if (o.oneofs) + d._durationSecs = "durationSecs"; + } + if (m.callType != null && m.hasOwnProperty("callType")) { + d.callType = o.enums === String ? $root.proto.Message.CallLogMessage.CallType[m.callType] === undefined ? m.callType : $root.proto.Message.CallLogMessage.CallType[m.callType] : m.callType; + if (o.oneofs) + d._callType = "callType"; + } + if (m.participants && m.participants.length) { + d.participants = []; + for (var j = 0; j < m.participants.length; ++j) { + d.participants[j] = $root.proto.Message.CallLogMessage.CallParticipant.toObject(m.participants[j], o); + } + } + return d; + }; + + CallLogMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CallLogMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15078,8 +34271,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CallParticipant.prototype.jid = ""; - CallParticipant.prototype.callOutcome = 0; + CallParticipant.prototype.jid = null; + CallParticipant.prototype.callOutcome = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallParticipant.prototype, "_jid", { + get: $util.oneOfGetter($oneOfFields = ["jid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallParticipant.prototype, "_callOutcome", { + get: $util.oneOfGetter($oneOfFields = ["callOutcome"]), + set: $util.oneOfSetter($oneOfFields) + }); CallParticipant.create = function create(properties) { return new CallParticipant(properties); @@ -15120,6 +34327,77 @@ export const proto = $root.proto = (() => { return m; }; + CallParticipant.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.CallLogMessage.CallParticipant) + return d; + var m = new $root.proto.Message.CallLogMessage.CallParticipant(); + if (d.jid != null) { + m.jid = String(d.jid); + } + switch (d.callOutcome) { + default: + if (typeof d.callOutcome === "number") { + m.callOutcome = d.callOutcome; + break; + } + break; + case "CONNECTED": + case 0: + m.callOutcome = 0; + break; + case "MISSED": + case 1: + m.callOutcome = 1; + break; + case "FAILED": + case 2: + m.callOutcome = 2; + break; + case "REJECTED": + case 3: + m.callOutcome = 3; + break; + case "ACCEPTED_ELSEWHERE": + case 4: + m.callOutcome = 4; + break; + case "ONGOING": + case 5: + m.callOutcome = 5; + break; + case "SILENCED_BY_DND": + case 6: + m.callOutcome = 6; + break; + case "SILENCED_UNKNOWN_CALLER": + case 7: + m.callOutcome = 7; + break; + } + return m; + }; + + CallParticipant.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.jid != null && m.hasOwnProperty("jid")) { + d.jid = m.jid; + if (o.oneofs) + d._jid = "jid"; + } + if (m.callOutcome != null && m.hasOwnProperty("callOutcome")) { + d.callOutcome = o.enums === String ? $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] === undefined ? m.callOutcome : $root.proto.Message.CallLogMessage.CallOutcome[m.callOutcome] : m.callOutcome; + if (o.oneofs) + d._callOutcome = "callOutcome"; + } + return d; + }; + + CallParticipant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CallParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15152,6 +34430,14 @@ export const proto = $root.proto = (() => { CancelPaymentRequestMessage.prototype.key = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CancelPaymentRequestMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + CancelPaymentRequestMessage.create = function create(properties) { return new CancelPaymentRequestMessage(properties); }; @@ -15185,6 +34471,34 @@ export const proto = $root.proto = (() => { return m; }; + CancelPaymentRequestMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.CancelPaymentRequestMessage) + return d; + var m = new $root.proto.Message.CancelPaymentRequestMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + return m; + }; + + CancelPaymentRequestMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + return d; + }; + + CancelPaymentRequestMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CancelPaymentRequestMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15204,8 +34518,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Chat.prototype.displayName = ""; - Chat.prototype.id = ""; + Chat.prototype.displayName = null; + Chat.prototype.id = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Chat.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Chat.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); Chat.create = function create(properties) { return new Chat(properties); @@ -15246,6 +34574,40 @@ export const proto = $root.proto = (() => { return m; }; + Chat.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.Chat) + return d; + var m = new $root.proto.Message.Chat(); + if (d.displayName != null) { + m.displayName = String(d.displayName); + } + if (d.id != null) { + m.id = String(d.id); + } + return m; + }; + + Chat.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayName != null && m.hasOwnProperty("displayName")) { + d.displayName = m.displayName; + if (o.oneofs) + d._displayName = "displayName"; + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + return d; + }; + + Chat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Chat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15265,12 +34627,44 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CloudAPIThreadControlNotification.prototype.status = 0; - CloudAPIThreadControlNotification.prototype.senderNotificationTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - CloudAPIThreadControlNotification.prototype.consumerLid = ""; - CloudAPIThreadControlNotification.prototype.consumerPhoneNumber = ""; + CloudAPIThreadControlNotification.prototype.status = null; + CloudAPIThreadControlNotification.prototype.senderNotificationTimestampMs = null; + CloudAPIThreadControlNotification.prototype.consumerLid = null; + CloudAPIThreadControlNotification.prototype.consumerPhoneNumber = null; CloudAPIThreadControlNotification.prototype.notificationContent = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_senderNotificationTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderNotificationTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_consumerLid", { + get: $util.oneOfGetter($oneOfFields = ["consumerLid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_consumerPhoneNumber", { + get: $util.oneOfGetter($oneOfFields = ["consumerPhoneNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotification.prototype, "_notificationContent", { + get: $util.oneOfGetter($oneOfFields = ["notificationContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + CloudAPIThreadControlNotification.create = function create(properties) { return new CloudAPIThreadControlNotification(properties); }; @@ -15328,6 +34722,93 @@ export const proto = $root.proto = (() => { return m; }; + CloudAPIThreadControlNotification.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.CloudAPIThreadControlNotification) + return d; + var m = new $root.proto.Message.CloudAPIThreadControlNotification(); + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "UNKNOWN": + case 0: + m.status = 0; + break; + case "CONTROL_PASSED": + case 1: + m.status = 1; + break; + case "CONTROL_TAKEN": + case 2: + m.status = 2; + break; + } + if (d.senderNotificationTimestampMs != null) { + if ($util.Long) + (m.senderNotificationTimestampMs = $util.Long.fromValue(d.senderNotificationTimestampMs)).unsigned = false; + else if (typeof d.senderNotificationTimestampMs === "string") + m.senderNotificationTimestampMs = parseInt(d.senderNotificationTimestampMs, 10); + else if (typeof d.senderNotificationTimestampMs === "number") + m.senderNotificationTimestampMs = d.senderNotificationTimestampMs; + else if (typeof d.senderNotificationTimestampMs === "object") + m.senderNotificationTimestampMs = new $util.LongBits(d.senderNotificationTimestampMs.low >>> 0, d.senderNotificationTimestampMs.high >>> 0).toNumber(); + } + if (d.consumerLid != null) { + m.consumerLid = String(d.consumerLid); + } + if (d.consumerPhoneNumber != null) { + m.consumerPhoneNumber = String(d.consumerPhoneNumber); + } + if (d.notificationContent != null) { + if (typeof d.notificationContent !== "object") + throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected"); + m.notificationContent = $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(d.notificationContent); + } + return m; + }; + + CloudAPIThreadControlNotification.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[m.status] === undefined ? m.status : $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[m.status] : m.status; + if (o.oneofs) + d._status = "status"; + } + if (m.senderNotificationTimestampMs != null && m.hasOwnProperty("senderNotificationTimestampMs")) { + if (typeof m.senderNotificationTimestampMs === "number") + d.senderNotificationTimestampMs = o.longs === String ? String(m.senderNotificationTimestampMs) : m.senderNotificationTimestampMs; + else + d.senderNotificationTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderNotificationTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderNotificationTimestampMs.low >>> 0, m.senderNotificationTimestampMs.high >>> 0).toNumber() : m.senderNotificationTimestampMs; + if (o.oneofs) + d._senderNotificationTimestampMs = "senderNotificationTimestampMs"; + } + if (m.consumerLid != null && m.hasOwnProperty("consumerLid")) { + d.consumerLid = m.consumerLid; + if (o.oneofs) + d._consumerLid = "consumerLid"; + } + if (m.consumerPhoneNumber != null && m.hasOwnProperty("consumerPhoneNumber")) { + d.consumerPhoneNumber = m.consumerPhoneNumber; + if (o.oneofs) + d._consumerPhoneNumber = "consumerPhoneNumber"; + } + if (m.notificationContent != null && m.hasOwnProperty("notificationContent")) { + d.notificationContent = $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(m.notificationContent, o); + if (o.oneofs) + d._notificationContent = "notificationContent"; + } + return d; + }; + + CloudAPIThreadControlNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CloudAPIThreadControlNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15352,8 +34833,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CloudAPIThreadControlNotificationContent.prototype.handoffNotificationText = ""; - CloudAPIThreadControlNotificationContent.prototype.extraJson = ""; + CloudAPIThreadControlNotificationContent.prototype.handoffNotificationText = null; + CloudAPIThreadControlNotificationContent.prototype.extraJson = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotificationContent.prototype, "_handoffNotificationText", { + get: $util.oneOfGetter($oneOfFields = ["handoffNotificationText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CloudAPIThreadControlNotificationContent.prototype, "_extraJson", { + get: $util.oneOfGetter($oneOfFields = ["extraJson"]), + set: $util.oneOfSetter($oneOfFields) + }); CloudAPIThreadControlNotificationContent.create = function create(properties) { return new CloudAPIThreadControlNotificationContent(properties); @@ -15394,6 +34889,40 @@ export const proto = $root.proto = (() => { return m; }; + CloudAPIThreadControlNotificationContent.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent) + return d; + var m = new $root.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent(); + if (d.handoffNotificationText != null) { + m.handoffNotificationText = String(d.handoffNotificationText); + } + if (d.extraJson != null) { + m.extraJson = String(d.extraJson); + } + return m; + }; + + CloudAPIThreadControlNotificationContent.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.handoffNotificationText != null && m.hasOwnProperty("handoffNotificationText")) { + d.handoffNotificationText = m.handoffNotificationText; + if (o.oneofs) + d._handoffNotificationText = "handoffNotificationText"; + } + if (m.extraJson != null && m.hasOwnProperty("extraJson")) { + d.extraJson = m.extraJson; + if (o.oneofs) + d._extraJson = "extraJson"; + } + return d; + }; + + CloudAPIThreadControlNotificationContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CloudAPIThreadControlNotificationContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15419,6 +34948,20 @@ export const proto = $root.proto = (() => { CommentMessage.prototype.message = null; CommentMessage.prototype.targetMessageKey = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CommentMessage.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CommentMessage.prototype, "_targetMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + CommentMessage.create = function create(properties) { return new CommentMessage(properties); }; @@ -15458,6 +35001,44 @@ export const proto = $root.proto = (() => { return m; }; + CommentMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.CommentMessage) + return d; + var m = new $root.proto.Message.CommentMessage(); + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.Message.CommentMessage.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + if (d.targetMessageKey != null) { + if (typeof d.targetMessageKey !== "object") + throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected"); + m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey); + } + return m; + }; + + CommentMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) { + d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o); + if (o.oneofs) + d._targetMessageKey = "targetMessageKey"; + } + return d; + }; + + CommentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CommentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15477,10 +35058,30 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ContactMessage.prototype.displayName = ""; - ContactMessage.prototype.vcard = ""; + ContactMessage.prototype.displayName = null; + ContactMessage.prototype.vcard = null; ContactMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactMessage.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactMessage.prototype, "_vcard", { + get: $util.oneOfGetter($oneOfFields = ["vcard"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + ContactMessage.create = function create(properties) { return new ContactMessage(properties); }; @@ -15526,6 +35127,50 @@ export const proto = $root.proto = (() => { return m; }; + ContactMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ContactMessage) + return d; + var m = new $root.proto.Message.ContactMessage(); + if (d.displayName != null) { + m.displayName = String(d.displayName); + } + if (d.vcard != null) { + m.vcard = String(d.vcard); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + ContactMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayName != null && m.hasOwnProperty("displayName")) { + d.displayName = m.displayName; + if (o.oneofs) + d._displayName = "displayName"; + } + if (m.vcard != null && m.hasOwnProperty("vcard")) { + d.vcard = m.vcard; + if (o.oneofs) + d._vcard = "vcard"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + ContactMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ContactMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15546,10 +35191,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ContactsArrayMessage.prototype.displayName = ""; + ContactsArrayMessage.prototype.displayName = null; ContactsArrayMessage.prototype.contacts = $util.emptyArray; ContactsArrayMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactsArrayMessage.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactsArrayMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + ContactsArrayMessage.create = function create(properties) { return new ContactsArrayMessage(properties); }; @@ -15599,6 +35258,61 @@ export const proto = $root.proto = (() => { return m; }; + ContactsArrayMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ContactsArrayMessage) + return d; + var m = new $root.proto.Message.ContactsArrayMessage(); + if (d.displayName != null) { + m.displayName = String(d.displayName); + } + if (d.contacts) { + if (!Array.isArray(d.contacts)) + throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected"); + m.contacts = []; + for (var i = 0; i < d.contacts.length; ++i) { + if (typeof d.contacts[i] !== "object") + throw TypeError(".proto.Message.ContactsArrayMessage.contacts: object expected"); + m.contacts[i] = $root.proto.Message.ContactMessage.fromObject(d.contacts[i]); + } + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ContactsArrayMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + ContactsArrayMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.contacts = []; + } + if (m.displayName != null && m.hasOwnProperty("displayName")) { + d.displayName = m.displayName; + if (o.oneofs) + d._displayName = "displayName"; + } + if (m.contacts && m.contacts.length) { + d.contacts = []; + for (var j = 0; j < m.contacts.length; ++j) { + d.contacts[j] = $root.proto.Message.ContactMessage.toObject(m.contacts[j], o); + } + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + ContactsArrayMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ContactsArrayMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15620,6 +35334,14 @@ export const proto = $root.proto = (() => { DeclinePaymentRequestMessage.prototype.key = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeclinePaymentRequestMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + DeclinePaymentRequestMessage.create = function create(properties) { return new DeclinePaymentRequestMessage(properties); }; @@ -15653,6 +35375,34 @@ export const proto = $root.proto = (() => { return m; }; + DeclinePaymentRequestMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.DeclinePaymentRequestMessage) + return d; + var m = new $root.proto.Message.DeclinePaymentRequestMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + return m; + }; + + DeclinePaymentRequestMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + return d; + }; + + DeclinePaymentRequestMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeclinePaymentRequestMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15672,9 +35422,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeviceSentMessage.prototype.destinationJid = ""; + DeviceSentMessage.prototype.destinationJid = null; DeviceSentMessage.prototype.message = null; - DeviceSentMessage.prototype.phash = ""; + DeviceSentMessage.prototype.phash = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceSentMessage.prototype, "_destinationJid", { + get: $util.oneOfGetter($oneOfFields = ["destinationJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceSentMessage.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeviceSentMessage.prototype, "_phash", { + get: $util.oneOfGetter($oneOfFields = ["phash"]), + set: $util.oneOfSetter($oneOfFields) + }); DeviceSentMessage.create = function create(properties) { return new DeviceSentMessage(properties); @@ -15721,6 +35491,50 @@ export const proto = $root.proto = (() => { return m; }; + DeviceSentMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.DeviceSentMessage) + return d; + var m = new $root.proto.Message.DeviceSentMessage(); + if (d.destinationJid != null) { + m.destinationJid = String(d.destinationJid); + } + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.Message.DeviceSentMessage.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + if (d.phash != null) { + m.phash = String(d.phash); + } + return m; + }; + + DeviceSentMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.destinationJid != null && m.hasOwnProperty("destinationJid")) { + d.destinationJid = m.destinationJid; + if (o.oneofs) + d._destinationJid = "destinationJid"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + if (m.phash != null && m.hasOwnProperty("phash")) { + d.phash = m.phash; + if (o.oneofs) + d._phash = "phash"; + } + return d; + }; + + DeviceSentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeviceSentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15740,27 +35554,155 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DocumentMessage.prototype.url = ""; - DocumentMessage.prototype.mimetype = ""; - DocumentMessage.prototype.title = ""; - DocumentMessage.prototype.fileSha256 = $util.newBuffer([]); - DocumentMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - DocumentMessage.prototype.pageCount = 0; - DocumentMessage.prototype.mediaKey = $util.newBuffer([]); - DocumentMessage.prototype.fileName = ""; - DocumentMessage.prototype.fileEncSha256 = $util.newBuffer([]); - DocumentMessage.prototype.directPath = ""; - DocumentMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - DocumentMessage.prototype.contactVcard = false; - DocumentMessage.prototype.thumbnailDirectPath = ""; - DocumentMessage.prototype.thumbnailSha256 = $util.newBuffer([]); - DocumentMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); - DocumentMessage.prototype.jpegThumbnail = $util.newBuffer([]); + DocumentMessage.prototype.url = null; + DocumentMessage.prototype.mimetype = null; + DocumentMessage.prototype.title = null; + DocumentMessage.prototype.fileSha256 = null; + DocumentMessage.prototype.fileLength = null; + DocumentMessage.prototype.pageCount = null; + DocumentMessage.prototype.mediaKey = null; + DocumentMessage.prototype.fileName = null; + DocumentMessage.prototype.fileEncSha256 = null; + DocumentMessage.prototype.directPath = null; + DocumentMessage.prototype.mediaKeyTimestamp = null; + DocumentMessage.prototype.contactVcard = null; + DocumentMessage.prototype.thumbnailDirectPath = null; + DocumentMessage.prototype.thumbnailSha256 = null; + DocumentMessage.prototype.thumbnailEncSha256 = null; + DocumentMessage.prototype.jpegThumbnail = null; DocumentMessage.prototype.contextInfo = null; - DocumentMessage.prototype.thumbnailHeight = 0; - DocumentMessage.prototype.thumbnailWidth = 0; - DocumentMessage.prototype.caption = ""; - DocumentMessage.prototype.accessibilityLabel = ""; + DocumentMessage.prototype.thumbnailHeight = null; + DocumentMessage.prototype.thumbnailWidth = null; + DocumentMessage.prototype.caption = null; + DocumentMessage.prototype.accessibilityLabel = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_pageCount", { + get: $util.oneOfGetter($oneOfFields = ["pageCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_fileName", { + get: $util.oneOfGetter($oneOfFields = ["fileName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_contactVcard", { + get: $util.oneOfGetter($oneOfFields = ["contactVcard"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_thumbnailDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_thumbnailSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_thumbnailEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_thumbnailHeight", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_thumbnailWidth", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DocumentMessage.prototype, "_accessibilityLabel", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); DocumentMessage.create = function create(properties) { return new DocumentMessage(properties); @@ -15915,6 +35857,232 @@ export const proto = $root.proto = (() => { return m; }; + DocumentMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.DocumentMessage) + return d; + var m = new $root.proto.Message.DocumentMessage(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.pageCount != null) { + m.pageCount = d.pageCount >>> 0; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.fileName != null) { + m.fileName = String(d.fileName); + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.contactVcard != null) { + m.contactVcard = Boolean(d.contactVcard); + } + if (d.thumbnailDirectPath != null) { + m.thumbnailDirectPath = String(d.thumbnailDirectPath); + } + if (d.thumbnailSha256 != null) { + if (typeof d.thumbnailSha256 === "string") + $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0); + else if (d.thumbnailSha256.length >= 0) + m.thumbnailSha256 = d.thumbnailSha256; + } + if (d.thumbnailEncSha256 != null) { + if (typeof d.thumbnailEncSha256 === "string") + $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0); + else if (d.thumbnailEncSha256.length >= 0) + m.thumbnailEncSha256 = d.thumbnailEncSha256; + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.thumbnailHeight != null) { + m.thumbnailHeight = d.thumbnailHeight >>> 0; + } + if (d.thumbnailWidth != null) { + m.thumbnailWidth = d.thumbnailWidth >>> 0; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.accessibilityLabel != null) { + m.accessibilityLabel = String(d.accessibilityLabel); + } + return m; + }; + + DocumentMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.pageCount != null && m.hasOwnProperty("pageCount")) { + d.pageCount = m.pageCount; + if (o.oneofs) + d._pageCount = "pageCount"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.fileName != null && m.hasOwnProperty("fileName")) { + d.fileName = m.fileName; + if (o.oneofs) + d._fileName = "fileName"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.contactVcard != null && m.hasOwnProperty("contactVcard")) { + d.contactVcard = m.contactVcard; + if (o.oneofs) + d._contactVcard = "contactVcard"; + } + if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) { + d.thumbnailDirectPath = m.thumbnailDirectPath; + if (o.oneofs) + d._thumbnailDirectPath = "thumbnailDirectPath"; + } + if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) { + d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256; + if (o.oneofs) + d._thumbnailSha256 = "thumbnailSha256"; + } + if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) { + d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256; + if (o.oneofs) + d._thumbnailEncSha256 = "thumbnailEncSha256"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) { + d.thumbnailHeight = m.thumbnailHeight; + if (o.oneofs) + d._thumbnailHeight = "thumbnailHeight"; + } + if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) { + d.thumbnailWidth = m.thumbnailWidth; + if (o.oneofs) + d._thumbnailWidth = "thumbnailWidth"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) { + d.accessibilityLabel = m.accessibilityLabel; + if (o.oneofs) + d._accessibilityLabel = "accessibilityLabel"; + } + return d; + }; + + DocumentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DocumentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -15935,8 +36103,28 @@ export const proto = $root.proto = (() => { } EncCommentMessage.prototype.targetMessageKey = null; - EncCommentMessage.prototype.encPayload = $util.newBuffer([]); - EncCommentMessage.prototype.encIv = $util.newBuffer([]); + EncCommentMessage.prototype.encPayload = null; + EncCommentMessage.prototype.encIv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncCommentMessage.prototype, "_targetMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncCommentMessage.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncCommentMessage.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); EncCommentMessage.create = function create(properties) { return new EncCommentMessage(properties); @@ -15983,6 +36171,56 @@ export const proto = $root.proto = (() => { return m; }; + EncCommentMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.EncCommentMessage) + return d; + var m = new $root.proto.Message.EncCommentMessage(); + if (d.targetMessageKey != null) { + if (typeof d.targetMessageKey !== "object") + throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected"); + m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey); + } + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + return m; + }; + + EncCommentMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) { + d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o); + if (o.oneofs) + d._targetMessageKey = "targetMessageKey"; + } + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + return d; + }; + + EncCommentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EncCommentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16003,8 +36241,28 @@ export const proto = $root.proto = (() => { } EncEventResponseMessage.prototype.eventCreationMessageKey = null; - EncEventResponseMessage.prototype.encPayload = $util.newBuffer([]); - EncEventResponseMessage.prototype.encIv = $util.newBuffer([]); + EncEventResponseMessage.prototype.encPayload = null; + EncEventResponseMessage.prototype.encIv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncEventResponseMessage.prototype, "_eventCreationMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["eventCreationMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncEventResponseMessage.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncEventResponseMessage.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); EncEventResponseMessage.create = function create(properties) { return new EncEventResponseMessage(properties); @@ -16051,6 +36309,56 @@ export const proto = $root.proto = (() => { return m; }; + EncEventResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.EncEventResponseMessage) + return d; + var m = new $root.proto.Message.EncEventResponseMessage(); + if (d.eventCreationMessageKey != null) { + if (typeof d.eventCreationMessageKey !== "object") + throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected"); + m.eventCreationMessageKey = $root.proto.MessageKey.fromObject(d.eventCreationMessageKey); + } + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + return m; + }; + + EncEventResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.eventCreationMessageKey != null && m.hasOwnProperty("eventCreationMessageKey")) { + d.eventCreationMessageKey = $root.proto.MessageKey.toObject(m.eventCreationMessageKey, o); + if (o.oneofs) + d._eventCreationMessageKey = "eventCreationMessageKey"; + } + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + return d; + }; + + EncEventResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EncEventResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16071,8 +36379,28 @@ export const proto = $root.proto = (() => { } EncReactionMessage.prototype.targetMessageKey = null; - EncReactionMessage.prototype.encPayload = $util.newBuffer([]); - EncReactionMessage.prototype.encIv = $util.newBuffer([]); + EncReactionMessage.prototype.encPayload = null; + EncReactionMessage.prototype.encIv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncReactionMessage.prototype, "_targetMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncReactionMessage.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncReactionMessage.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); EncReactionMessage.create = function create(properties) { return new EncReactionMessage(properties); @@ -16119,6 +36447,56 @@ export const proto = $root.proto = (() => { return m; }; + EncReactionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.EncReactionMessage) + return d; + var m = new $root.proto.Message.EncReactionMessage(); + if (d.targetMessageKey != null) { + if (typeof d.targetMessageKey !== "object") + throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected"); + m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey); + } + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + return m; + }; + + EncReactionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) { + d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o); + if (o.oneofs) + d._targetMessageKey = "targetMessageKey"; + } + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + return d; + }; + + EncReactionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EncReactionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16139,15 +36517,77 @@ export const proto = $root.proto = (() => { } EventMessage.prototype.contextInfo = null; - EventMessage.prototype.isCanceled = false; - EventMessage.prototype.name = ""; - EventMessage.prototype.description = ""; + EventMessage.prototype.isCanceled = null; + EventMessage.prototype.name = null; + EventMessage.prototype.description = null; EventMessage.prototype.location = null; - EventMessage.prototype.joinLink = ""; - EventMessage.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - EventMessage.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - EventMessage.prototype.extraGuestsAllowed = false; - EventMessage.prototype.isScheduleCall = false; + EventMessage.prototype.joinLink = null; + EventMessage.prototype.startTime = null; + EventMessage.prototype.endTime = null; + EventMessage.prototype.extraGuestsAllowed = null; + EventMessage.prototype.isScheduleCall = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_isCanceled", { + get: $util.oneOfGetter($oneOfFields = ["isCanceled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_location", { + get: $util.oneOfGetter($oneOfFields = ["location"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_joinLink", { + get: $util.oneOfGetter($oneOfFields = ["joinLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_endTime", { + get: $util.oneOfGetter($oneOfFields = ["endTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_extraGuestsAllowed", { + get: $util.oneOfGetter($oneOfFields = ["extraGuestsAllowed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventMessage.prototype, "_isScheduleCall", { + get: $util.oneOfGetter($oneOfFields = ["isScheduleCall"]), + set: $util.oneOfSetter($oneOfFields) + }); EventMessage.create = function create(properties) { return new EventMessage(properties); @@ -16236,6 +36676,128 @@ export const proto = $root.proto = (() => { return m; }; + EventMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.EventMessage) + return d; + var m = new $root.proto.Message.EventMessage(); + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.EventMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.isCanceled != null) { + m.isCanceled = Boolean(d.isCanceled); + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.location != null) { + if (typeof d.location !== "object") + throw TypeError(".proto.Message.EventMessage.location: object expected"); + m.location = $root.proto.Message.LocationMessage.fromObject(d.location); + } + if (d.joinLink != null) { + m.joinLink = String(d.joinLink); + } + if (d.startTime != null) { + if ($util.Long) + (m.startTime = $util.Long.fromValue(d.startTime)).unsigned = false; + else if (typeof d.startTime === "string") + m.startTime = parseInt(d.startTime, 10); + else if (typeof d.startTime === "number") + m.startTime = d.startTime; + else if (typeof d.startTime === "object") + m.startTime = new $util.LongBits(d.startTime.low >>> 0, d.startTime.high >>> 0).toNumber(); + } + if (d.endTime != null) { + if ($util.Long) + (m.endTime = $util.Long.fromValue(d.endTime)).unsigned = false; + else if (typeof d.endTime === "string") + m.endTime = parseInt(d.endTime, 10); + else if (typeof d.endTime === "number") + m.endTime = d.endTime; + else if (typeof d.endTime === "object") + m.endTime = new $util.LongBits(d.endTime.low >>> 0, d.endTime.high >>> 0).toNumber(); + } + if (d.extraGuestsAllowed != null) { + m.extraGuestsAllowed = Boolean(d.extraGuestsAllowed); + } + if (d.isScheduleCall != null) { + m.isScheduleCall = Boolean(d.isScheduleCall); + } + return m; + }; + + EventMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.isCanceled != null && m.hasOwnProperty("isCanceled")) { + d.isCanceled = m.isCanceled; + if (o.oneofs) + d._isCanceled = "isCanceled"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.location != null && m.hasOwnProperty("location")) { + d.location = $root.proto.Message.LocationMessage.toObject(m.location, o); + if (o.oneofs) + d._location = "location"; + } + if (m.joinLink != null && m.hasOwnProperty("joinLink")) { + d.joinLink = m.joinLink; + if (o.oneofs) + d._joinLink = "joinLink"; + } + if (m.startTime != null && m.hasOwnProperty("startTime")) { + if (typeof m.startTime === "number") + d.startTime = o.longs === String ? String(m.startTime) : m.startTime; + else + d.startTime = o.longs === String ? $util.Long.prototype.toString.call(m.startTime) : o.longs === Number ? new $util.LongBits(m.startTime.low >>> 0, m.startTime.high >>> 0).toNumber() : m.startTime; + if (o.oneofs) + d._startTime = "startTime"; + } + if (m.endTime != null && m.hasOwnProperty("endTime")) { + if (typeof m.endTime === "number") + d.endTime = o.longs === String ? String(m.endTime) : m.endTime; + else + d.endTime = o.longs === String ? $util.Long.prototype.toString.call(m.endTime) : o.longs === Number ? new $util.LongBits(m.endTime.low >>> 0, m.endTime.high >>> 0).toNumber() : m.endTime; + if (o.oneofs) + d._endTime = "endTime"; + } + if (m.extraGuestsAllowed != null && m.hasOwnProperty("extraGuestsAllowed")) { + d.extraGuestsAllowed = m.extraGuestsAllowed; + if (o.oneofs) + d._extraGuestsAllowed = "extraGuestsAllowed"; + } + if (m.isScheduleCall != null && m.hasOwnProperty("isScheduleCall")) { + d.isScheduleCall = m.isScheduleCall; + if (o.oneofs) + d._isScheduleCall = "isScheduleCall"; + } + return d; + }; + + EventMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EventMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16255,9 +36817,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EventResponseMessage.prototype.response = 0; - EventResponseMessage.prototype.timestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - EventResponseMessage.prototype.extraGuestCount = 0; + EventResponseMessage.prototype.response = null; + EventResponseMessage.prototype.timestampMs = null; + EventResponseMessage.prototype.extraGuestCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponseMessage.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponseMessage.prototype, "_timestampMs", { + get: $util.oneOfGetter($oneOfFields = ["timestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventResponseMessage.prototype, "_extraGuestCount", { + get: $util.oneOfGetter($oneOfFields = ["extraGuestCount"]), + set: $util.oneOfSetter($oneOfFields) + }); EventResponseMessage.create = function create(properties) { return new EventResponseMessage(properties); @@ -16304,6 +36886,79 @@ export const proto = $root.proto = (() => { return m; }; + EventResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.EventResponseMessage) + return d; + var m = new $root.proto.Message.EventResponseMessage(); + switch (d.response) { + default: + if (typeof d.response === "number") { + m.response = d.response; + break; + } + break; + case "UNKNOWN": + case 0: + m.response = 0; + break; + case "GOING": + case 1: + m.response = 1; + break; + case "NOT_GOING": + case 2: + m.response = 2; + break; + case "MAYBE": + case 3: + m.response = 3; + break; + } + if (d.timestampMs != null) { + if ($util.Long) + (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false; + else if (typeof d.timestampMs === "string") + m.timestampMs = parseInt(d.timestampMs, 10); + else if (typeof d.timestampMs === "number") + m.timestampMs = d.timestampMs; + else if (typeof d.timestampMs === "object") + m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber(); + } + if (d.extraGuestCount != null) { + m.extraGuestCount = d.extraGuestCount | 0; + } + return m; + }; + + EventResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.response != null && m.hasOwnProperty("response")) { + d.response = o.enums === String ? $root.proto.Message.EventResponseMessage.EventResponseType[m.response] === undefined ? m.response : $root.proto.Message.EventResponseMessage.EventResponseType[m.response] : m.response; + if (o.oneofs) + d._response = "response"; + } + if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) { + if (typeof m.timestampMs === "number") + d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; + else + d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + if (o.oneofs) + d._timestampMs = "timestampMs"; + } + if (m.extraGuestCount != null && m.hasOwnProperty("extraGuestCount")) { + d.extraGuestCount = m.extraGuestCount; + if (o.oneofs) + d._extraGuestCount = "extraGuestCount"; + } + return d; + }; + + EventResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EventResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16332,35 +36987,205 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ExtendedTextMessage.prototype.text = ""; - ExtendedTextMessage.prototype.matchedText = ""; - ExtendedTextMessage.prototype.description = ""; - ExtendedTextMessage.prototype.title = ""; - ExtendedTextMessage.prototype.textArgb = 0; - ExtendedTextMessage.prototype.backgroundArgb = 0; - ExtendedTextMessage.prototype.font = 0; - ExtendedTextMessage.prototype.previewType = 0; - ExtendedTextMessage.prototype.jpegThumbnail = $util.newBuffer([]); + ExtendedTextMessage.prototype.text = null; + ExtendedTextMessage.prototype.matchedText = null; + ExtendedTextMessage.prototype.description = null; + ExtendedTextMessage.prototype.title = null; + ExtendedTextMessage.prototype.textArgb = null; + ExtendedTextMessage.prototype.backgroundArgb = null; + ExtendedTextMessage.prototype.font = null; + ExtendedTextMessage.prototype.previewType = null; + ExtendedTextMessage.prototype.jpegThumbnail = null; ExtendedTextMessage.prototype.contextInfo = null; - ExtendedTextMessage.prototype.doNotPlayInline = false; - ExtendedTextMessage.prototype.thumbnailDirectPath = ""; - ExtendedTextMessage.prototype.thumbnailSha256 = $util.newBuffer([]); - ExtendedTextMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); - ExtendedTextMessage.prototype.mediaKey = $util.newBuffer([]); - ExtendedTextMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - ExtendedTextMessage.prototype.thumbnailHeight = 0; - ExtendedTextMessage.prototype.thumbnailWidth = 0; - ExtendedTextMessage.prototype.inviteLinkGroupType = 0; - ExtendedTextMessage.prototype.inviteLinkParentGroupSubjectV2 = ""; - ExtendedTextMessage.prototype.inviteLinkParentGroupThumbnailV2 = $util.newBuffer([]); - ExtendedTextMessage.prototype.inviteLinkGroupTypeV2 = 0; - ExtendedTextMessage.prototype.viewOnce = false; - ExtendedTextMessage.prototype.videoHeight = 0; - ExtendedTextMessage.prototype.videoWidth = 0; + ExtendedTextMessage.prototype.doNotPlayInline = null; + ExtendedTextMessage.prototype.thumbnailDirectPath = null; + ExtendedTextMessage.prototype.thumbnailSha256 = null; + ExtendedTextMessage.prototype.thumbnailEncSha256 = null; + ExtendedTextMessage.prototype.mediaKey = null; + ExtendedTextMessage.prototype.mediaKeyTimestamp = null; + ExtendedTextMessage.prototype.thumbnailHeight = null; + ExtendedTextMessage.prototype.thumbnailWidth = null; + ExtendedTextMessage.prototype.inviteLinkGroupType = null; + ExtendedTextMessage.prototype.inviteLinkParentGroupSubjectV2 = null; + ExtendedTextMessage.prototype.inviteLinkParentGroupThumbnailV2 = null; + ExtendedTextMessage.prototype.inviteLinkGroupTypeV2 = null; + ExtendedTextMessage.prototype.viewOnce = null; + ExtendedTextMessage.prototype.videoHeight = null; + ExtendedTextMessage.prototype.videoWidth = null; ExtendedTextMessage.prototype.faviconMMSMetadata = null; ExtendedTextMessage.prototype.linkPreviewMetadata = null; ExtendedTextMessage.prototype.paymentLinkMetadata = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_matchedText", { + get: $util.oneOfGetter($oneOfFields = ["matchedText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_textArgb", { + get: $util.oneOfGetter($oneOfFields = ["textArgb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_backgroundArgb", { + get: $util.oneOfGetter($oneOfFields = ["backgroundArgb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_font", { + get: $util.oneOfGetter($oneOfFields = ["font"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_previewType", { + get: $util.oneOfGetter($oneOfFields = ["previewType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_doNotPlayInline", { + get: $util.oneOfGetter($oneOfFields = ["doNotPlayInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailHeight", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_thumbnailWidth", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkGroupType", { + get: $util.oneOfGetter($oneOfFields = ["inviteLinkGroupType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkParentGroupSubjectV2", { + get: $util.oneOfGetter($oneOfFields = ["inviteLinkParentGroupSubjectV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkParentGroupThumbnailV2", { + get: $util.oneOfGetter($oneOfFields = ["inviteLinkParentGroupThumbnailV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_inviteLinkGroupTypeV2", { + get: $util.oneOfGetter($oneOfFields = ["inviteLinkGroupTypeV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_viewOnce", { + get: $util.oneOfGetter($oneOfFields = ["viewOnce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_videoHeight", { + get: $util.oneOfGetter($oneOfFields = ["videoHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_videoWidth", { + get: $util.oneOfGetter($oneOfFields = ["videoWidth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_faviconMMSMetadata", { + get: $util.oneOfGetter($oneOfFields = ["faviconMMSMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_linkPreviewMetadata", { + get: $util.oneOfGetter($oneOfFields = ["linkPreviewMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExtendedTextMessage.prototype, "_paymentLinkMetadata", { + get: $util.oneOfGetter($oneOfFields = ["paymentLinkMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + ExtendedTextMessage.create = function create(properties) { return new ExtendedTextMessage(properties); }; @@ -16556,6 +37381,389 @@ export const proto = $root.proto = (() => { return m; }; + ExtendedTextMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ExtendedTextMessage) + return d; + var m = new $root.proto.Message.ExtendedTextMessage(); + if (d.text != null) { + m.text = String(d.text); + } + if (d.matchedText != null) { + m.matchedText = String(d.matchedText); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.textArgb != null) { + m.textArgb = d.textArgb >>> 0; + } + if (d.backgroundArgb != null) { + m.backgroundArgb = d.backgroundArgb >>> 0; + } + switch (d.font) { + default: + if (typeof d.font === "number") { + m.font = d.font; + break; + } + break; + case "SYSTEM": + case 0: + m.font = 0; + break; + case "SYSTEM_TEXT": + case 1: + m.font = 1; + break; + case "FB_SCRIPT": + case 2: + m.font = 2; + break; + case "SYSTEM_BOLD": + case 6: + m.font = 6; + break; + case "MORNINGBREEZE_REGULAR": + case 7: + m.font = 7; + break; + case "CALISTOGA_REGULAR": + case 8: + m.font = 8; + break; + case "EXO2_EXTRABOLD": + case 9: + m.font = 9; + break; + case "COURIERPRIME_BOLD": + case 10: + m.font = 10; + break; + } + switch (d.previewType) { + default: + if (typeof d.previewType === "number") { + m.previewType = d.previewType; + break; + } + break; + case "NONE": + case 0: + m.previewType = 0; + break; + case "VIDEO": + case 1: + m.previewType = 1; + break; + case "PLACEHOLDER": + case 4: + m.previewType = 4; + break; + case "IMAGE": + case 5: + m.previewType = 5; + break; + case "PAYMENT_LINKS": + case 6: + m.previewType = 6; + break; + case "PROFILE": + case 7: + m.previewType = 7; + break; + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.doNotPlayInline != null) { + m.doNotPlayInline = Boolean(d.doNotPlayInline); + } + if (d.thumbnailDirectPath != null) { + m.thumbnailDirectPath = String(d.thumbnailDirectPath); + } + if (d.thumbnailSha256 != null) { + if (typeof d.thumbnailSha256 === "string") + $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0); + else if (d.thumbnailSha256.length >= 0) + m.thumbnailSha256 = d.thumbnailSha256; + } + if (d.thumbnailEncSha256 != null) { + if (typeof d.thumbnailEncSha256 === "string") + $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0); + else if (d.thumbnailEncSha256.length >= 0) + m.thumbnailEncSha256 = d.thumbnailEncSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.thumbnailHeight != null) { + m.thumbnailHeight = d.thumbnailHeight >>> 0; + } + if (d.thumbnailWidth != null) { + m.thumbnailWidth = d.thumbnailWidth >>> 0; + } + switch (d.inviteLinkGroupType) { + default: + if (typeof d.inviteLinkGroupType === "number") { + m.inviteLinkGroupType = d.inviteLinkGroupType; + break; + } + break; + case "DEFAULT": + case 0: + m.inviteLinkGroupType = 0; + break; + case "PARENT": + case 1: + m.inviteLinkGroupType = 1; + break; + case "SUB": + case 2: + m.inviteLinkGroupType = 2; + break; + case "DEFAULT_SUB": + case 3: + m.inviteLinkGroupType = 3; + break; + } + if (d.inviteLinkParentGroupSubjectV2 != null) { + m.inviteLinkParentGroupSubjectV2 = String(d.inviteLinkParentGroupSubjectV2); + } + if (d.inviteLinkParentGroupThumbnailV2 != null) { + if (typeof d.inviteLinkParentGroupThumbnailV2 === "string") + $util.base64.decode(d.inviteLinkParentGroupThumbnailV2, m.inviteLinkParentGroupThumbnailV2 = $util.newBuffer($util.base64.length(d.inviteLinkParentGroupThumbnailV2)), 0); + else if (d.inviteLinkParentGroupThumbnailV2.length >= 0) + m.inviteLinkParentGroupThumbnailV2 = d.inviteLinkParentGroupThumbnailV2; + } + switch (d.inviteLinkGroupTypeV2) { + default: + if (typeof d.inviteLinkGroupTypeV2 === "number") { + m.inviteLinkGroupTypeV2 = d.inviteLinkGroupTypeV2; + break; + } + break; + case "DEFAULT": + case 0: + m.inviteLinkGroupTypeV2 = 0; + break; + case "PARENT": + case 1: + m.inviteLinkGroupTypeV2 = 1; + break; + case "SUB": + case 2: + m.inviteLinkGroupTypeV2 = 2; + break; + case "DEFAULT_SUB": + case 3: + m.inviteLinkGroupTypeV2 = 3; + break; + } + if (d.viewOnce != null) { + m.viewOnce = Boolean(d.viewOnce); + } + if (d.videoHeight != null) { + m.videoHeight = d.videoHeight >>> 0; + } + if (d.videoWidth != null) { + m.videoWidth = d.videoWidth >>> 0; + } + if (d.faviconMMSMetadata != null) { + if (typeof d.faviconMMSMetadata !== "object") + throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected"); + m.faviconMMSMetadata = $root.proto.Message.MMSThumbnailMetadata.fromObject(d.faviconMMSMetadata); + } + if (d.linkPreviewMetadata != null) { + if (typeof d.linkPreviewMetadata !== "object") + throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected"); + m.linkPreviewMetadata = $root.proto.Message.LinkPreviewMetadata.fromObject(d.linkPreviewMetadata); + } + if (d.paymentLinkMetadata != null) { + if (typeof d.paymentLinkMetadata !== "object") + throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected"); + m.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.fromObject(d.paymentLinkMetadata); + } + return m; + }; + + ExtendedTextMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.matchedText != null && m.hasOwnProperty("matchedText")) { + d.matchedText = m.matchedText; + if (o.oneofs) + d._matchedText = "matchedText"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.textArgb != null && m.hasOwnProperty("textArgb")) { + d.textArgb = m.textArgb; + if (o.oneofs) + d._textArgb = "textArgb"; + } + if (m.backgroundArgb != null && m.hasOwnProperty("backgroundArgb")) { + d.backgroundArgb = m.backgroundArgb; + if (o.oneofs) + d._backgroundArgb = "backgroundArgb"; + } + if (m.font != null && m.hasOwnProperty("font")) { + d.font = o.enums === String ? $root.proto.Message.ExtendedTextMessage.FontType[m.font] === undefined ? m.font : $root.proto.Message.ExtendedTextMessage.FontType[m.font] : m.font; + if (o.oneofs) + d._font = "font"; + } + if (m.previewType != null && m.hasOwnProperty("previewType")) { + d.previewType = o.enums === String ? $root.proto.Message.ExtendedTextMessage.PreviewType[m.previewType] === undefined ? m.previewType : $root.proto.Message.ExtendedTextMessage.PreviewType[m.previewType] : m.previewType; + if (o.oneofs) + d._previewType = "previewType"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.doNotPlayInline != null && m.hasOwnProperty("doNotPlayInline")) { + d.doNotPlayInline = m.doNotPlayInline; + if (o.oneofs) + d._doNotPlayInline = "doNotPlayInline"; + } + if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) { + d.thumbnailDirectPath = m.thumbnailDirectPath; + if (o.oneofs) + d._thumbnailDirectPath = "thumbnailDirectPath"; + } + if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) { + d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256; + if (o.oneofs) + d._thumbnailSha256 = "thumbnailSha256"; + } + if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) { + d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256; + if (o.oneofs) + d._thumbnailEncSha256 = "thumbnailEncSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) { + d.thumbnailHeight = m.thumbnailHeight; + if (o.oneofs) + d._thumbnailHeight = "thumbnailHeight"; + } + if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) { + d.thumbnailWidth = m.thumbnailWidth; + if (o.oneofs) + d._thumbnailWidth = "thumbnailWidth"; + } + if (m.inviteLinkGroupType != null && m.hasOwnProperty("inviteLinkGroupType")) { + d.inviteLinkGroupType = o.enums === String ? $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupType] === undefined ? m.inviteLinkGroupType : $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupType] : m.inviteLinkGroupType; + if (o.oneofs) + d._inviteLinkGroupType = "inviteLinkGroupType"; + } + if (m.inviteLinkParentGroupSubjectV2 != null && m.hasOwnProperty("inviteLinkParentGroupSubjectV2")) { + d.inviteLinkParentGroupSubjectV2 = m.inviteLinkParentGroupSubjectV2; + if (o.oneofs) + d._inviteLinkParentGroupSubjectV2 = "inviteLinkParentGroupSubjectV2"; + } + if (m.inviteLinkParentGroupThumbnailV2 != null && m.hasOwnProperty("inviteLinkParentGroupThumbnailV2")) { + d.inviteLinkParentGroupThumbnailV2 = o.bytes === String ? $util.base64.encode(m.inviteLinkParentGroupThumbnailV2, 0, m.inviteLinkParentGroupThumbnailV2.length) : o.bytes === Array ? Array.prototype.slice.call(m.inviteLinkParentGroupThumbnailV2) : m.inviteLinkParentGroupThumbnailV2; + if (o.oneofs) + d._inviteLinkParentGroupThumbnailV2 = "inviteLinkParentGroupThumbnailV2"; + } + if (m.inviteLinkGroupTypeV2 != null && m.hasOwnProperty("inviteLinkGroupTypeV2")) { + d.inviteLinkGroupTypeV2 = o.enums === String ? $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupTypeV2] === undefined ? m.inviteLinkGroupTypeV2 : $root.proto.Message.ExtendedTextMessage.InviteLinkGroupType[m.inviteLinkGroupTypeV2] : m.inviteLinkGroupTypeV2; + if (o.oneofs) + d._inviteLinkGroupTypeV2 = "inviteLinkGroupTypeV2"; + } + if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) { + d.viewOnce = m.viewOnce; + if (o.oneofs) + d._viewOnce = "viewOnce"; + } + if (m.videoHeight != null && m.hasOwnProperty("videoHeight")) { + d.videoHeight = m.videoHeight; + if (o.oneofs) + d._videoHeight = "videoHeight"; + } + if (m.videoWidth != null && m.hasOwnProperty("videoWidth")) { + d.videoWidth = m.videoWidth; + if (o.oneofs) + d._videoWidth = "videoWidth"; + } + if (m.faviconMMSMetadata != null && m.hasOwnProperty("faviconMMSMetadata")) { + d.faviconMMSMetadata = $root.proto.Message.MMSThumbnailMetadata.toObject(m.faviconMMSMetadata, o); + if (o.oneofs) + d._faviconMMSMetadata = "faviconMMSMetadata"; + } + if (m.linkPreviewMetadata != null && m.hasOwnProperty("linkPreviewMetadata")) { + d.linkPreviewMetadata = $root.proto.Message.LinkPreviewMetadata.toObject(m.linkPreviewMetadata, o); + if (o.oneofs) + d._linkPreviewMetadata = "linkPreviewMetadata"; + } + if (m.paymentLinkMetadata != null && m.hasOwnProperty("paymentLinkMetadata")) { + d.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.toObject(m.paymentLinkMetadata, o); + if (o.oneofs) + d._paymentLinkMetadata = "paymentLinkMetadata"; + } + return d; + }; + + ExtendedTextMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExtendedTextMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16608,7 +37816,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - FullHistorySyncOnDemandRequestMetadata.prototype.requestId = ""; + FullHistorySyncOnDemandRequestMetadata.prototype.requestId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FullHistorySyncOnDemandRequestMetadata.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); FullHistorySyncOnDemandRequestMetadata.create = function create(properties) { return new FullHistorySyncOnDemandRequestMetadata(properties); @@ -16643,6 +37859,32 @@ export const proto = $root.proto = (() => { return m; }; + FullHistorySyncOnDemandRequestMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.FullHistorySyncOnDemandRequestMetadata) + return d; + var m = new $root.proto.Message.FullHistorySyncOnDemandRequestMetadata(); + if (d.requestId != null) { + m.requestId = String(d.requestId); + } + return m; + }; + + FullHistorySyncOnDemandRequestMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.requestId != null && m.hasOwnProperty("requestId")) { + d.requestId = m.requestId; + if (o.oneofs) + d._requestId = "requestId"; + } + return d; + }; + + FullHistorySyncOnDemandRequestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FullHistorySyncOnDemandRequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16664,6 +37906,14 @@ export const proto = $root.proto = (() => { FutureProofMessage.prototype.message = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FutureProofMessage.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + FutureProofMessage.create = function create(properties) { return new FutureProofMessage(properties); }; @@ -16697,6 +37947,34 @@ export const proto = $root.proto = (() => { return m; }; + FutureProofMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.FutureProofMessage) + return d; + var m = new $root.proto.Message.FutureProofMessage(); + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.Message.FutureProofMessage.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + return m; + }; + + FutureProofMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + return d; + }; + + FutureProofMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FutureProofMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16716,14 +37994,64 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - GroupInviteMessage.prototype.groupJid = ""; - GroupInviteMessage.prototype.inviteCode = ""; - GroupInviteMessage.prototype.inviteExpiration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - GroupInviteMessage.prototype.groupName = ""; - GroupInviteMessage.prototype.jpegThumbnail = $util.newBuffer([]); - GroupInviteMessage.prototype.caption = ""; + GroupInviteMessage.prototype.groupJid = null; + GroupInviteMessage.prototype.inviteCode = null; + GroupInviteMessage.prototype.inviteExpiration = null; + GroupInviteMessage.prototype.groupName = null; + GroupInviteMessage.prototype.jpegThumbnail = null; + GroupInviteMessage.prototype.caption = null; GroupInviteMessage.prototype.contextInfo = null; - GroupInviteMessage.prototype.groupType = 0; + GroupInviteMessage.prototype.groupType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_groupJid", { + get: $util.oneOfGetter($oneOfFields = ["groupJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_inviteCode", { + get: $util.oneOfGetter($oneOfFields = ["inviteCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_inviteExpiration", { + get: $util.oneOfGetter($oneOfFields = ["inviteExpiration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_groupName", { + get: $util.oneOfGetter($oneOfFields = ["groupName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupInviteMessage.prototype, "_groupType", { + get: $util.oneOfGetter($oneOfFields = ["groupType"]), + set: $util.oneOfSetter($oneOfFields) + }); GroupInviteMessage.create = function create(properties) { return new GroupInviteMessage(properties); @@ -16800,6 +38128,116 @@ export const proto = $root.proto = (() => { return m; }; + GroupInviteMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.GroupInviteMessage) + return d; + var m = new $root.proto.Message.GroupInviteMessage(); + if (d.groupJid != null) { + m.groupJid = String(d.groupJid); + } + if (d.inviteCode != null) { + m.inviteCode = String(d.inviteCode); + } + if (d.inviteExpiration != null) { + if ($util.Long) + (m.inviteExpiration = $util.Long.fromValue(d.inviteExpiration)).unsigned = false; + else if (typeof d.inviteExpiration === "string") + m.inviteExpiration = parseInt(d.inviteExpiration, 10); + else if (typeof d.inviteExpiration === "number") + m.inviteExpiration = d.inviteExpiration; + else if (typeof d.inviteExpiration === "object") + m.inviteExpiration = new $util.LongBits(d.inviteExpiration.low >>> 0, d.inviteExpiration.high >>> 0).toNumber(); + } + if (d.groupName != null) { + m.groupName = String(d.groupName); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + switch (d.groupType) { + default: + if (typeof d.groupType === "number") { + m.groupType = d.groupType; + break; + } + break; + case "DEFAULT": + case 0: + m.groupType = 0; + break; + case "PARENT": + case 1: + m.groupType = 1; + break; + } + return m; + }; + + GroupInviteMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.groupJid != null && m.hasOwnProperty("groupJid")) { + d.groupJid = m.groupJid; + if (o.oneofs) + d._groupJid = "groupJid"; + } + if (m.inviteCode != null && m.hasOwnProperty("inviteCode")) { + d.inviteCode = m.inviteCode; + if (o.oneofs) + d._inviteCode = "inviteCode"; + } + if (m.inviteExpiration != null && m.hasOwnProperty("inviteExpiration")) { + if (typeof m.inviteExpiration === "number") + d.inviteExpiration = o.longs === String ? String(m.inviteExpiration) : m.inviteExpiration; + else + d.inviteExpiration = o.longs === String ? $util.Long.prototype.toString.call(m.inviteExpiration) : o.longs === Number ? new $util.LongBits(m.inviteExpiration.low >>> 0, m.inviteExpiration.high >>> 0).toNumber() : m.inviteExpiration; + if (o.oneofs) + d._inviteExpiration = "inviteExpiration"; + } + if (m.groupName != null && m.hasOwnProperty("groupName")) { + d.groupName = m.groupName; + if (o.oneofs) + d._groupName = "groupName"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.groupType != null && m.hasOwnProperty("groupType")) { + d.groupType = o.enums === String ? $root.proto.Message.GroupInviteMessage.GroupType[m.groupType] === undefined ? m.groupType : $root.proto.Message.GroupInviteMessage.GroupType[m.groupType] : m.groupType; + if (o.oneofs) + d._groupType = "groupType"; + } + return d; + }; + + GroupInviteMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + GroupInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16828,16 +38266,60 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HighlyStructuredMessage.prototype.namespace = ""; - HighlyStructuredMessage.prototype.elementName = ""; + HighlyStructuredMessage.prototype.namespace = null; + HighlyStructuredMessage.prototype.elementName = null; HighlyStructuredMessage.prototype.params = $util.emptyArray; - HighlyStructuredMessage.prototype.fallbackLg = ""; - HighlyStructuredMessage.prototype.fallbackLc = ""; + HighlyStructuredMessage.prototype.fallbackLg = null; + HighlyStructuredMessage.prototype.fallbackLc = null; HighlyStructuredMessage.prototype.localizableParams = $util.emptyArray; - HighlyStructuredMessage.prototype.deterministicLg = ""; - HighlyStructuredMessage.prototype.deterministicLc = ""; + HighlyStructuredMessage.prototype.deterministicLg = null; + HighlyStructuredMessage.prototype.deterministicLc = null; HighlyStructuredMessage.prototype.hydratedHsm = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_namespace", { + get: $util.oneOfGetter($oneOfFields = ["namespace"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_elementName", { + get: $util.oneOfGetter($oneOfFields = ["elementName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_fallbackLg", { + get: $util.oneOfGetter($oneOfFields = ["fallbackLg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_fallbackLc", { + get: $util.oneOfGetter($oneOfFields = ["fallbackLc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_deterministicLg", { + get: $util.oneOfGetter($oneOfFields = ["deterministicLg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_deterministicLc", { + get: $util.oneOfGetter($oneOfFields = ["deterministicLc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HighlyStructuredMessage.prototype, "_hydratedHsm", { + get: $util.oneOfGetter($oneOfFields = ["hydratedHsm"]), + set: $util.oneOfSetter($oneOfFields) + }); + HighlyStructuredMessage.create = function create(properties) { return new HighlyStructuredMessage(properties); }; @@ -16927,6 +38409,116 @@ export const proto = $root.proto = (() => { return m; }; + HighlyStructuredMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HighlyStructuredMessage) + return d; + var m = new $root.proto.Message.HighlyStructuredMessage(); + if (d.namespace != null) { + m.namespace = String(d.namespace); + } + if (d.elementName != null) { + m.elementName = String(d.elementName); + } + if (d.params) { + if (!Array.isArray(d.params)) + throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected"); + m.params = []; + for (var i = 0; i < d.params.length; ++i) { + m.params[i] = String(d.params[i]); + } + } + if (d.fallbackLg != null) { + m.fallbackLg = String(d.fallbackLg); + } + if (d.fallbackLc != null) { + m.fallbackLc = String(d.fallbackLc); + } + if (d.localizableParams) { + if (!Array.isArray(d.localizableParams)) + throw TypeError(".proto.Message.HighlyStructuredMessage.localizableParams: array expected"); + m.localizableParams = []; + for (var i = 0; i < d.localizableParams.length; ++i) { + if (typeof d.localizableParams[i] !== "object") + throw TypeError(".proto.Message.HighlyStructuredMessage.localizableParams: object expected"); + m.localizableParams[i] = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.fromObject(d.localizableParams[i]); + } + } + if (d.deterministicLg != null) { + m.deterministicLg = String(d.deterministicLg); + } + if (d.deterministicLc != null) { + m.deterministicLc = String(d.deterministicLc); + } + if (d.hydratedHsm != null) { + if (typeof d.hydratedHsm !== "object") + throw TypeError(".proto.Message.HighlyStructuredMessage.hydratedHsm: object expected"); + m.hydratedHsm = $root.proto.Message.TemplateMessage.fromObject(d.hydratedHsm); + } + return m; + }; + + HighlyStructuredMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.params = []; + d.localizableParams = []; + } + if (m.namespace != null && m.hasOwnProperty("namespace")) { + d.namespace = m.namespace; + if (o.oneofs) + d._namespace = "namespace"; + } + if (m.elementName != null && m.hasOwnProperty("elementName")) { + d.elementName = m.elementName; + if (o.oneofs) + d._elementName = "elementName"; + } + if (m.params && m.params.length) { + d.params = []; + for (var j = 0; j < m.params.length; ++j) { + d.params[j] = m.params[j]; + } + } + if (m.fallbackLg != null && m.hasOwnProperty("fallbackLg")) { + d.fallbackLg = m.fallbackLg; + if (o.oneofs) + d._fallbackLg = "fallbackLg"; + } + if (m.fallbackLc != null && m.hasOwnProperty("fallbackLc")) { + d.fallbackLc = m.fallbackLc; + if (o.oneofs) + d._fallbackLc = "fallbackLc"; + } + if (m.localizableParams && m.localizableParams.length) { + d.localizableParams = []; + for (var j = 0; j < m.localizableParams.length; ++j) { + d.localizableParams[j] = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.toObject(m.localizableParams[j], o); + } + } + if (m.deterministicLg != null && m.hasOwnProperty("deterministicLg")) { + d.deterministicLg = m.deterministicLg; + if (o.oneofs) + d._deterministicLg = "deterministicLg"; + } + if (m.deterministicLc != null && m.hasOwnProperty("deterministicLc")) { + d.deterministicLc = m.deterministicLc; + if (o.oneofs) + d._deterministicLc = "deterministicLc"; + } + if (m.hydratedHsm != null && m.hasOwnProperty("hydratedHsm")) { + d.hydratedHsm = $root.proto.Message.TemplateMessage.toObject(m.hydratedHsm, o); + if (o.oneofs) + d._hydratedHsm = "hydratedHsm"; + } + return d; + }; + + HighlyStructuredMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HighlyStructuredMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -16943,12 +38535,18 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HSMLocalizableParameter.prototype["default"] = ""; + HSMLocalizableParameter.prototype["default"] = null; HSMLocalizableParameter.prototype.currency = null; HSMLocalizableParameter.prototype.dateTime = null; let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMLocalizableParameter.prototype, "_default", { + get: $util.oneOfGetter($oneOfFields = ["default"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(HSMLocalizableParameter.prototype, "paramOneof", { get: $util.oneOfGetter($oneOfFields = ["currency", "dateTime"]), set: $util.oneOfSetter($oneOfFields) @@ -16999,6 +38597,52 @@ export const proto = $root.proto = (() => { return m; }; + HSMLocalizableParameter.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter) + return d; + var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter(); + if (d["default"] != null) { + m["default"] = String(d["default"]); + } + if (d.currency != null) { + if (typeof d.currency !== "object") + throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected"); + m.currency = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(d.currency); + } + if (d.dateTime != null) { + if (typeof d.dateTime !== "object") + throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected"); + m.dateTime = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(d.dateTime); + } + return m; + }; + + HSMLocalizableParameter.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m["default"] != null && m.hasOwnProperty("default")) { + d["default"] = m["default"]; + if (o.oneofs) + d._default = "default"; + } + if (m.currency != null && m.hasOwnProperty("currency")) { + d.currency = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(m.currency, o); + if (o.oneofs) + d.paramOneof = "currency"; + } + if (m.dateTime != null && m.hasOwnProperty("dateTime")) { + d.dateTime = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(m.dateTime, o); + if (o.oneofs) + d.paramOneof = "dateTime"; + } + return d; + }; + + HSMLocalizableParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HSMLocalizableParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17015,8 +38659,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HSMCurrency.prototype.currencyCode = ""; - HSMCurrency.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + HSMCurrency.prototype.currencyCode = null; + HSMCurrency.prototype.amount1000 = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMCurrency.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMCurrency.prototype, "_amount1000", { + get: $util.oneOfGetter($oneOfFields = ["amount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); HSMCurrency.create = function create(properties) { return new HSMCurrency(properties); @@ -17057,6 +38715,50 @@ export const proto = $root.proto = (() => { return m; }; + HSMCurrency.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency) + return d; + var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency(); + if (d.currencyCode != null) { + m.currencyCode = String(d.currencyCode); + } + if (d.amount1000 != null) { + if ($util.Long) + (m.amount1000 = $util.Long.fromValue(d.amount1000)).unsigned = false; + else if (typeof d.amount1000 === "string") + m.amount1000 = parseInt(d.amount1000, 10); + else if (typeof d.amount1000 === "number") + m.amount1000 = d.amount1000; + else if (typeof d.amount1000 === "object") + m.amount1000 = new $util.LongBits(d.amount1000.low >>> 0, d.amount1000.high >>> 0).toNumber(); + } + return m; + }; + + HSMCurrency.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.currencyCode != null && m.hasOwnProperty("currencyCode")) { + d.currencyCode = m.currencyCode; + if (o.oneofs) + d._currencyCode = "currencyCode"; + } + if (m.amount1000 != null && m.hasOwnProperty("amount1000")) { + if (typeof m.amount1000 === "number") + d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000; + else + d.amount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.amount1000) : o.longs === Number ? new $util.LongBits(m.amount1000.low >>> 0, m.amount1000.high >>> 0).toNumber() : m.amount1000; + if (o.oneofs) + d._amount1000 = "amount1000"; + } + return d; + }; + + HSMCurrency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HSMCurrency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17125,6 +38827,44 @@ export const proto = $root.proto = (() => { return m; }; + HSMDateTime.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime) + return d; + var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime(); + if (d.component != null) { + if (typeof d.component !== "object") + throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected"); + m.component = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(d.component); + } + if (d.unixEpoch != null) { + if (typeof d.unixEpoch !== "object") + throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected"); + m.unixEpoch = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(d.unixEpoch); + } + return m; + }; + + HSMDateTime.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.component != null && m.hasOwnProperty("component")) { + d.component = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(m.component, o); + if (o.oneofs) + d.datetimeOneof = "component"; + } + if (m.unixEpoch != null && m.hasOwnProperty("unixEpoch")) { + d.unixEpoch = $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(m.unixEpoch, o); + if (o.oneofs) + d.datetimeOneof = "unixEpoch"; + } + return d; + }; + + HSMDateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HSMDateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17141,13 +38881,57 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HSMDateTimeComponent.prototype.dayOfWeek = 1; - HSMDateTimeComponent.prototype.year = 0; - HSMDateTimeComponent.prototype.month = 0; - HSMDateTimeComponent.prototype.dayOfMonth = 0; - HSMDateTimeComponent.prototype.hour = 0; - HSMDateTimeComponent.prototype.minute = 0; - HSMDateTimeComponent.prototype.calendar = 1; + HSMDateTimeComponent.prototype.dayOfWeek = null; + HSMDateTimeComponent.prototype.year = null; + HSMDateTimeComponent.prototype.month = null; + HSMDateTimeComponent.prototype.dayOfMonth = null; + HSMDateTimeComponent.prototype.hour = null; + HSMDateTimeComponent.prototype.minute = null; + HSMDateTimeComponent.prototype.calendar = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_dayOfWeek", { + get: $util.oneOfGetter($oneOfFields = ["dayOfWeek"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_year", { + get: $util.oneOfGetter($oneOfFields = ["year"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_month", { + get: $util.oneOfGetter($oneOfFields = ["month"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_dayOfMonth", { + get: $util.oneOfGetter($oneOfFields = ["dayOfMonth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_hour", { + get: $util.oneOfGetter($oneOfFields = ["hour"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_minute", { + get: $util.oneOfGetter($oneOfFields = ["minute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeComponent.prototype, "_calendar", { + get: $util.oneOfGetter($oneOfFields = ["calendar"]), + set: $util.oneOfSetter($oneOfFields) + }); HSMDateTimeComponent.create = function create(properties) { return new HSMDateTimeComponent(properties); @@ -17218,6 +39002,126 @@ export const proto = $root.proto = (() => { return m; }; + HSMDateTimeComponent.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent) + return d; + var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent(); + switch (d.dayOfWeek) { + default: + if (typeof d.dayOfWeek === "number") { + m.dayOfWeek = d.dayOfWeek; + break; + } + break; + case "MONDAY": + case 1: + m.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + m.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + m.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + m.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + m.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + m.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + m.dayOfWeek = 7; + break; + } + if (d.year != null) { + m.year = d.year >>> 0; + } + if (d.month != null) { + m.month = d.month >>> 0; + } + if (d.dayOfMonth != null) { + m.dayOfMonth = d.dayOfMonth >>> 0; + } + if (d.hour != null) { + m.hour = d.hour >>> 0; + } + if (d.minute != null) { + m.minute = d.minute >>> 0; + } + switch (d.calendar) { + default: + if (typeof d.calendar === "number") { + m.calendar = d.calendar; + break; + } + break; + case "GREGORIAN": + case 1: + m.calendar = 1; + break; + case "SOLAR_HIJRI": + case 2: + m.calendar = 2; + break; + } + return m; + }; + + HSMDateTimeComponent.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.dayOfWeek != null && m.hasOwnProperty("dayOfWeek")) { + d.dayOfWeek = o.enums === String ? $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[m.dayOfWeek] === undefined ? m.dayOfWeek : $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[m.dayOfWeek] : m.dayOfWeek; + if (o.oneofs) + d._dayOfWeek = "dayOfWeek"; + } + if (m.year != null && m.hasOwnProperty("year")) { + d.year = m.year; + if (o.oneofs) + d._year = "year"; + } + if (m.month != null && m.hasOwnProperty("month")) { + d.month = m.month; + if (o.oneofs) + d._month = "month"; + } + if (m.dayOfMonth != null && m.hasOwnProperty("dayOfMonth")) { + d.dayOfMonth = m.dayOfMonth; + if (o.oneofs) + d._dayOfMonth = "dayOfMonth"; + } + if (m.hour != null && m.hasOwnProperty("hour")) { + d.hour = m.hour; + if (o.oneofs) + d._hour = "hour"; + } + if (m.minute != null && m.hasOwnProperty("minute")) { + d.minute = m.minute; + if (o.oneofs) + d._minute = "minute"; + } + if (m.calendar != null && m.hasOwnProperty("calendar")) { + d.calendar = o.enums === String ? $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[m.calendar] === undefined ? m.calendar : $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[m.calendar] : m.calendar; + if (o.oneofs) + d._calendar = "calendar"; + } + return d; + }; + + HSMDateTimeComponent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HSMDateTimeComponent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17256,7 +39160,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HSMDateTimeUnixEpoch.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + HSMDateTimeUnixEpoch.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HSMDateTimeUnixEpoch.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); HSMDateTimeUnixEpoch.create = function create(properties) { return new HSMDateTimeUnixEpoch(properties); @@ -17291,6 +39203,42 @@ export const proto = $root.proto = (() => { return m; }; + HSMDateTimeUnixEpoch.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch) + return d; + var m = new $root.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch(); + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + HSMDateTimeUnixEpoch.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + HSMDateTimeUnixEpoch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HSMDateTimeUnixEpoch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17319,20 +39267,106 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HistorySyncNotification.prototype.fileSha256 = $util.newBuffer([]); - HistorySyncNotification.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - HistorySyncNotification.prototype.mediaKey = $util.newBuffer([]); - HistorySyncNotification.prototype.fileEncSha256 = $util.newBuffer([]); - HistorySyncNotification.prototype.directPath = ""; - HistorySyncNotification.prototype.syncType = 0; - HistorySyncNotification.prototype.chunkOrder = 0; - HistorySyncNotification.prototype.originalMessageId = ""; - HistorySyncNotification.prototype.progress = 0; - HistorySyncNotification.prototype.oldestMsgInChunkTimestampSec = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - HistorySyncNotification.prototype.initialHistBootstrapInlinePayload = $util.newBuffer([]); - HistorySyncNotification.prototype.peerDataRequestSessionId = ""; + HistorySyncNotification.prototype.fileSha256 = null; + HistorySyncNotification.prototype.fileLength = null; + HistorySyncNotification.prototype.mediaKey = null; + HistorySyncNotification.prototype.fileEncSha256 = null; + HistorySyncNotification.prototype.directPath = null; + HistorySyncNotification.prototype.syncType = null; + HistorySyncNotification.prototype.chunkOrder = null; + HistorySyncNotification.prototype.originalMessageId = null; + HistorySyncNotification.prototype.progress = null; + HistorySyncNotification.prototype.oldestMsgInChunkTimestampSec = null; + HistorySyncNotification.prototype.initialHistBootstrapInlinePayload = null; + HistorySyncNotification.prototype.peerDataRequestSessionId = null; HistorySyncNotification.prototype.fullHistorySyncOnDemandRequestMetadata = null; - HistorySyncNotification.prototype.encHandle = ""; + HistorySyncNotification.prototype.encHandle = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_syncType", { + get: $util.oneOfGetter($oneOfFields = ["syncType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_chunkOrder", { + get: $util.oneOfGetter($oneOfFields = ["chunkOrder"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_originalMessageId", { + get: $util.oneOfGetter($oneOfFields = ["originalMessageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_progress", { + get: $util.oneOfGetter($oneOfFields = ["progress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_oldestMsgInChunkTimestampSec", { + get: $util.oneOfGetter($oneOfFields = ["oldestMsgInChunkTimestampSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_initialHistBootstrapInlinePayload", { + get: $util.oneOfGetter($oneOfFields = ["initialHistBootstrapInlinePayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_peerDataRequestSessionId", { + get: $util.oneOfGetter($oneOfFields = ["peerDataRequestSessionId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_fullHistorySyncOnDemandRequestMetadata", { + get: $util.oneOfGetter($oneOfFields = ["fullHistorySyncOnDemandRequestMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncNotification.prototype, "_encHandle", { + get: $util.oneOfGetter($oneOfFields = ["encHandle"]), + set: $util.oneOfSetter($oneOfFields) + }); HistorySyncNotification.create = function create(properties) { return new HistorySyncNotification(properties); @@ -17445,6 +39479,207 @@ export const proto = $root.proto = (() => { return m; }; + HistorySyncNotification.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.HistorySyncNotification) + return d; + var m = new $root.proto.Message.HistorySyncNotification(); + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + switch (d.syncType) { + default: + if (typeof d.syncType === "number") { + m.syncType = d.syncType; + break; + } + break; + case "INITIAL_BOOTSTRAP": + case 0: + m.syncType = 0; + break; + case "INITIAL_STATUS_V3": + case 1: + m.syncType = 1; + break; + case "FULL": + case 2: + m.syncType = 2; + break; + case "RECENT": + case 3: + m.syncType = 3; + break; + case "PUSH_NAME": + case 4: + m.syncType = 4; + break; + case "NON_BLOCKING_DATA": + case 5: + m.syncType = 5; + break; + case "ON_DEMAND": + case 6: + m.syncType = 6; + break; + case "NO_HISTORY": + case 7: + m.syncType = 7; + break; + } + if (d.chunkOrder != null) { + m.chunkOrder = d.chunkOrder >>> 0; + } + if (d.originalMessageId != null) { + m.originalMessageId = String(d.originalMessageId); + } + if (d.progress != null) { + m.progress = d.progress >>> 0; + } + if (d.oldestMsgInChunkTimestampSec != null) { + if ($util.Long) + (m.oldestMsgInChunkTimestampSec = $util.Long.fromValue(d.oldestMsgInChunkTimestampSec)).unsigned = false; + else if (typeof d.oldestMsgInChunkTimestampSec === "string") + m.oldestMsgInChunkTimestampSec = parseInt(d.oldestMsgInChunkTimestampSec, 10); + else if (typeof d.oldestMsgInChunkTimestampSec === "number") + m.oldestMsgInChunkTimestampSec = d.oldestMsgInChunkTimestampSec; + else if (typeof d.oldestMsgInChunkTimestampSec === "object") + m.oldestMsgInChunkTimestampSec = new $util.LongBits(d.oldestMsgInChunkTimestampSec.low >>> 0, d.oldestMsgInChunkTimestampSec.high >>> 0).toNumber(); + } + if (d.initialHistBootstrapInlinePayload != null) { + if (typeof d.initialHistBootstrapInlinePayload === "string") + $util.base64.decode(d.initialHistBootstrapInlinePayload, m.initialHistBootstrapInlinePayload = $util.newBuffer($util.base64.length(d.initialHistBootstrapInlinePayload)), 0); + else if (d.initialHistBootstrapInlinePayload.length >= 0) + m.initialHistBootstrapInlinePayload = d.initialHistBootstrapInlinePayload; + } + if (d.peerDataRequestSessionId != null) { + m.peerDataRequestSessionId = String(d.peerDataRequestSessionId); + } + if (d.fullHistorySyncOnDemandRequestMetadata != null) { + if (typeof d.fullHistorySyncOnDemandRequestMetadata !== "object") + throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected"); + m.fullHistorySyncOnDemandRequestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(d.fullHistorySyncOnDemandRequestMetadata); + } + if (d.encHandle != null) { + m.encHandle = String(d.encHandle); + } + return m; + }; + + HistorySyncNotification.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.syncType != null && m.hasOwnProperty("syncType")) { + d.syncType = o.enums === String ? $root.proto.Message.HistorySyncNotification.HistorySyncType[m.syncType] === undefined ? m.syncType : $root.proto.Message.HistorySyncNotification.HistorySyncType[m.syncType] : m.syncType; + if (o.oneofs) + d._syncType = "syncType"; + } + if (m.chunkOrder != null && m.hasOwnProperty("chunkOrder")) { + d.chunkOrder = m.chunkOrder; + if (o.oneofs) + d._chunkOrder = "chunkOrder"; + } + if (m.originalMessageId != null && m.hasOwnProperty("originalMessageId")) { + d.originalMessageId = m.originalMessageId; + if (o.oneofs) + d._originalMessageId = "originalMessageId"; + } + if (m.progress != null && m.hasOwnProperty("progress")) { + d.progress = m.progress; + if (o.oneofs) + d._progress = "progress"; + } + if (m.oldestMsgInChunkTimestampSec != null && m.hasOwnProperty("oldestMsgInChunkTimestampSec")) { + if (typeof m.oldestMsgInChunkTimestampSec === "number") + d.oldestMsgInChunkTimestampSec = o.longs === String ? String(m.oldestMsgInChunkTimestampSec) : m.oldestMsgInChunkTimestampSec; + else + d.oldestMsgInChunkTimestampSec = o.longs === String ? $util.Long.prototype.toString.call(m.oldestMsgInChunkTimestampSec) : o.longs === Number ? new $util.LongBits(m.oldestMsgInChunkTimestampSec.low >>> 0, m.oldestMsgInChunkTimestampSec.high >>> 0).toNumber() : m.oldestMsgInChunkTimestampSec; + if (o.oneofs) + d._oldestMsgInChunkTimestampSec = "oldestMsgInChunkTimestampSec"; + } + if (m.initialHistBootstrapInlinePayload != null && m.hasOwnProperty("initialHistBootstrapInlinePayload")) { + d.initialHistBootstrapInlinePayload = o.bytes === String ? $util.base64.encode(m.initialHistBootstrapInlinePayload, 0, m.initialHistBootstrapInlinePayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.initialHistBootstrapInlinePayload) : m.initialHistBootstrapInlinePayload; + if (o.oneofs) + d._initialHistBootstrapInlinePayload = "initialHistBootstrapInlinePayload"; + } + if (m.peerDataRequestSessionId != null && m.hasOwnProperty("peerDataRequestSessionId")) { + d.peerDataRequestSessionId = m.peerDataRequestSessionId; + if (o.oneofs) + d._peerDataRequestSessionId = "peerDataRequestSessionId"; + } + if (m.fullHistorySyncOnDemandRequestMetadata != null && m.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")) { + d.fullHistorySyncOnDemandRequestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(m.fullHistorySyncOnDemandRequestMetadata, o); + if (o.oneofs) + d._fullHistorySyncOnDemandRequestMetadata = "fullHistorySyncOnDemandRequestMetadata"; + } + if (m.encHandle != null && m.hasOwnProperty("encHandle")) { + d.encHandle = m.encHandle; + if (o.oneofs) + d._encHandle = "encHandle"; + } + return d; + }; + + HistorySyncNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HistorySyncNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17480,35 +39715,193 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ImageMessage.prototype.url = ""; - ImageMessage.prototype.mimetype = ""; - ImageMessage.prototype.caption = ""; - ImageMessage.prototype.fileSha256 = $util.newBuffer([]); - ImageMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ImageMessage.prototype.height = 0; - ImageMessage.prototype.width = 0; - ImageMessage.prototype.mediaKey = $util.newBuffer([]); - ImageMessage.prototype.fileEncSha256 = $util.newBuffer([]); + ImageMessage.prototype.url = null; + ImageMessage.prototype.mimetype = null; + ImageMessage.prototype.caption = null; + ImageMessage.prototype.fileSha256 = null; + ImageMessage.prototype.fileLength = null; + ImageMessage.prototype.height = null; + ImageMessage.prototype.width = null; + ImageMessage.prototype.mediaKey = null; + ImageMessage.prototype.fileEncSha256 = null; ImageMessage.prototype.interactiveAnnotations = $util.emptyArray; - ImageMessage.prototype.directPath = ""; - ImageMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - ImageMessage.prototype.jpegThumbnail = $util.newBuffer([]); + ImageMessage.prototype.directPath = null; + ImageMessage.prototype.mediaKeyTimestamp = null; + ImageMessage.prototype.jpegThumbnail = null; ImageMessage.prototype.contextInfo = null; - ImageMessage.prototype.firstScanSidecar = $util.newBuffer([]); - ImageMessage.prototype.firstScanLength = 0; - ImageMessage.prototype.experimentGroupId = 0; - ImageMessage.prototype.scansSidecar = $util.newBuffer([]); + ImageMessage.prototype.firstScanSidecar = null; + ImageMessage.prototype.firstScanLength = null; + ImageMessage.prototype.experimentGroupId = null; + ImageMessage.prototype.scansSidecar = null; ImageMessage.prototype.scanLengths = $util.emptyArray; - ImageMessage.prototype.midQualityFileSha256 = $util.newBuffer([]); - ImageMessage.prototype.midQualityFileEncSha256 = $util.newBuffer([]); - ImageMessage.prototype.viewOnce = false; - ImageMessage.prototype.thumbnailDirectPath = ""; - ImageMessage.prototype.thumbnailSha256 = $util.newBuffer([]); - ImageMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); - ImageMessage.prototype.staticUrl = ""; + ImageMessage.prototype.midQualityFileSha256 = null; + ImageMessage.prototype.midQualityFileEncSha256 = null; + ImageMessage.prototype.viewOnce = null; + ImageMessage.prototype.thumbnailDirectPath = null; + ImageMessage.prototype.thumbnailSha256 = null; + ImageMessage.prototype.thumbnailEncSha256 = null; + ImageMessage.prototype.staticUrl = null; ImageMessage.prototype.annotations = $util.emptyArray; - ImageMessage.prototype.imageSourceType = 0; - ImageMessage.prototype.accessibilityLabel = ""; + ImageMessage.prototype.imageSourceType = null; + ImageMessage.prototype.accessibilityLabel = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_firstScanSidecar", { + get: $util.oneOfGetter($oneOfFields = ["firstScanSidecar"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_firstScanLength", { + get: $util.oneOfGetter($oneOfFields = ["firstScanLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_experimentGroupId", { + get: $util.oneOfGetter($oneOfFields = ["experimentGroupId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_scansSidecar", { + get: $util.oneOfGetter($oneOfFields = ["scansSidecar"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_midQualityFileSha256", { + get: $util.oneOfGetter($oneOfFields = ["midQualityFileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_midQualityFileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["midQualityFileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_viewOnce", { + get: $util.oneOfGetter($oneOfFields = ["viewOnce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_thumbnailDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_thumbnailSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_thumbnailEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_staticUrl", { + get: $util.oneOfGetter($oneOfFields = ["staticUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_imageSourceType", { + get: $util.oneOfGetter($oneOfFields = ["imageSourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ImageMessage.prototype, "_accessibilityLabel", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); ImageMessage.create = function create(properties) { return new ImageMessage(properties); @@ -17556,8 +39949,10 @@ export const proto = $root.proto = (() => { if (m.scansSidecar != null && Object.hasOwnProperty.call(m, "scansSidecar")) w.uint32(170).bytes(m.scansSidecar); if (m.scanLengths != null && m.scanLengths.length) { + w.uint32(178).fork(); for (var i = 0; i < m.scanLengths.length; ++i) - w.uint32(176).uint32(m.scanLengths[i]); + w.uint32(m.scanLengths[i]); + w.ldelim(); } if (m.midQualityFileSha256 != null && Object.hasOwnProperty.call(m, "midQualityFileSha256")) w.uint32(186).bytes(m.midQualityFileSha256); @@ -17728,6 +40123,356 @@ export const proto = $root.proto = (() => { return m; }; + ImageMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ImageMessage) + return d; + var m = new $root.proto.Message.ImageMessage(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.interactiveAnnotations) { + if (!Array.isArray(d.interactiveAnnotations)) + throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected"); + m.interactiveAnnotations = []; + for (var i = 0; i < d.interactiveAnnotations.length; ++i) { + if (typeof d.interactiveAnnotations[i] !== "object") + throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: object expected"); + m.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.interactiveAnnotations[i]); + } + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.firstScanSidecar != null) { + if (typeof d.firstScanSidecar === "string") + $util.base64.decode(d.firstScanSidecar, m.firstScanSidecar = $util.newBuffer($util.base64.length(d.firstScanSidecar)), 0); + else if (d.firstScanSidecar.length >= 0) + m.firstScanSidecar = d.firstScanSidecar; + } + if (d.firstScanLength != null) { + m.firstScanLength = d.firstScanLength >>> 0; + } + if (d.experimentGroupId != null) { + m.experimentGroupId = d.experimentGroupId >>> 0; + } + if (d.scansSidecar != null) { + if (typeof d.scansSidecar === "string") + $util.base64.decode(d.scansSidecar, m.scansSidecar = $util.newBuffer($util.base64.length(d.scansSidecar)), 0); + else if (d.scansSidecar.length >= 0) + m.scansSidecar = d.scansSidecar; + } + if (d.scanLengths) { + if (!Array.isArray(d.scanLengths)) + throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected"); + m.scanLengths = []; + for (var i = 0; i < d.scanLengths.length; ++i) { + m.scanLengths[i] = d.scanLengths[i] >>> 0; + } + } + if (d.midQualityFileSha256 != null) { + if (typeof d.midQualityFileSha256 === "string") + $util.base64.decode(d.midQualityFileSha256, m.midQualityFileSha256 = $util.newBuffer($util.base64.length(d.midQualityFileSha256)), 0); + else if (d.midQualityFileSha256.length >= 0) + m.midQualityFileSha256 = d.midQualityFileSha256; + } + if (d.midQualityFileEncSha256 != null) { + if (typeof d.midQualityFileEncSha256 === "string") + $util.base64.decode(d.midQualityFileEncSha256, m.midQualityFileEncSha256 = $util.newBuffer($util.base64.length(d.midQualityFileEncSha256)), 0); + else if (d.midQualityFileEncSha256.length >= 0) + m.midQualityFileEncSha256 = d.midQualityFileEncSha256; + } + if (d.viewOnce != null) { + m.viewOnce = Boolean(d.viewOnce); + } + if (d.thumbnailDirectPath != null) { + m.thumbnailDirectPath = String(d.thumbnailDirectPath); + } + if (d.thumbnailSha256 != null) { + if (typeof d.thumbnailSha256 === "string") + $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0); + else if (d.thumbnailSha256.length >= 0) + m.thumbnailSha256 = d.thumbnailSha256; + } + if (d.thumbnailEncSha256 != null) { + if (typeof d.thumbnailEncSha256 === "string") + $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0); + else if (d.thumbnailEncSha256.length >= 0) + m.thumbnailEncSha256 = d.thumbnailEncSha256; + } + if (d.staticUrl != null) { + m.staticUrl = String(d.staticUrl); + } + if (d.annotations) { + if (!Array.isArray(d.annotations)) + throw TypeError(".proto.Message.ImageMessage.annotations: array expected"); + m.annotations = []; + for (var i = 0; i < d.annotations.length; ++i) { + if (typeof d.annotations[i] !== "object") + throw TypeError(".proto.Message.ImageMessage.annotations: object expected"); + m.annotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.annotations[i]); + } + } + switch (d.imageSourceType) { + default: + if (typeof d.imageSourceType === "number") { + m.imageSourceType = d.imageSourceType; + break; + } + break; + case "USER_IMAGE": + case 0: + m.imageSourceType = 0; + break; + case "AI_GENERATED": + case 1: + m.imageSourceType = 1; + break; + case "AI_MODIFIED": + case 2: + m.imageSourceType = 2; + break; + case "RASTERIZED_TEXT_STATUS": + case 3: + m.imageSourceType = 3; + break; + } + if (d.accessibilityLabel != null) { + m.accessibilityLabel = String(d.accessibilityLabel); + } + return m; + }; + + ImageMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.interactiveAnnotations = []; + d.scanLengths = []; + d.annotations = []; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.interactiveAnnotations && m.interactiveAnnotations.length) { + d.interactiveAnnotations = []; + for (var j = 0; j < m.interactiveAnnotations.length; ++j) { + d.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(m.interactiveAnnotations[j], o); + } + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.firstScanSidecar != null && m.hasOwnProperty("firstScanSidecar")) { + d.firstScanSidecar = o.bytes === String ? $util.base64.encode(m.firstScanSidecar, 0, m.firstScanSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.firstScanSidecar) : m.firstScanSidecar; + if (o.oneofs) + d._firstScanSidecar = "firstScanSidecar"; + } + if (m.firstScanLength != null && m.hasOwnProperty("firstScanLength")) { + d.firstScanLength = m.firstScanLength; + if (o.oneofs) + d._firstScanLength = "firstScanLength"; + } + if (m.experimentGroupId != null && m.hasOwnProperty("experimentGroupId")) { + d.experimentGroupId = m.experimentGroupId; + if (o.oneofs) + d._experimentGroupId = "experimentGroupId"; + } + if (m.scansSidecar != null && m.hasOwnProperty("scansSidecar")) { + d.scansSidecar = o.bytes === String ? $util.base64.encode(m.scansSidecar, 0, m.scansSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.scansSidecar) : m.scansSidecar; + if (o.oneofs) + d._scansSidecar = "scansSidecar"; + } + if (m.scanLengths && m.scanLengths.length) { + d.scanLengths = []; + for (var j = 0; j < m.scanLengths.length; ++j) { + d.scanLengths[j] = m.scanLengths[j]; + } + } + if (m.midQualityFileSha256 != null && m.hasOwnProperty("midQualityFileSha256")) { + d.midQualityFileSha256 = o.bytes === String ? $util.base64.encode(m.midQualityFileSha256, 0, m.midQualityFileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.midQualityFileSha256) : m.midQualityFileSha256; + if (o.oneofs) + d._midQualityFileSha256 = "midQualityFileSha256"; + } + if (m.midQualityFileEncSha256 != null && m.hasOwnProperty("midQualityFileEncSha256")) { + d.midQualityFileEncSha256 = o.bytes === String ? $util.base64.encode(m.midQualityFileEncSha256, 0, m.midQualityFileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.midQualityFileEncSha256) : m.midQualityFileEncSha256; + if (o.oneofs) + d._midQualityFileEncSha256 = "midQualityFileEncSha256"; + } + if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) { + d.viewOnce = m.viewOnce; + if (o.oneofs) + d._viewOnce = "viewOnce"; + } + if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) { + d.thumbnailDirectPath = m.thumbnailDirectPath; + if (o.oneofs) + d._thumbnailDirectPath = "thumbnailDirectPath"; + } + if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) { + d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256; + if (o.oneofs) + d._thumbnailSha256 = "thumbnailSha256"; + } + if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) { + d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256; + if (o.oneofs) + d._thumbnailEncSha256 = "thumbnailEncSha256"; + } + if (m.staticUrl != null && m.hasOwnProperty("staticUrl")) { + d.staticUrl = m.staticUrl; + if (o.oneofs) + d._staticUrl = "staticUrl"; + } + if (m.annotations && m.annotations.length) { + d.annotations = []; + for (var j = 0; j < m.annotations.length; ++j) { + d.annotations[j] = $root.proto.InteractiveAnnotation.toObject(m.annotations[j], o); + } + } + if (m.imageSourceType != null && m.hasOwnProperty("imageSourceType")) { + d.imageSourceType = o.enums === String ? $root.proto.Message.ImageMessage.ImageSourceType[m.imageSourceType] === undefined ? m.imageSourceType : $root.proto.Message.ImageMessage.ImageSourceType[m.imageSourceType] : m.imageSourceType; + if (o.oneofs) + d._imageSourceType = "imageSourceType"; + } + if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) { + d.accessibilityLabel = m.accessibilityLabel; + if (o.oneofs) + d._accessibilityLabel = "accessibilityLabel"; + } + return d; + }; + + ImageMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ImageMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17756,7 +40501,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - InitialSecurityNotificationSettingSync.prototype.securityNotificationEnabled = false; + InitialSecurityNotificationSettingSync.prototype.securityNotificationEnabled = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InitialSecurityNotificationSettingSync.prototype, "_securityNotificationEnabled", { + get: $util.oneOfGetter($oneOfFields = ["securityNotificationEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); InitialSecurityNotificationSettingSync.create = function create(properties) { return new InitialSecurityNotificationSettingSync(properties); @@ -17791,6 +40544,32 @@ export const proto = $root.proto = (() => { return m; }; + InitialSecurityNotificationSettingSync.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InitialSecurityNotificationSettingSync) + return d; + var m = new $root.proto.Message.InitialSecurityNotificationSettingSync(); + if (d.securityNotificationEnabled != null) { + m.securityNotificationEnabled = Boolean(d.securityNotificationEnabled); + } + return m; + }; + + InitialSecurityNotificationSettingSync.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.securityNotificationEnabled != null && m.hasOwnProperty("securityNotificationEnabled")) { + d.securityNotificationEnabled = m.securityNotificationEnabled; + if (o.oneofs) + d._securityNotificationEnabled = "securityNotificationEnabled"; + } + return d; + }; + + InitialSecurityNotificationSettingSync.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InitialSecurityNotificationSettingSync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17822,6 +40601,36 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveMessage.prototype, "_header", { + get: $util.oneOfGetter($oneOfFields = ["header"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveMessage.prototype, "_body", { + get: $util.oneOfGetter($oneOfFields = ["body"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveMessage.prototype, "_footer", { + get: $util.oneOfGetter($oneOfFields = ["footer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveMessage.prototype, "_urlTrackingMap", { + get: $util.oneOfGetter($oneOfFields = ["urlTrackingMap"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(InteractiveMessage.prototype, "interactiveMessage", { get: $util.oneOfGetter($oneOfFields = ["shopStorefrontMessage", "collectionMessage", "nativeFlowMessage", "carouselMessage"]), set: $util.oneOfSetter($oneOfFields) @@ -17908,6 +40717,114 @@ export const proto = $root.proto = (() => { return m; }; + InteractiveMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage) + return d; + var m = new $root.proto.Message.InteractiveMessage(); + if (d.header != null) { + if (typeof d.header !== "object") + throw TypeError(".proto.Message.InteractiveMessage.header: object expected"); + m.header = $root.proto.Message.InteractiveMessage.Header.fromObject(d.header); + } + if (d.body != null) { + if (typeof d.body !== "object") + throw TypeError(".proto.Message.InteractiveMessage.body: object expected"); + m.body = $root.proto.Message.InteractiveMessage.Body.fromObject(d.body); + } + if (d.footer != null) { + if (typeof d.footer !== "object") + throw TypeError(".proto.Message.InteractiveMessage.footer: object expected"); + m.footer = $root.proto.Message.InteractiveMessage.Footer.fromObject(d.footer); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.urlTrackingMap != null) { + if (typeof d.urlTrackingMap !== "object") + throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected"); + m.urlTrackingMap = $root.proto.UrlTrackingMap.fromObject(d.urlTrackingMap); + } + if (d.shopStorefrontMessage != null) { + if (typeof d.shopStorefrontMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected"); + m.shopStorefrontMessage = $root.proto.Message.InteractiveMessage.ShopMessage.fromObject(d.shopStorefrontMessage); + } + if (d.collectionMessage != null) { + if (typeof d.collectionMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected"); + m.collectionMessage = $root.proto.Message.InteractiveMessage.CollectionMessage.fromObject(d.collectionMessage); + } + if (d.nativeFlowMessage != null) { + if (typeof d.nativeFlowMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected"); + m.nativeFlowMessage = $root.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(d.nativeFlowMessage); + } + if (d.carouselMessage != null) { + if (typeof d.carouselMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected"); + m.carouselMessage = $root.proto.Message.InteractiveMessage.CarouselMessage.fromObject(d.carouselMessage); + } + return m; + }; + + InteractiveMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.header != null && m.hasOwnProperty("header")) { + d.header = $root.proto.Message.InteractiveMessage.Header.toObject(m.header, o); + if (o.oneofs) + d._header = "header"; + } + if (m.body != null && m.hasOwnProperty("body")) { + d.body = $root.proto.Message.InteractiveMessage.Body.toObject(m.body, o); + if (o.oneofs) + d._body = "body"; + } + if (m.footer != null && m.hasOwnProperty("footer")) { + d.footer = $root.proto.Message.InteractiveMessage.Footer.toObject(m.footer, o); + if (o.oneofs) + d._footer = "footer"; + } + if (m.shopStorefrontMessage != null && m.hasOwnProperty("shopStorefrontMessage")) { + d.shopStorefrontMessage = $root.proto.Message.InteractiveMessage.ShopMessage.toObject(m.shopStorefrontMessage, o); + if (o.oneofs) + d.interactiveMessage = "shopStorefrontMessage"; + } + if (m.collectionMessage != null && m.hasOwnProperty("collectionMessage")) { + d.collectionMessage = $root.proto.Message.InteractiveMessage.CollectionMessage.toObject(m.collectionMessage, o); + if (o.oneofs) + d.interactiveMessage = "collectionMessage"; + } + if (m.nativeFlowMessage != null && m.hasOwnProperty("nativeFlowMessage")) { + d.nativeFlowMessage = $root.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(m.nativeFlowMessage, o); + if (o.oneofs) + d.interactiveMessage = "nativeFlowMessage"; + } + if (m.carouselMessage != null && m.hasOwnProperty("carouselMessage")) { + d.carouselMessage = $root.proto.Message.InteractiveMessage.CarouselMessage.toObject(m.carouselMessage, o); + if (o.oneofs) + d.interactiveMessage = "carouselMessage"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.urlTrackingMap != null && m.hasOwnProperty("urlTrackingMap")) { + d.urlTrackingMap = $root.proto.UrlTrackingMap.toObject(m.urlTrackingMap, o); + if (o.oneofs) + d._urlTrackingMap = "urlTrackingMap"; + } + return d; + }; + + InteractiveMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InteractiveMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17924,7 +40841,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Body.prototype.text = ""; + Body.prototype.text = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Body.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); Body.create = function create(properties) { return new Body(properties); @@ -17959,6 +40884,32 @@ export const proto = $root.proto = (() => { return m; }; + Body.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.Body) + return d; + var m = new $root.proto.Message.InteractiveMessage.Body(); + if (d.text != null) { + m.text = String(d.text); + } + return m; + }; + + Body.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + return d; + }; + + Body.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -17980,7 +40931,15 @@ export const proto = $root.proto = (() => { } CarouselMessage.prototype.cards = $util.emptyArray; - CarouselMessage.prototype.messageVersion = 0; + CarouselMessage.prototype.messageVersion = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CarouselMessage.prototype, "_messageVersion", { + get: $util.oneOfGetter($oneOfFields = ["messageVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); CarouselMessage.create = function create(properties) { return new CarouselMessage(properties); @@ -18025,6 +40984,51 @@ export const proto = $root.proto = (() => { return m; }; + CarouselMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.CarouselMessage) + return d; + var m = new $root.proto.Message.InteractiveMessage.CarouselMessage(); + if (d.cards) { + if (!Array.isArray(d.cards)) + throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected"); + m.cards = []; + for (var i = 0; i < d.cards.length; ++i) { + if (typeof d.cards[i] !== "object") + throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: object expected"); + m.cards[i] = $root.proto.Message.InteractiveMessage.fromObject(d.cards[i]); + } + } + if (d.messageVersion != null) { + m.messageVersion = d.messageVersion | 0; + } + return m; + }; + + CarouselMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.cards = []; + } + if (m.cards && m.cards.length) { + d.cards = []; + for (var j = 0; j < m.cards.length; ++j) { + d.cards[j] = $root.proto.Message.InteractiveMessage.toObject(m.cards[j], o); + } + } + if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) { + d.messageVersion = m.messageVersion; + if (o.oneofs) + d._messageVersion = "messageVersion"; + } + return d; + }; + + CarouselMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CarouselMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18044,9 +41048,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CollectionMessage.prototype.bizJid = ""; - CollectionMessage.prototype.id = ""; - CollectionMessage.prototype.messageVersion = 0; + CollectionMessage.prototype.bizJid = null; + CollectionMessage.prototype.id = null; + CollectionMessage.prototype.messageVersion = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CollectionMessage.prototype, "_bizJid", { + get: $util.oneOfGetter($oneOfFields = ["bizJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CollectionMessage.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CollectionMessage.prototype, "_messageVersion", { + get: $util.oneOfGetter($oneOfFields = ["messageVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); CollectionMessage.create = function create(properties) { return new CollectionMessage(properties); @@ -18093,6 +41117,48 @@ export const proto = $root.proto = (() => { return m; }; + CollectionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.CollectionMessage) + return d; + var m = new $root.proto.Message.InteractiveMessage.CollectionMessage(); + if (d.bizJid != null) { + m.bizJid = String(d.bizJid); + } + if (d.id != null) { + m.id = String(d.id); + } + if (d.messageVersion != null) { + m.messageVersion = d.messageVersion | 0; + } + return m; + }; + + CollectionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.bizJid != null && m.hasOwnProperty("bizJid")) { + d.bizJid = m.bizJid; + if (o.oneofs) + d._bizJid = "bizJid"; + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) { + d.messageVersion = m.messageVersion; + if (o.oneofs) + d._messageVersion = "messageVersion"; + } + return d; + }; + + CollectionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CollectionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18112,7 +41178,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Footer.prototype.text = ""; + Footer.prototype.text = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Footer.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); Footer.create = function create(properties) { return new Footer(properties); @@ -18147,6 +41221,32 @@ export const proto = $root.proto = (() => { return m; }; + Footer.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.Footer) + return d; + var m = new $root.proto.Message.InteractiveMessage.Footer(); + if (d.text != null) { + m.text = String(d.text); + } + return m; + }; + + Footer.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + return d; + }; + + Footer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Footer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18166,9 +41266,9 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Header.prototype.title = ""; - Header.prototype.subtitle = ""; - Header.prototype.hasMediaAttachment = false; + Header.prototype.title = null; + Header.prototype.subtitle = null; + Header.prototype.hasMediaAttachment = null; Header.prototype.documentMessage = null; Header.prototype.imageMessage = null; Header.prototype.jpegThumbnail = null; @@ -18178,6 +41278,24 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(Header.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Header.prototype, "_subtitle", { + get: $util.oneOfGetter($oneOfFields = ["subtitle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Header.prototype, "_hasMediaAttachment", { + get: $util.oneOfGetter($oneOfFields = ["hasMediaAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(Header.prototype, "media", { get: $util.oneOfGetter($oneOfFields = ["documentMessage", "imageMessage", "jpegThumbnail", "videoMessage", "locationMessage", "productMessage"]), set: $util.oneOfSetter($oneOfFields) @@ -18264,6 +41382,109 @@ export const proto = $root.proto = (() => { return m; }; + Header.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.Header) + return d; + var m = new $root.proto.Message.InteractiveMessage.Header(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.subtitle != null) { + m.subtitle = String(d.subtitle); + } + if (d.hasMediaAttachment != null) { + m.hasMediaAttachment = Boolean(d.hasMediaAttachment); + } + if (d.documentMessage != null) { + if (typeof d.documentMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected"); + m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage); + } + if (d.imageMessage != null) { + if (typeof d.imageMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected"); + m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.videoMessage != null) { + if (typeof d.videoMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected"); + m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage); + } + if (d.locationMessage != null) { + if (typeof d.locationMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected"); + m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage); + } + if (d.productMessage != null) { + if (typeof d.productMessage !== "object") + throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected"); + m.productMessage = $root.proto.Message.ProductMessage.fromObject(d.productMessage); + } + return m; + }; + + Header.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.subtitle != null && m.hasOwnProperty("subtitle")) { + d.subtitle = m.subtitle; + if (o.oneofs) + d._subtitle = "subtitle"; + } + if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) { + d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o); + if (o.oneofs) + d.media = "documentMessage"; + } + if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) { + d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o); + if (o.oneofs) + d.media = "imageMessage"; + } + if (m.hasMediaAttachment != null && m.hasOwnProperty("hasMediaAttachment")) { + d.hasMediaAttachment = m.hasMediaAttachment; + if (o.oneofs) + d._hasMediaAttachment = "hasMediaAttachment"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d.media = "jpegThumbnail"; + } + if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) { + d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o); + if (o.oneofs) + d.media = "videoMessage"; + } + if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) { + d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o); + if (o.oneofs) + d.media = "locationMessage"; + } + if (m.productMessage != null && m.hasOwnProperty("productMessage")) { + d.productMessage = $root.proto.Message.ProductMessage.toObject(m.productMessage, o); + if (o.oneofs) + d.media = "productMessage"; + } + return d; + }; + + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Header.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18285,8 +41506,22 @@ export const proto = $root.proto = (() => { } NativeFlowMessage.prototype.buttons = $util.emptyArray; - NativeFlowMessage.prototype.messageParamsJson = ""; - NativeFlowMessage.prototype.messageVersion = 0; + NativeFlowMessage.prototype.messageParamsJson = null; + NativeFlowMessage.prototype.messageVersion = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowMessage.prototype, "_messageParamsJson", { + get: $util.oneOfGetter($oneOfFields = ["messageParamsJson"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowMessage.prototype, "_messageVersion", { + get: $util.oneOfGetter($oneOfFields = ["messageVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); NativeFlowMessage.create = function create(properties) { return new NativeFlowMessage(properties); @@ -18337,6 +41572,59 @@ export const proto = $root.proto = (() => { return m; }; + NativeFlowMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.NativeFlowMessage) + return d; + var m = new $root.proto.Message.InteractiveMessage.NativeFlowMessage(); + if (d.buttons) { + if (!Array.isArray(d.buttons)) + throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected"); + m.buttons = []; + for (var i = 0; i < d.buttons.length; ++i) { + if (typeof d.buttons[i] !== "object") + throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: object expected"); + m.buttons[i] = $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.fromObject(d.buttons[i]); + } + } + if (d.messageParamsJson != null) { + m.messageParamsJson = String(d.messageParamsJson); + } + if (d.messageVersion != null) { + m.messageVersion = d.messageVersion | 0; + } + return m; + }; + + NativeFlowMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.buttons = []; + } + if (m.buttons && m.buttons.length) { + d.buttons = []; + for (var j = 0; j < m.buttons.length; ++j) { + d.buttons[j] = $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.toObject(m.buttons[j], o); + } + } + if (m.messageParamsJson != null && m.hasOwnProperty("messageParamsJson")) { + d.messageParamsJson = m.messageParamsJson; + if (o.oneofs) + d._messageParamsJson = "messageParamsJson"; + } + if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) { + d.messageVersion = m.messageVersion; + if (o.oneofs) + d._messageVersion = "messageVersion"; + } + return d; + }; + + NativeFlowMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NativeFlowMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18353,8 +41641,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NativeFlowButton.prototype.name = ""; - NativeFlowButton.prototype.buttonParamsJson = ""; + NativeFlowButton.prototype.name = null; + NativeFlowButton.prototype.buttonParamsJson = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowButton.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowButton.prototype, "_buttonParamsJson", { + get: $util.oneOfGetter($oneOfFields = ["buttonParamsJson"]), + set: $util.oneOfSetter($oneOfFields) + }); NativeFlowButton.create = function create(properties) { return new NativeFlowButton(properties); @@ -18395,6 +41697,40 @@ export const proto = $root.proto = (() => { return m; }; + NativeFlowButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton) + return d; + var m = new $root.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.buttonParamsJson != null) { + m.buttonParamsJson = String(d.buttonParamsJson); + } + return m; + }; + + NativeFlowButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.buttonParamsJson != null && m.hasOwnProperty("buttonParamsJson")) { + d.buttonParamsJson = m.buttonParamsJson; + if (o.oneofs) + d._buttonParamsJson = "buttonParamsJson"; + } + return d; + }; + + NativeFlowButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NativeFlowButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18417,9 +41753,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ShopMessage.prototype.id = ""; - ShopMessage.prototype.surface = 0; - ShopMessage.prototype.messageVersion = 0; + ShopMessage.prototype.id = null; + ShopMessage.prototype.surface = null; + ShopMessage.prototype.messageVersion = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShopMessage.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShopMessage.prototype, "_surface", { + get: $util.oneOfGetter($oneOfFields = ["surface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShopMessage.prototype, "_messageVersion", { + get: $util.oneOfGetter($oneOfFields = ["messageVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); ShopMessage.create = function create(properties) { return new ShopMessage(properties); @@ -18466,6 +41822,69 @@ export const proto = $root.proto = (() => { return m; }; + ShopMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveMessage.ShopMessage) + return d; + var m = new $root.proto.Message.InteractiveMessage.ShopMessage(); + if (d.id != null) { + m.id = String(d.id); + } + switch (d.surface) { + default: + if (typeof d.surface === "number") { + m.surface = d.surface; + break; + } + break; + case "UNKNOWN_SURFACE": + case 0: + m.surface = 0; + break; + case "FB": + case 1: + m.surface = 1; + break; + case "IG": + case 2: + m.surface = 2; + break; + case "WA": + case 3: + m.surface = 3; + break; + } + if (d.messageVersion != null) { + m.messageVersion = d.messageVersion | 0; + } + return m; + }; + + ShopMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.surface != null && m.hasOwnProperty("surface")) { + d.surface = o.enums === String ? $root.proto.Message.InteractiveMessage.ShopMessage.Surface[m.surface] === undefined ? m.surface : $root.proto.Message.InteractiveMessage.ShopMessage.Surface[m.surface] : m.surface; + if (o.oneofs) + d._surface = "surface"; + } + if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) { + d.messageVersion = m.messageVersion; + if (o.oneofs) + d._messageVersion = "messageVersion"; + } + return d; + }; + + ShopMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ShopMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18503,6 +41922,18 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveResponseMessage.prototype, "_body", { + get: $util.oneOfGetter($oneOfFields = ["body"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InteractiveResponseMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(InteractiveResponseMessage.prototype, "interactiveResponseMessage", { get: $util.oneOfGetter($oneOfFields = ["nativeFlowResponseMessage"]), set: $util.oneOfSetter($oneOfFields) @@ -18553,6 +41984,54 @@ export const proto = $root.proto = (() => { return m; }; + InteractiveResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveResponseMessage) + return d; + var m = new $root.proto.Message.InteractiveResponseMessage(); + if (d.body != null) { + if (typeof d.body !== "object") + throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected"); + m.body = $root.proto.Message.InteractiveResponseMessage.Body.fromObject(d.body); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.nativeFlowResponseMessage != null) { + if (typeof d.nativeFlowResponseMessage !== "object") + throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected"); + m.nativeFlowResponseMessage = $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(d.nativeFlowResponseMessage); + } + return m; + }; + + InteractiveResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.body != null && m.hasOwnProperty("body")) { + d.body = $root.proto.Message.InteractiveResponseMessage.Body.toObject(m.body, o); + if (o.oneofs) + d._body = "body"; + } + if (m.nativeFlowResponseMessage != null && m.hasOwnProperty("nativeFlowResponseMessage")) { + d.nativeFlowResponseMessage = $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(m.nativeFlowResponseMessage, o); + if (o.oneofs) + d.interactiveResponseMessage = "nativeFlowResponseMessage"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + InteractiveResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InteractiveResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18569,8 +42048,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Body.prototype.text = ""; - Body.prototype.format = 0; + Body.prototype.text = null; + Body.prototype.format = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Body.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Body.prototype, "_format", { + get: $util.oneOfGetter($oneOfFields = ["format"]), + set: $util.oneOfSetter($oneOfFields) + }); Body.create = function create(properties) { return new Body(properties); @@ -18611,6 +42104,53 @@ export const proto = $root.proto = (() => { return m; }; + Body.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveResponseMessage.Body) + return d; + var m = new $root.proto.Message.InteractiveResponseMessage.Body(); + if (d.text != null) { + m.text = String(d.text); + } + switch (d.format) { + default: + if (typeof d.format === "number") { + m.format = d.format; + break; + } + break; + case "DEFAULT": + case 0: + m.format = 0; + break; + case "EXTENSIONS_1": + case 1: + m.format = 1; + break; + } + return m; + }; + + Body.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.format != null && m.hasOwnProperty("format")) { + d.format = o.enums === String ? $root.proto.Message.InteractiveResponseMessage.Body.Format[m.format] === undefined ? m.format : $root.proto.Message.InteractiveResponseMessage.Body.Format[m.format] : m.format; + if (o.oneofs) + d._format = "format"; + } + return d; + }; + + Body.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18637,9 +42177,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NativeFlowResponseMessage.prototype.name = ""; - NativeFlowResponseMessage.prototype.paramsJson = ""; - NativeFlowResponseMessage.prototype.version = 0; + NativeFlowResponseMessage.prototype.name = null; + NativeFlowResponseMessage.prototype.paramsJson = null; + NativeFlowResponseMessage.prototype.version = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowResponseMessage.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowResponseMessage.prototype, "_paramsJson", { + get: $util.oneOfGetter($oneOfFields = ["paramsJson"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NativeFlowResponseMessage.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); NativeFlowResponseMessage.create = function create(properties) { return new NativeFlowResponseMessage(properties); @@ -18686,6 +42246,48 @@ export const proto = $root.proto = (() => { return m; }; + NativeFlowResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage) + return d; + var m = new $root.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.paramsJson != null) { + m.paramsJson = String(d.paramsJson); + } + if (d.version != null) { + m.version = d.version | 0; + } + return m; + }; + + NativeFlowResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.paramsJson != null && m.hasOwnProperty("paramsJson")) { + d.paramsJson = m.paramsJson; + if (o.oneofs) + d._paramsJson = "paramsJson"; + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = m.version; + if (o.oneofs) + d._version = "version"; + } + return d; + }; + + NativeFlowResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NativeFlowResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18708,16 +42310,78 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - InvoiceMessage.prototype.note = ""; - InvoiceMessage.prototype.token = ""; - InvoiceMessage.prototype.attachmentType = 0; - InvoiceMessage.prototype.attachmentMimetype = ""; - InvoiceMessage.prototype.attachmentMediaKey = $util.newBuffer([]); - InvoiceMessage.prototype.attachmentMediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - InvoiceMessage.prototype.attachmentFileSha256 = $util.newBuffer([]); - InvoiceMessage.prototype.attachmentFileEncSha256 = $util.newBuffer([]); - InvoiceMessage.prototype.attachmentDirectPath = ""; - InvoiceMessage.prototype.attachmentJpegThumbnail = $util.newBuffer([]); + InvoiceMessage.prototype.note = null; + InvoiceMessage.prototype.token = null; + InvoiceMessage.prototype.attachmentType = null; + InvoiceMessage.prototype.attachmentMimetype = null; + InvoiceMessage.prototype.attachmentMediaKey = null; + InvoiceMessage.prototype.attachmentMediaKeyTimestamp = null; + InvoiceMessage.prototype.attachmentFileSha256 = null; + InvoiceMessage.prototype.attachmentFileEncSha256 = null; + InvoiceMessage.prototype.attachmentDirectPath = null; + InvoiceMessage.prototype.attachmentJpegThumbnail = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_note", { + get: $util.oneOfGetter($oneOfFields = ["note"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_token", { + get: $util.oneOfGetter($oneOfFields = ["token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentType", { + get: $util.oneOfGetter($oneOfFields = ["attachmentType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentMimetype", { + get: $util.oneOfGetter($oneOfFields = ["attachmentMimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentMediaKey", { + get: $util.oneOfGetter($oneOfFields = ["attachmentMediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentMediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["attachmentMediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentFileSha256", { + get: $util.oneOfGetter($oneOfFields = ["attachmentFileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentFileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["attachmentFileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["attachmentDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InvoiceMessage.prototype, "_attachmentJpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["attachmentJpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); InvoiceMessage.create = function create(properties) { return new InvoiceMessage(properties); @@ -18806,6 +42470,139 @@ export const proto = $root.proto = (() => { return m; }; + InvoiceMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.InvoiceMessage) + return d; + var m = new $root.proto.Message.InvoiceMessage(); + if (d.note != null) { + m.note = String(d.note); + } + if (d.token != null) { + m.token = String(d.token); + } + switch (d.attachmentType) { + default: + if (typeof d.attachmentType === "number") { + m.attachmentType = d.attachmentType; + break; + } + break; + case "IMAGE": + case 0: + m.attachmentType = 0; + break; + case "PDF": + case 1: + m.attachmentType = 1; + break; + } + if (d.attachmentMimetype != null) { + m.attachmentMimetype = String(d.attachmentMimetype); + } + if (d.attachmentMediaKey != null) { + if (typeof d.attachmentMediaKey === "string") + $util.base64.decode(d.attachmentMediaKey, m.attachmentMediaKey = $util.newBuffer($util.base64.length(d.attachmentMediaKey)), 0); + else if (d.attachmentMediaKey.length >= 0) + m.attachmentMediaKey = d.attachmentMediaKey; + } + if (d.attachmentMediaKeyTimestamp != null) { + if ($util.Long) + (m.attachmentMediaKeyTimestamp = $util.Long.fromValue(d.attachmentMediaKeyTimestamp)).unsigned = false; + else if (typeof d.attachmentMediaKeyTimestamp === "string") + m.attachmentMediaKeyTimestamp = parseInt(d.attachmentMediaKeyTimestamp, 10); + else if (typeof d.attachmentMediaKeyTimestamp === "number") + m.attachmentMediaKeyTimestamp = d.attachmentMediaKeyTimestamp; + else if (typeof d.attachmentMediaKeyTimestamp === "object") + m.attachmentMediaKeyTimestamp = new $util.LongBits(d.attachmentMediaKeyTimestamp.low >>> 0, d.attachmentMediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.attachmentFileSha256 != null) { + if (typeof d.attachmentFileSha256 === "string") + $util.base64.decode(d.attachmentFileSha256, m.attachmentFileSha256 = $util.newBuffer($util.base64.length(d.attachmentFileSha256)), 0); + else if (d.attachmentFileSha256.length >= 0) + m.attachmentFileSha256 = d.attachmentFileSha256; + } + if (d.attachmentFileEncSha256 != null) { + if (typeof d.attachmentFileEncSha256 === "string") + $util.base64.decode(d.attachmentFileEncSha256, m.attachmentFileEncSha256 = $util.newBuffer($util.base64.length(d.attachmentFileEncSha256)), 0); + else if (d.attachmentFileEncSha256.length >= 0) + m.attachmentFileEncSha256 = d.attachmentFileEncSha256; + } + if (d.attachmentDirectPath != null) { + m.attachmentDirectPath = String(d.attachmentDirectPath); + } + if (d.attachmentJpegThumbnail != null) { + if (typeof d.attachmentJpegThumbnail === "string") + $util.base64.decode(d.attachmentJpegThumbnail, m.attachmentJpegThumbnail = $util.newBuffer($util.base64.length(d.attachmentJpegThumbnail)), 0); + else if (d.attachmentJpegThumbnail.length >= 0) + m.attachmentJpegThumbnail = d.attachmentJpegThumbnail; + } + return m; + }; + + InvoiceMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.note != null && m.hasOwnProperty("note")) { + d.note = m.note; + if (o.oneofs) + d._note = "note"; + } + if (m.token != null && m.hasOwnProperty("token")) { + d.token = m.token; + if (o.oneofs) + d._token = "token"; + } + if (m.attachmentType != null && m.hasOwnProperty("attachmentType")) { + d.attachmentType = o.enums === String ? $root.proto.Message.InvoiceMessage.AttachmentType[m.attachmentType] === undefined ? m.attachmentType : $root.proto.Message.InvoiceMessage.AttachmentType[m.attachmentType] : m.attachmentType; + if (o.oneofs) + d._attachmentType = "attachmentType"; + } + if (m.attachmentMimetype != null && m.hasOwnProperty("attachmentMimetype")) { + d.attachmentMimetype = m.attachmentMimetype; + if (o.oneofs) + d._attachmentMimetype = "attachmentMimetype"; + } + if (m.attachmentMediaKey != null && m.hasOwnProperty("attachmentMediaKey")) { + d.attachmentMediaKey = o.bytes === String ? $util.base64.encode(m.attachmentMediaKey, 0, m.attachmentMediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentMediaKey) : m.attachmentMediaKey; + if (o.oneofs) + d._attachmentMediaKey = "attachmentMediaKey"; + } + if (m.attachmentMediaKeyTimestamp != null && m.hasOwnProperty("attachmentMediaKeyTimestamp")) { + if (typeof m.attachmentMediaKeyTimestamp === "number") + d.attachmentMediaKeyTimestamp = o.longs === String ? String(m.attachmentMediaKeyTimestamp) : m.attachmentMediaKeyTimestamp; + else + d.attachmentMediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.attachmentMediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.attachmentMediaKeyTimestamp.low >>> 0, m.attachmentMediaKeyTimestamp.high >>> 0).toNumber() : m.attachmentMediaKeyTimestamp; + if (o.oneofs) + d._attachmentMediaKeyTimestamp = "attachmentMediaKeyTimestamp"; + } + if (m.attachmentFileSha256 != null && m.hasOwnProperty("attachmentFileSha256")) { + d.attachmentFileSha256 = o.bytes === String ? $util.base64.encode(m.attachmentFileSha256, 0, m.attachmentFileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentFileSha256) : m.attachmentFileSha256; + if (o.oneofs) + d._attachmentFileSha256 = "attachmentFileSha256"; + } + if (m.attachmentFileEncSha256 != null && m.hasOwnProperty("attachmentFileEncSha256")) { + d.attachmentFileEncSha256 = o.bytes === String ? $util.base64.encode(m.attachmentFileEncSha256, 0, m.attachmentFileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentFileEncSha256) : m.attachmentFileEncSha256; + if (o.oneofs) + d._attachmentFileEncSha256 = "attachmentFileEncSha256"; + } + if (m.attachmentDirectPath != null && m.hasOwnProperty("attachmentDirectPath")) { + d.attachmentDirectPath = m.attachmentDirectPath; + if (o.oneofs) + d._attachmentDirectPath = "attachmentDirectPath"; + } + if (m.attachmentJpegThumbnail != null && m.hasOwnProperty("attachmentJpegThumbnail")) { + d.attachmentJpegThumbnail = o.bytes === String ? $util.base64.encode(m.attachmentJpegThumbnail, 0, m.attachmentJpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.attachmentJpegThumbnail) : m.attachmentJpegThumbnail; + if (o.oneofs) + d._attachmentJpegThumbnail = "attachmentJpegThumbnail"; + } + return d; + }; + + InvoiceMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InvoiceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18833,8 +42630,28 @@ export const proto = $root.proto = (() => { } KeepInChatMessage.prototype.key = null; - KeepInChatMessage.prototype.keepType = 0; - KeepInChatMessage.prototype.timestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + KeepInChatMessage.prototype.keepType = null; + KeepInChatMessage.prototype.timestampMs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChatMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChatMessage.prototype, "_keepType", { + get: $util.oneOfGetter($oneOfFields = ["keepType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeepInChatMessage.prototype, "_timestampMs", { + get: $util.oneOfGetter($oneOfFields = ["timestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); KeepInChatMessage.create = function create(properties) { return new KeepInChatMessage(properties); @@ -18881,6 +42698,77 @@ export const proto = $root.proto = (() => { return m; }; + KeepInChatMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.KeepInChatMessage) + return d; + var m = new $root.proto.Message.KeepInChatMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.KeepInChatMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + switch (d.keepType) { + default: + if (typeof d.keepType === "number") { + m.keepType = d.keepType; + break; + } + break; + case "UNKNOWN": + case 0: + m.keepType = 0; + break; + case "KEEP_FOR_ALL": + case 1: + m.keepType = 1; + break; + case "UNDO_KEEP_FOR_ALL": + case 2: + m.keepType = 2; + break; + } + if (d.timestampMs != null) { + if ($util.Long) + (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false; + else if (typeof d.timestampMs === "string") + m.timestampMs = parseInt(d.timestampMs, 10); + else if (typeof d.timestampMs === "number") + m.timestampMs = d.timestampMs; + else if (typeof d.timestampMs === "object") + m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber(); + } + return m; + }; + + KeepInChatMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.keepType != null && m.hasOwnProperty("keepType")) { + d.keepType = o.enums === String ? $root.proto.KeepType[m.keepType] === undefined ? m.keepType : $root.proto.KeepType[m.keepType] : m.keepType; + if (o.oneofs) + d._keepType = "keepType"; + } + if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) { + if (typeof m.timestampMs === "number") + d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; + else + d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + if (o.oneofs) + d._timestampMs = "timestampMs"; + } + return d; + }; + + KeepInChatMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeepInChatMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18902,7 +42790,27 @@ export const proto = $root.proto = (() => { LinkPreviewMetadata.prototype.paymentLinkMetadata = null; LinkPreviewMetadata.prototype.urlMetadata = null; - LinkPreviewMetadata.prototype.fbExperimentId = 0; + LinkPreviewMetadata.prototype.fbExperimentId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewMetadata.prototype, "_paymentLinkMetadata", { + get: $util.oneOfGetter($oneOfFields = ["paymentLinkMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewMetadata.prototype, "_urlMetadata", { + get: $util.oneOfGetter($oneOfFields = ["urlMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewMetadata.prototype, "_fbExperimentId", { + get: $util.oneOfGetter($oneOfFields = ["fbExperimentId"]), + set: $util.oneOfSetter($oneOfFields) + }); LinkPreviewMetadata.create = function create(properties) { return new LinkPreviewMetadata(properties); @@ -18949,6 +42857,52 @@ export const proto = $root.proto = (() => { return m; }; + LinkPreviewMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.LinkPreviewMetadata) + return d; + var m = new $root.proto.Message.LinkPreviewMetadata(); + if (d.paymentLinkMetadata != null) { + if (typeof d.paymentLinkMetadata !== "object") + throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected"); + m.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.fromObject(d.paymentLinkMetadata); + } + if (d.urlMetadata != null) { + if (typeof d.urlMetadata !== "object") + throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected"); + m.urlMetadata = $root.proto.Message.URLMetadata.fromObject(d.urlMetadata); + } + if (d.fbExperimentId != null) { + m.fbExperimentId = d.fbExperimentId >>> 0; + } + return m; + }; + + LinkPreviewMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.paymentLinkMetadata != null && m.hasOwnProperty("paymentLinkMetadata")) { + d.paymentLinkMetadata = $root.proto.Message.PaymentLinkMetadata.toObject(m.paymentLinkMetadata, o); + if (o.oneofs) + d._paymentLinkMetadata = "paymentLinkMetadata"; + } + if (m.urlMetadata != null && m.hasOwnProperty("urlMetadata")) { + d.urlMetadata = $root.proto.Message.URLMetadata.toObject(m.urlMetadata, o); + if (o.oneofs) + d._urlMetadata = "urlMetadata"; + } + if (m.fbExperimentId != null && m.hasOwnProperty("fbExperimentId")) { + d.fbExperimentId = m.fbExperimentId; + if (o.oneofs) + d._fbExperimentId = "fbExperimentId"; + } + return d; + }; + + LinkPreviewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LinkPreviewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -18969,15 +42923,59 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ListMessage.prototype.title = ""; - ListMessage.prototype.description = ""; - ListMessage.prototype.buttonText = ""; - ListMessage.prototype.listType = 0; + ListMessage.prototype.title = null; + ListMessage.prototype.description = null; + ListMessage.prototype.buttonText = null; + ListMessage.prototype.listType = null; ListMessage.prototype.sections = $util.emptyArray; ListMessage.prototype.productListInfo = null; - ListMessage.prototype.footerText = ""; + ListMessage.prototype.footerText = null; ListMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_buttonText", { + get: $util.oneOfGetter($oneOfFields = ["buttonText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_listType", { + get: $util.oneOfGetter($oneOfFields = ["listType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_productListInfo", { + get: $util.oneOfGetter($oneOfFields = ["productListInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_footerText", { + get: $util.oneOfGetter($oneOfFields = ["footerText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + ListMessage.create = function create(properties) { return new ListMessage(properties); }; @@ -19057,6 +43055,120 @@ export const proto = $root.proto = (() => { return m; }; + ListMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage) + return d; + var m = new $root.proto.Message.ListMessage(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.buttonText != null) { + m.buttonText = String(d.buttonText); + } + switch (d.listType) { + default: + if (typeof d.listType === "number") { + m.listType = d.listType; + break; + } + break; + case "UNKNOWN": + case 0: + m.listType = 0; + break; + case "SINGLE_SELECT": + case 1: + m.listType = 1; + break; + case "PRODUCT_LIST": + case 2: + m.listType = 2; + break; + } + if (d.sections) { + if (!Array.isArray(d.sections)) + throw TypeError(".proto.Message.ListMessage.sections: array expected"); + m.sections = []; + for (var i = 0; i < d.sections.length; ++i) { + if (typeof d.sections[i] !== "object") + throw TypeError(".proto.Message.ListMessage.sections: object expected"); + m.sections[i] = $root.proto.Message.ListMessage.Section.fromObject(d.sections[i]); + } + } + if (d.productListInfo != null) { + if (typeof d.productListInfo !== "object") + throw TypeError(".proto.Message.ListMessage.productListInfo: object expected"); + m.productListInfo = $root.proto.Message.ListMessage.ProductListInfo.fromObject(d.productListInfo); + } + if (d.footerText != null) { + m.footerText = String(d.footerText); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ListMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + ListMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.sections = []; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.buttonText != null && m.hasOwnProperty("buttonText")) { + d.buttonText = m.buttonText; + if (o.oneofs) + d._buttonText = "buttonText"; + } + if (m.listType != null && m.hasOwnProperty("listType")) { + d.listType = o.enums === String ? $root.proto.Message.ListMessage.ListType[m.listType] === undefined ? m.listType : $root.proto.Message.ListMessage.ListType[m.listType] : m.listType; + if (o.oneofs) + d._listType = "listType"; + } + if (m.sections && m.sections.length) { + d.sections = []; + for (var j = 0; j < m.sections.length; ++j) { + d.sections[j] = $root.proto.Message.ListMessage.Section.toObject(m.sections[j], o); + } + } + if (m.productListInfo != null && m.hasOwnProperty("productListInfo")) { + d.productListInfo = $root.proto.Message.ListMessage.ProductListInfo.toObject(m.productListInfo, o); + if (o.oneofs) + d._productListInfo = "productListInfo"; + } + if (m.footerText != null && m.hasOwnProperty("footerText")) { + d.footerText = m.footerText; + if (o.oneofs) + d._footerText = "footerText"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + ListMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ListMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19081,7 +43193,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Product.prototype.productId = ""; + Product.prototype.productId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Product.prototype, "_productId", { + get: $util.oneOfGetter($oneOfFields = ["productId"]), + set: $util.oneOfSetter($oneOfFields) + }); Product.create = function create(properties) { return new Product(properties); @@ -19116,6 +43236,32 @@ export const proto = $root.proto = (() => { return m; }; + Product.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage.Product) + return d; + var m = new $root.proto.Message.ListMessage.Product(); + if (d.productId != null) { + m.productId = String(d.productId); + } + return m; + }; + + Product.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.productId != null && m.hasOwnProperty("productId")) { + d.productId = m.productId; + if (o.oneofs) + d._productId = "productId"; + } + return d; + }; + + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19135,8 +43281,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ProductListHeaderImage.prototype.productId = ""; - ProductListHeaderImage.prototype.jpegThumbnail = $util.newBuffer([]); + ProductListHeaderImage.prototype.productId = null; + ProductListHeaderImage.prototype.jpegThumbnail = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductListHeaderImage.prototype, "_productId", { + get: $util.oneOfGetter($oneOfFields = ["productId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductListHeaderImage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); ProductListHeaderImage.create = function create(properties) { return new ProductListHeaderImage(properties); @@ -19177,6 +43337,43 @@ export const proto = $root.proto = (() => { return m; }; + ProductListHeaderImage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage.ProductListHeaderImage) + return d; + var m = new $root.proto.Message.ListMessage.ProductListHeaderImage(); + if (d.productId != null) { + m.productId = String(d.productId); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + return m; + }; + + ProductListHeaderImage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.productId != null && m.hasOwnProperty("productId")) { + d.productId = m.productId; + if (o.oneofs) + d._productId = "productId"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + return d; + }; + + ProductListHeaderImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProductListHeaderImage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19199,7 +43396,21 @@ export const proto = $root.proto = (() => { ProductListInfo.prototype.productSections = $util.emptyArray; ProductListInfo.prototype.headerImage = null; - ProductListInfo.prototype.businessOwnerJid = ""; + ProductListInfo.prototype.businessOwnerJid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductListInfo.prototype, "_headerImage", { + get: $util.oneOfGetter($oneOfFields = ["headerImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductListInfo.prototype, "_businessOwnerJid", { + get: $util.oneOfGetter($oneOfFields = ["businessOwnerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); ProductListInfo.create = function create(properties) { return new ProductListInfo(properties); @@ -19250,6 +43461,61 @@ export const proto = $root.proto = (() => { return m; }; + ProductListInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage.ProductListInfo) + return d; + var m = new $root.proto.Message.ListMessage.ProductListInfo(); + if (d.productSections) { + if (!Array.isArray(d.productSections)) + throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected"); + m.productSections = []; + for (var i = 0; i < d.productSections.length; ++i) { + if (typeof d.productSections[i] !== "object") + throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: object expected"); + m.productSections[i] = $root.proto.Message.ListMessage.ProductSection.fromObject(d.productSections[i]); + } + } + if (d.headerImage != null) { + if (typeof d.headerImage !== "object") + throw TypeError(".proto.Message.ListMessage.ProductListInfo.headerImage: object expected"); + m.headerImage = $root.proto.Message.ListMessage.ProductListHeaderImage.fromObject(d.headerImage); + } + if (d.businessOwnerJid != null) { + m.businessOwnerJid = String(d.businessOwnerJid); + } + return m; + }; + + ProductListInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.productSections = []; + } + if (m.productSections && m.productSections.length) { + d.productSections = []; + for (var j = 0; j < m.productSections.length; ++j) { + d.productSections[j] = $root.proto.Message.ListMessage.ProductSection.toObject(m.productSections[j], o); + } + } + if (m.headerImage != null && m.hasOwnProperty("headerImage")) { + d.headerImage = $root.proto.Message.ListMessage.ProductListHeaderImage.toObject(m.headerImage, o); + if (o.oneofs) + d._headerImage = "headerImage"; + } + if (m.businessOwnerJid != null && m.hasOwnProperty("businessOwnerJid")) { + d.businessOwnerJid = m.businessOwnerJid; + if (o.oneofs) + d._businessOwnerJid = "businessOwnerJid"; + } + return d; + }; + + ProductListInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProductListInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19270,9 +43536,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ProductSection.prototype.title = ""; + ProductSection.prototype.title = null; ProductSection.prototype.products = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSection.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + ProductSection.create = function create(properties) { return new ProductSection(properties); }; @@ -19316,6 +43590,51 @@ export const proto = $root.proto = (() => { return m; }; + ProductSection.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage.ProductSection) + return d; + var m = new $root.proto.Message.ListMessage.ProductSection(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.products) { + if (!Array.isArray(d.products)) + throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected"); + m.products = []; + for (var i = 0; i < d.products.length; ++i) { + if (typeof d.products[i] !== "object") + throw TypeError(".proto.Message.ListMessage.ProductSection.products: object expected"); + m.products[i] = $root.proto.Message.ListMessage.Product.fromObject(d.products[i]); + } + } + return m; + }; + + ProductSection.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.products = []; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.products && m.products.length) { + d.products = []; + for (var j = 0; j < m.products.length; ++j) { + d.products[j] = $root.proto.Message.ListMessage.Product.toObject(m.products[j], o); + } + } + return d; + }; + + ProductSection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProductSection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19335,9 +43654,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Row.prototype.title = ""; - Row.prototype.description = ""; - Row.prototype.rowId = ""; + Row.prototype.title = null; + Row.prototype.description = null; + Row.prototype.rowId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Row.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Row.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Row.prototype, "_rowId", { + get: $util.oneOfGetter($oneOfFields = ["rowId"]), + set: $util.oneOfSetter($oneOfFields) + }); Row.create = function create(properties) { return new Row(properties); @@ -19384,6 +43723,48 @@ export const proto = $root.proto = (() => { return m; }; + Row.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage.Row) + return d; + var m = new $root.proto.Message.ListMessage.Row(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.rowId != null) { + m.rowId = String(d.rowId); + } + return m; + }; + + Row.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.rowId != null && m.hasOwnProperty("rowId")) { + d.rowId = m.rowId; + if (o.oneofs) + d._rowId = "rowId"; + } + return d; + }; + + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19404,9 +43785,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Section.prototype.title = ""; + Section.prototype.title = null; Section.prototype.rows = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Section.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + Section.create = function create(properties) { return new Section(properties); }; @@ -19450,6 +43839,51 @@ export const proto = $root.proto = (() => { return m; }; + Section.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListMessage.Section) + return d; + var m = new $root.proto.Message.ListMessage.Section(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.rows) { + if (!Array.isArray(d.rows)) + throw TypeError(".proto.Message.ListMessage.Section.rows: array expected"); + m.rows = []; + for (var i = 0; i < d.rows.length; ++i) { + if (typeof d.rows[i] !== "object") + throw TypeError(".proto.Message.ListMessage.Section.rows: object expected"); + m.rows[i] = $root.proto.Message.ListMessage.Row.fromObject(d.rows[i]); + } + } + return m; + }; + + Section.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.rows = []; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.rows && m.rows.length) { + d.rows = []; + for (var j = 0; j < m.rows.length; ++j) { + d.rows[j] = $root.proto.Message.ListMessage.Row.toObject(m.rows[j], o); + } + } + return d; + }; + + Section.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Section.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19472,11 +43906,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ListResponseMessage.prototype.title = ""; - ListResponseMessage.prototype.listType = 0; + ListResponseMessage.prototype.title = null; + ListResponseMessage.prototype.listType = null; ListResponseMessage.prototype.singleSelectReply = null; ListResponseMessage.prototype.contextInfo = null; - ListResponseMessage.prototype.description = ""; + ListResponseMessage.prototype.description = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListResponseMessage.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListResponseMessage.prototype, "_listType", { + get: $util.oneOfGetter($oneOfFields = ["listType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListResponseMessage.prototype, "_singleSelectReply", { + get: $util.oneOfGetter($oneOfFields = ["singleSelectReply"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListResponseMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListResponseMessage.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); ListResponseMessage.create = function create(properties) { return new ListResponseMessage(properties); @@ -19535,6 +44001,81 @@ export const proto = $root.proto = (() => { return m; }; + ListResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListResponseMessage) + return d; + var m = new $root.proto.Message.ListResponseMessage(); + if (d.title != null) { + m.title = String(d.title); + } + switch (d.listType) { + default: + if (typeof d.listType === "number") { + m.listType = d.listType; + break; + } + break; + case "UNKNOWN": + case 0: + m.listType = 0; + break; + case "SINGLE_SELECT": + case 1: + m.listType = 1; + break; + } + if (d.singleSelectReply != null) { + if (typeof d.singleSelectReply !== "object") + throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected"); + m.singleSelectReply = $root.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(d.singleSelectReply); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.description != null) { + m.description = String(d.description); + } + return m; + }; + + ListResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.listType != null && m.hasOwnProperty("listType")) { + d.listType = o.enums === String ? $root.proto.Message.ListResponseMessage.ListType[m.listType] === undefined ? m.listType : $root.proto.Message.ListResponseMessage.ListType[m.listType] : m.listType; + if (o.oneofs) + d._listType = "listType"; + } + if (m.singleSelectReply != null && m.hasOwnProperty("singleSelectReply")) { + d.singleSelectReply = $root.proto.Message.ListResponseMessage.SingleSelectReply.toObject(m.singleSelectReply, o); + if (o.oneofs) + d._singleSelectReply = "singleSelectReply"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + return d; + }; + + ListResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ListResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19558,7 +44099,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SingleSelectReply.prototype.selectedRowId = ""; + SingleSelectReply.prototype.selectedRowId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SingleSelectReply.prototype, "_selectedRowId", { + get: $util.oneOfGetter($oneOfFields = ["selectedRowId"]), + set: $util.oneOfSetter($oneOfFields) + }); SingleSelectReply.create = function create(properties) { return new SingleSelectReply(properties); @@ -19593,6 +44142,32 @@ export const proto = $root.proto = (() => { return m; }; + SingleSelectReply.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ListResponseMessage.SingleSelectReply) + return d; + var m = new $root.proto.Message.ListResponseMessage.SingleSelectReply(); + if (d.selectedRowId != null) { + m.selectedRowId = String(d.selectedRowId); + } + return m; + }; + + SingleSelectReply.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.selectedRowId != null && m.hasOwnProperty("selectedRowId")) { + d.selectedRowId = m.selectedRowId; + if (o.oneofs) + d._selectedRowId = "selectedRowId"; + } + return d; + }; + + SingleSelectReply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SingleSelectReply.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19615,17 +44190,79 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LiveLocationMessage.prototype.degreesLatitude = 0; - LiveLocationMessage.prototype.degreesLongitude = 0; - LiveLocationMessage.prototype.accuracyInMeters = 0; - LiveLocationMessage.prototype.speedInMps = 0; - LiveLocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; - LiveLocationMessage.prototype.caption = ""; - LiveLocationMessage.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - LiveLocationMessage.prototype.timeOffset = 0; - LiveLocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + LiveLocationMessage.prototype.degreesLatitude = null; + LiveLocationMessage.prototype.degreesLongitude = null; + LiveLocationMessage.prototype.accuracyInMeters = null; + LiveLocationMessage.prototype.speedInMps = null; + LiveLocationMessage.prototype.degreesClockwiseFromMagneticNorth = null; + LiveLocationMessage.prototype.caption = null; + LiveLocationMessage.prototype.sequenceNumber = null; + LiveLocationMessage.prototype.timeOffset = null; + LiveLocationMessage.prototype.jpegThumbnail = null; LiveLocationMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_degreesLatitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_degreesLongitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_accuracyInMeters", { + get: $util.oneOfGetter($oneOfFields = ["accuracyInMeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_speedInMps", { + get: $util.oneOfGetter($oneOfFields = ["speedInMps"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_degreesClockwiseFromMagneticNorth", { + get: $util.oneOfGetter($oneOfFields = ["degreesClockwiseFromMagneticNorth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_sequenceNumber", { + get: $util.oneOfGetter($oneOfFields = ["sequenceNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["timeOffset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LiveLocationMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + LiveLocationMessage.create = function create(properties) { return new LiveLocationMessage(properties); }; @@ -19713,6 +44350,119 @@ export const proto = $root.proto = (() => { return m; }; + LiveLocationMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.LiveLocationMessage) + return d; + var m = new $root.proto.Message.LiveLocationMessage(); + if (d.degreesLatitude != null) { + m.degreesLatitude = Number(d.degreesLatitude); + } + if (d.degreesLongitude != null) { + m.degreesLongitude = Number(d.degreesLongitude); + } + if (d.accuracyInMeters != null) { + m.accuracyInMeters = d.accuracyInMeters >>> 0; + } + if (d.speedInMps != null) { + m.speedInMps = Number(d.speedInMps); + } + if (d.degreesClockwiseFromMagneticNorth != null) { + m.degreesClockwiseFromMagneticNorth = d.degreesClockwiseFromMagneticNorth >>> 0; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.sequenceNumber != null) { + if ($util.Long) + (m.sequenceNumber = $util.Long.fromValue(d.sequenceNumber)).unsigned = false; + else if (typeof d.sequenceNumber === "string") + m.sequenceNumber = parseInt(d.sequenceNumber, 10); + else if (typeof d.sequenceNumber === "number") + m.sequenceNumber = d.sequenceNumber; + else if (typeof d.sequenceNumber === "object") + m.sequenceNumber = new $util.LongBits(d.sequenceNumber.low >>> 0, d.sequenceNumber.high >>> 0).toNumber(); + } + if (d.timeOffset != null) { + m.timeOffset = d.timeOffset >>> 0; + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + LiveLocationMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) { + d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude; + if (o.oneofs) + d._degreesLatitude = "degreesLatitude"; + } + if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) { + d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude; + if (o.oneofs) + d._degreesLongitude = "degreesLongitude"; + } + if (m.accuracyInMeters != null && m.hasOwnProperty("accuracyInMeters")) { + d.accuracyInMeters = m.accuracyInMeters; + if (o.oneofs) + d._accuracyInMeters = "accuracyInMeters"; + } + if (m.speedInMps != null && m.hasOwnProperty("speedInMps")) { + d.speedInMps = o.json && !isFinite(m.speedInMps) ? String(m.speedInMps) : m.speedInMps; + if (o.oneofs) + d._speedInMps = "speedInMps"; + } + if (m.degreesClockwiseFromMagneticNorth != null && m.hasOwnProperty("degreesClockwiseFromMagneticNorth")) { + d.degreesClockwiseFromMagneticNorth = m.degreesClockwiseFromMagneticNorth; + if (o.oneofs) + d._degreesClockwiseFromMagneticNorth = "degreesClockwiseFromMagneticNorth"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.sequenceNumber != null && m.hasOwnProperty("sequenceNumber")) { + if (typeof m.sequenceNumber === "number") + d.sequenceNumber = o.longs === String ? String(m.sequenceNumber) : m.sequenceNumber; + else + d.sequenceNumber = o.longs === String ? $util.Long.prototype.toString.call(m.sequenceNumber) : o.longs === Number ? new $util.LongBits(m.sequenceNumber.low >>> 0, m.sequenceNumber.high >>> 0).toNumber() : m.sequenceNumber; + if (o.oneofs) + d._sequenceNumber = "sequenceNumber"; + } + if (m.timeOffset != null && m.hasOwnProperty("timeOffset")) { + d.timeOffset = m.timeOffset; + if (o.oneofs) + d._timeOffset = "timeOffset"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + LiveLocationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LiveLocationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19732,19 +44482,93 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LocationMessage.prototype.degreesLatitude = 0; - LocationMessage.prototype.degreesLongitude = 0; - LocationMessage.prototype.name = ""; - LocationMessage.prototype.address = ""; - LocationMessage.prototype.url = ""; - LocationMessage.prototype.isLive = false; - LocationMessage.prototype.accuracyInMeters = 0; - LocationMessage.prototype.speedInMps = 0; - LocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; - LocationMessage.prototype.comment = ""; - LocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + LocationMessage.prototype.degreesLatitude = null; + LocationMessage.prototype.degreesLongitude = null; + LocationMessage.prototype.name = null; + LocationMessage.prototype.address = null; + LocationMessage.prototype.url = null; + LocationMessage.prototype.isLive = null; + LocationMessage.prototype.accuracyInMeters = null; + LocationMessage.prototype.speedInMps = null; + LocationMessage.prototype.degreesClockwiseFromMagneticNorth = null; + LocationMessage.prototype.comment = null; + LocationMessage.prototype.jpegThumbnail = null; LocationMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_degreesLatitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_degreesLongitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_isLive", { + get: $util.oneOfGetter($oneOfFields = ["isLive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_accuracyInMeters", { + get: $util.oneOfGetter($oneOfFields = ["accuracyInMeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_speedInMps", { + get: $util.oneOfGetter($oneOfFields = ["speedInMps"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_degreesClockwiseFromMagneticNorth", { + get: $util.oneOfGetter($oneOfFields = ["degreesClockwiseFromMagneticNorth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_comment", { + get: $util.oneOfGetter($oneOfFields = ["comment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocationMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + LocationMessage.create = function create(properties) { return new LocationMessage(properties); }; @@ -19844,6 +44668,125 @@ export const proto = $root.proto = (() => { return m; }; + LocationMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.LocationMessage) + return d; + var m = new $root.proto.Message.LocationMessage(); + if (d.degreesLatitude != null) { + m.degreesLatitude = Number(d.degreesLatitude); + } + if (d.degreesLongitude != null) { + m.degreesLongitude = Number(d.degreesLongitude); + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.address != null) { + m.address = String(d.address); + } + if (d.url != null) { + m.url = String(d.url); + } + if (d.isLive != null) { + m.isLive = Boolean(d.isLive); + } + if (d.accuracyInMeters != null) { + m.accuracyInMeters = d.accuracyInMeters >>> 0; + } + if (d.speedInMps != null) { + m.speedInMps = Number(d.speedInMps); + } + if (d.degreesClockwiseFromMagneticNorth != null) { + m.degreesClockwiseFromMagneticNorth = d.degreesClockwiseFromMagneticNorth >>> 0; + } + if (d.comment != null) { + m.comment = String(d.comment); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + LocationMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) { + d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude; + if (o.oneofs) + d._degreesLatitude = "degreesLatitude"; + } + if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) { + d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude; + if (o.oneofs) + d._degreesLongitude = "degreesLongitude"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.address != null && m.hasOwnProperty("address")) { + d.address = m.address; + if (o.oneofs) + d._address = "address"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.isLive != null && m.hasOwnProperty("isLive")) { + d.isLive = m.isLive; + if (o.oneofs) + d._isLive = "isLive"; + } + if (m.accuracyInMeters != null && m.hasOwnProperty("accuracyInMeters")) { + d.accuracyInMeters = m.accuracyInMeters; + if (o.oneofs) + d._accuracyInMeters = "accuracyInMeters"; + } + if (m.speedInMps != null && m.hasOwnProperty("speedInMps")) { + d.speedInMps = o.json && !isFinite(m.speedInMps) ? String(m.speedInMps) : m.speedInMps; + if (o.oneofs) + d._speedInMps = "speedInMps"; + } + if (m.degreesClockwiseFromMagneticNorth != null && m.hasOwnProperty("degreesClockwiseFromMagneticNorth")) { + d.degreesClockwiseFromMagneticNorth = m.degreesClockwiseFromMagneticNorth; + if (o.oneofs) + d._degreesClockwiseFromMagneticNorth = "degreesClockwiseFromMagneticNorth"; + } + if (m.comment != null && m.hasOwnProperty("comment")) { + d.comment = m.comment; + if (o.oneofs) + d._comment = "comment"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + LocationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LocationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19863,13 +44806,57 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MMSThumbnailMetadata.prototype.thumbnailDirectPath = ""; - MMSThumbnailMetadata.prototype.thumbnailSha256 = $util.newBuffer([]); - MMSThumbnailMetadata.prototype.thumbnailEncSha256 = $util.newBuffer([]); - MMSThumbnailMetadata.prototype.mediaKey = $util.newBuffer([]); - MMSThumbnailMetadata.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MMSThumbnailMetadata.prototype.thumbnailHeight = 0; - MMSThumbnailMetadata.prototype.thumbnailWidth = 0; + MMSThumbnailMetadata.prototype.thumbnailDirectPath = null; + MMSThumbnailMetadata.prototype.thumbnailSha256 = null; + MMSThumbnailMetadata.prototype.thumbnailEncSha256 = null; + MMSThumbnailMetadata.prototype.mediaKey = null; + MMSThumbnailMetadata.prototype.mediaKeyTimestamp = null; + MMSThumbnailMetadata.prototype.thumbnailHeight = null; + MMSThumbnailMetadata.prototype.thumbnailWidth = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailHeight", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MMSThumbnailMetadata.prototype, "_thumbnailWidth", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]), + set: $util.oneOfSetter($oneOfFields) + }); MMSThumbnailMetadata.create = function create(properties) { return new MMSThumbnailMetadata(properties); @@ -19940,6 +44927,99 @@ export const proto = $root.proto = (() => { return m; }; + MMSThumbnailMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.MMSThumbnailMetadata) + return d; + var m = new $root.proto.Message.MMSThumbnailMetadata(); + if (d.thumbnailDirectPath != null) { + m.thumbnailDirectPath = String(d.thumbnailDirectPath); + } + if (d.thumbnailSha256 != null) { + if (typeof d.thumbnailSha256 === "string") + $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0); + else if (d.thumbnailSha256.length >= 0) + m.thumbnailSha256 = d.thumbnailSha256; + } + if (d.thumbnailEncSha256 != null) { + if (typeof d.thumbnailEncSha256 === "string") + $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0); + else if (d.thumbnailEncSha256.length >= 0) + m.thumbnailEncSha256 = d.thumbnailEncSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.thumbnailHeight != null) { + m.thumbnailHeight = d.thumbnailHeight >>> 0; + } + if (d.thumbnailWidth != null) { + m.thumbnailWidth = d.thumbnailWidth >>> 0; + } + return m; + }; + + MMSThumbnailMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) { + d.thumbnailDirectPath = m.thumbnailDirectPath; + if (o.oneofs) + d._thumbnailDirectPath = "thumbnailDirectPath"; + } + if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) { + d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256; + if (o.oneofs) + d._thumbnailSha256 = "thumbnailSha256"; + } + if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) { + d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256; + if (o.oneofs) + d._thumbnailEncSha256 = "thumbnailEncSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) { + d.thumbnailHeight = m.thumbnailHeight; + if (o.oneofs) + d._thumbnailHeight = "thumbnailHeight"; + } + if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) { + d.thumbnailWidth = m.thumbnailWidth; + if (o.oneofs) + d._thumbnailWidth = "thumbnailWidth"; + } + return d; + }; + + MMSThumbnailMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MMSThumbnailMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -19959,15 +45039,65 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageHistoryBundle.prototype.mimetype = ""; - MessageHistoryBundle.prototype.fileSha256 = $util.newBuffer([]); - MessageHistoryBundle.prototype.mediaKey = $util.newBuffer([]); - MessageHistoryBundle.prototype.fileEncSha256 = $util.newBuffer([]); - MessageHistoryBundle.prototype.directPath = ""; - MessageHistoryBundle.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MessageHistoryBundle.prototype.mimetype = null; + MessageHistoryBundle.prototype.fileSha256 = null; + MessageHistoryBundle.prototype.mediaKey = null; + MessageHistoryBundle.prototype.fileEncSha256 = null; + MessageHistoryBundle.prototype.directPath = null; + MessageHistoryBundle.prototype.mediaKeyTimestamp = null; MessageHistoryBundle.prototype.contextInfo = null; MessageHistoryBundle.prototype.messageHistoryMetadata = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryBundle.prototype, "_messageHistoryMetadata", { + get: $util.oneOfGetter($oneOfFields = ["messageHistoryMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + MessageHistoryBundle.create = function create(properties) { return new MessageHistoryBundle(properties); }; @@ -20043,6 +45173,111 @@ export const proto = $root.proto = (() => { return m; }; + MessageHistoryBundle.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.MessageHistoryBundle) + return d; + var m = new $root.proto.Message.MessageHistoryBundle(); + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.messageHistoryMetadata != null) { + if (typeof d.messageHistoryMetadata !== "object") + throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected"); + m.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.fromObject(d.messageHistoryMetadata); + } + return m; + }; + + MessageHistoryBundle.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.messageHistoryMetadata != null && m.hasOwnProperty("messageHistoryMetadata")) { + d.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.toObject(m.messageHistoryMetadata, o); + if (o.oneofs) + d._messageHistoryMetadata = "messageHistoryMetadata"; + } + return d; + }; + + MessageHistoryBundle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageHistoryBundle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20064,8 +45299,22 @@ export const proto = $root.proto = (() => { } MessageHistoryMetadata.prototype.historyReceivers = $util.emptyArray; - MessageHistoryMetadata.prototype.firstMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MessageHistoryMetadata.prototype.messageCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MessageHistoryMetadata.prototype.firstMessageTimestamp = null; + MessageHistoryMetadata.prototype.messageCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryMetadata.prototype, "_firstMessageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["firstMessageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryMetadata.prototype, "_messageCount", { + get: $util.oneOfGetter($oneOfFields = ["messageCount"]), + set: $util.oneOfSetter($oneOfFields) + }); MessageHistoryMetadata.create = function create(properties) { return new MessageHistoryMetadata(properties); @@ -20116,6 +45365,77 @@ export const proto = $root.proto = (() => { return m; }; + MessageHistoryMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.MessageHistoryMetadata) + return d; + var m = new $root.proto.Message.MessageHistoryMetadata(); + if (d.historyReceivers) { + if (!Array.isArray(d.historyReceivers)) + throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected"); + m.historyReceivers = []; + for (var i = 0; i < d.historyReceivers.length; ++i) { + m.historyReceivers[i] = String(d.historyReceivers[i]); + } + } + if (d.firstMessageTimestamp != null) { + if ($util.Long) + (m.firstMessageTimestamp = $util.Long.fromValue(d.firstMessageTimestamp)).unsigned = false; + else if (typeof d.firstMessageTimestamp === "string") + m.firstMessageTimestamp = parseInt(d.firstMessageTimestamp, 10); + else if (typeof d.firstMessageTimestamp === "number") + m.firstMessageTimestamp = d.firstMessageTimestamp; + else if (typeof d.firstMessageTimestamp === "object") + m.firstMessageTimestamp = new $util.LongBits(d.firstMessageTimestamp.low >>> 0, d.firstMessageTimestamp.high >>> 0).toNumber(); + } + if (d.messageCount != null) { + if ($util.Long) + (m.messageCount = $util.Long.fromValue(d.messageCount)).unsigned = false; + else if (typeof d.messageCount === "string") + m.messageCount = parseInt(d.messageCount, 10); + else if (typeof d.messageCount === "number") + m.messageCount = d.messageCount; + else if (typeof d.messageCount === "object") + m.messageCount = new $util.LongBits(d.messageCount.low >>> 0, d.messageCount.high >>> 0).toNumber(); + } + return m; + }; + + MessageHistoryMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.historyReceivers = []; + } + if (m.historyReceivers && m.historyReceivers.length) { + d.historyReceivers = []; + for (var j = 0; j < m.historyReceivers.length; ++j) { + d.historyReceivers[j] = m.historyReceivers[j]; + } + } + if (m.firstMessageTimestamp != null && m.hasOwnProperty("firstMessageTimestamp")) { + if (typeof m.firstMessageTimestamp === "number") + d.firstMessageTimestamp = o.longs === String ? String(m.firstMessageTimestamp) : m.firstMessageTimestamp; + else + d.firstMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.firstMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.firstMessageTimestamp.low >>> 0, m.firstMessageTimestamp.high >>> 0).toNumber() : m.firstMessageTimestamp; + if (o.oneofs) + d._firstMessageTimestamp = "firstMessageTimestamp"; + } + if (m.messageCount != null && m.hasOwnProperty("messageCount")) { + if (typeof m.messageCount === "number") + d.messageCount = o.longs === String ? String(m.messageCount) : m.messageCount; + else + d.messageCount = o.longs === String ? $util.Long.prototype.toString.call(m.messageCount) : o.longs === Number ? new $util.LongBits(m.messageCount.low >>> 0, m.messageCount.high >>> 0).toNumber() : m.messageCount; + if (o.oneofs) + d._messageCount = "messageCount"; + } + return d; + }; + + MessageHistoryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageHistoryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20138,6 +45458,20 @@ export const proto = $root.proto = (() => { MessageHistoryNotice.prototype.contextInfo = null; MessageHistoryNotice.prototype.messageHistoryMetadata = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryNotice.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageHistoryNotice.prototype, "_messageHistoryMetadata", { + get: $util.oneOfGetter($oneOfFields = ["messageHistoryMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + MessageHistoryNotice.create = function create(properties) { return new MessageHistoryNotice(properties); }; @@ -20177,6 +45511,44 @@ export const proto = $root.proto = (() => { return m; }; + MessageHistoryNotice.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.MessageHistoryNotice) + return d; + var m = new $root.proto.Message.MessageHistoryNotice(); + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.messageHistoryMetadata != null) { + if (typeof d.messageHistoryMetadata !== "object") + throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected"); + m.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.fromObject(d.messageHistoryMetadata); + } + return m; + }; + + MessageHistoryNotice.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.messageHistoryMetadata != null && m.hasOwnProperty("messageHistoryMetadata")) { + d.messageHistoryMetadata = $root.proto.Message.MessageHistoryMetadata.toObject(m.messageHistoryMetadata, o); + if (o.oneofs) + d._messageHistoryMetadata = "messageHistoryMetadata"; + } + return d; + }; + + MessageHistoryNotice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageHistoryNotice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20196,13 +45568,51 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NewsletterAdminInviteMessage.prototype.newsletterJid = ""; - NewsletterAdminInviteMessage.prototype.newsletterName = ""; - NewsletterAdminInviteMessage.prototype.jpegThumbnail = $util.newBuffer([]); - NewsletterAdminInviteMessage.prototype.caption = ""; - NewsletterAdminInviteMessage.prototype.inviteExpiration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + NewsletterAdminInviteMessage.prototype.newsletterJid = null; + NewsletterAdminInviteMessage.prototype.newsletterName = null; + NewsletterAdminInviteMessage.prototype.jpegThumbnail = null; + NewsletterAdminInviteMessage.prototype.caption = null; + NewsletterAdminInviteMessage.prototype.inviteExpiration = null; NewsletterAdminInviteMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_newsletterJid", { + get: $util.oneOfGetter($oneOfFields = ["newsletterJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_newsletterName", { + get: $util.oneOfGetter($oneOfFields = ["newsletterName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_inviteExpiration", { + get: $util.oneOfGetter($oneOfFields = ["inviteExpiration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NewsletterAdminInviteMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + NewsletterAdminInviteMessage.create = function create(properties) { return new NewsletterAdminInviteMessage(properties); }; @@ -20266,6 +45676,87 @@ export const proto = $root.proto = (() => { return m; }; + NewsletterAdminInviteMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.NewsletterAdminInviteMessage) + return d; + var m = new $root.proto.Message.NewsletterAdminInviteMessage(); + if (d.newsletterJid != null) { + m.newsletterJid = String(d.newsletterJid); + } + if (d.newsletterName != null) { + m.newsletterName = String(d.newsletterName); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.inviteExpiration != null) { + if ($util.Long) + (m.inviteExpiration = $util.Long.fromValue(d.inviteExpiration)).unsigned = false; + else if (typeof d.inviteExpiration === "string") + m.inviteExpiration = parseInt(d.inviteExpiration, 10); + else if (typeof d.inviteExpiration === "number") + m.inviteExpiration = d.inviteExpiration; + else if (typeof d.inviteExpiration === "object") + m.inviteExpiration = new $util.LongBits(d.inviteExpiration.low >>> 0, d.inviteExpiration.high >>> 0).toNumber(); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + NewsletterAdminInviteMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.newsletterJid != null && m.hasOwnProperty("newsletterJid")) { + d.newsletterJid = m.newsletterJid; + if (o.oneofs) + d._newsletterJid = "newsletterJid"; + } + if (m.newsletterName != null && m.hasOwnProperty("newsletterName")) { + d.newsletterName = m.newsletterName; + if (o.oneofs) + d._newsletterName = "newsletterName"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.inviteExpiration != null && m.hasOwnProperty("inviteExpiration")) { + if (typeof m.inviteExpiration === "number") + d.inviteExpiration = o.longs === String ? String(m.inviteExpiration) : m.inviteExpiration; + else + d.inviteExpiration = o.longs === String ? $util.Long.prototype.toString.call(m.inviteExpiration) : o.longs === Number ? new $util.LongBits(m.inviteExpiration.low >>> 0, m.inviteExpiration.high >>> 0).toNumber() : m.inviteExpiration; + if (o.oneofs) + d._inviteExpiration = "inviteExpiration"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + NewsletterAdminInviteMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NewsletterAdminInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20285,21 +45776,113 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - OrderMessage.prototype.orderId = ""; - OrderMessage.prototype.thumbnail = $util.newBuffer([]); - OrderMessage.prototype.itemCount = 0; - OrderMessage.prototype.status = 1; - OrderMessage.prototype.surface = 1; - OrderMessage.prototype.message = ""; - OrderMessage.prototype.orderTitle = ""; - OrderMessage.prototype.sellerJid = ""; - OrderMessage.prototype.token = ""; - OrderMessage.prototype.totalAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - OrderMessage.prototype.totalCurrencyCode = ""; + OrderMessage.prototype.orderId = null; + OrderMessage.prototype.thumbnail = null; + OrderMessage.prototype.itemCount = null; + OrderMessage.prototype.status = null; + OrderMessage.prototype.surface = null; + OrderMessage.prototype.message = null; + OrderMessage.prototype.orderTitle = null; + OrderMessage.prototype.sellerJid = null; + OrderMessage.prototype.token = null; + OrderMessage.prototype.totalAmount1000 = null; + OrderMessage.prototype.totalCurrencyCode = null; OrderMessage.prototype.contextInfo = null; - OrderMessage.prototype.messageVersion = 0; + OrderMessage.prototype.messageVersion = null; OrderMessage.prototype.orderRequestMessageId = null; - OrderMessage.prototype.catalogType = ""; + OrderMessage.prototype.catalogType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_orderId", { + get: $util.oneOfGetter($oneOfFields = ["orderId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_thumbnail", { + get: $util.oneOfGetter($oneOfFields = ["thumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_itemCount", { + get: $util.oneOfGetter($oneOfFields = ["itemCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_surface", { + get: $util.oneOfGetter($oneOfFields = ["surface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_orderTitle", { + get: $util.oneOfGetter($oneOfFields = ["orderTitle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_sellerJid", { + get: $util.oneOfGetter($oneOfFields = ["sellerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_token", { + get: $util.oneOfGetter($oneOfFields = ["token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_totalAmount1000", { + get: $util.oneOfGetter($oneOfFields = ["totalAmount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_totalCurrencyCode", { + get: $util.oneOfGetter($oneOfFields = ["totalCurrencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_messageVersion", { + get: $util.oneOfGetter($oneOfFields = ["messageVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_orderRequestMessageId", { + get: $util.oneOfGetter($oneOfFields = ["orderRequestMessageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OrderMessage.prototype, "_catalogType", { + get: $util.oneOfGetter($oneOfFields = ["catalogType"]), + set: $util.oneOfSetter($oneOfFields) + }); OrderMessage.create = function create(properties) { return new OrderMessage(properties); @@ -20418,6 +46001,187 @@ export const proto = $root.proto = (() => { return m; }; + OrderMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.OrderMessage) + return d; + var m = new $root.proto.Message.OrderMessage(); + if (d.orderId != null) { + m.orderId = String(d.orderId); + } + if (d.thumbnail != null) { + if (typeof d.thumbnail === "string") + $util.base64.decode(d.thumbnail, m.thumbnail = $util.newBuffer($util.base64.length(d.thumbnail)), 0); + else if (d.thumbnail.length >= 0) + m.thumbnail = d.thumbnail; + } + if (d.itemCount != null) { + m.itemCount = d.itemCount | 0; + } + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "INQUIRY": + case 1: + m.status = 1; + break; + case "ACCEPTED": + case 2: + m.status = 2; + break; + case "DECLINED": + case 3: + m.status = 3; + break; + } + switch (d.surface) { + default: + if (typeof d.surface === "number") { + m.surface = d.surface; + break; + } + break; + case "CATALOG": + case 1: + m.surface = 1; + break; + } + if (d.message != null) { + m.message = String(d.message); + } + if (d.orderTitle != null) { + m.orderTitle = String(d.orderTitle); + } + if (d.sellerJid != null) { + m.sellerJid = String(d.sellerJid); + } + if (d.token != null) { + m.token = String(d.token); + } + if (d.totalAmount1000 != null) { + if ($util.Long) + (m.totalAmount1000 = $util.Long.fromValue(d.totalAmount1000)).unsigned = false; + else if (typeof d.totalAmount1000 === "string") + m.totalAmount1000 = parseInt(d.totalAmount1000, 10); + else if (typeof d.totalAmount1000 === "number") + m.totalAmount1000 = d.totalAmount1000; + else if (typeof d.totalAmount1000 === "object") + m.totalAmount1000 = new $util.LongBits(d.totalAmount1000.low >>> 0, d.totalAmount1000.high >>> 0).toNumber(); + } + if (d.totalCurrencyCode != null) { + m.totalCurrencyCode = String(d.totalCurrencyCode); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.messageVersion != null) { + m.messageVersion = d.messageVersion | 0; + } + if (d.orderRequestMessageId != null) { + if (typeof d.orderRequestMessageId !== "object") + throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected"); + m.orderRequestMessageId = $root.proto.MessageKey.fromObject(d.orderRequestMessageId); + } + if (d.catalogType != null) { + m.catalogType = String(d.catalogType); + } + return m; + }; + + OrderMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.orderId != null && m.hasOwnProperty("orderId")) { + d.orderId = m.orderId; + if (o.oneofs) + d._orderId = "orderId"; + } + if (m.thumbnail != null && m.hasOwnProperty("thumbnail")) { + d.thumbnail = o.bytes === String ? $util.base64.encode(m.thumbnail, 0, m.thumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnail) : m.thumbnail; + if (o.oneofs) + d._thumbnail = "thumbnail"; + } + if (m.itemCount != null && m.hasOwnProperty("itemCount")) { + d.itemCount = m.itemCount; + if (o.oneofs) + d._itemCount = "itemCount"; + } + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.Message.OrderMessage.OrderStatus[m.status] === undefined ? m.status : $root.proto.Message.OrderMessage.OrderStatus[m.status] : m.status; + if (o.oneofs) + d._status = "status"; + } + if (m.surface != null && m.hasOwnProperty("surface")) { + d.surface = o.enums === String ? $root.proto.Message.OrderMessage.OrderSurface[m.surface] === undefined ? m.surface : $root.proto.Message.OrderMessage.OrderSurface[m.surface] : m.surface; + if (o.oneofs) + d._surface = "surface"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = m.message; + if (o.oneofs) + d._message = "message"; + } + if (m.orderTitle != null && m.hasOwnProperty("orderTitle")) { + d.orderTitle = m.orderTitle; + if (o.oneofs) + d._orderTitle = "orderTitle"; + } + if (m.sellerJid != null && m.hasOwnProperty("sellerJid")) { + d.sellerJid = m.sellerJid; + if (o.oneofs) + d._sellerJid = "sellerJid"; + } + if (m.token != null && m.hasOwnProperty("token")) { + d.token = m.token; + if (o.oneofs) + d._token = "token"; + } + if (m.totalAmount1000 != null && m.hasOwnProperty("totalAmount1000")) { + if (typeof m.totalAmount1000 === "number") + d.totalAmount1000 = o.longs === String ? String(m.totalAmount1000) : m.totalAmount1000; + else + d.totalAmount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.totalAmount1000) : o.longs === Number ? new $util.LongBits(m.totalAmount1000.low >>> 0, m.totalAmount1000.high >>> 0).toNumber() : m.totalAmount1000; + if (o.oneofs) + d._totalAmount1000 = "totalAmount1000"; + } + if (m.totalCurrencyCode != null && m.hasOwnProperty("totalCurrencyCode")) { + d.totalCurrencyCode = m.totalCurrencyCode; + if (o.oneofs) + d._totalCurrencyCode = "totalCurrencyCode"; + } + if (m.messageVersion != null && m.hasOwnProperty("messageVersion")) { + d.messageVersion = m.messageVersion; + if (o.oneofs) + d._messageVersion = "messageVersion"; + } + if (m.orderRequestMessageId != null && m.hasOwnProperty("orderRequestMessageId")) { + d.orderRequestMessageId = $root.proto.MessageKey.toObject(m.orderRequestMessageId, o); + if (o.oneofs) + d._orderRequestMessageId = "orderRequestMessageId"; + } + if (m.catalogType != null && m.hasOwnProperty("catalogType")) { + d.catalogType = m.catalogType; + if (o.oneofs) + d._catalogType = "catalogType"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + OrderMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + OrderMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20451,8 +46215,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PaymentInviteMessage.prototype.serviceType = 0; - PaymentInviteMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PaymentInviteMessage.prototype.serviceType = null; + PaymentInviteMessage.prototype.expiryTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInviteMessage.prototype, "_serviceType", { + get: $util.oneOfGetter($oneOfFields = ["serviceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInviteMessage.prototype, "_expiryTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["expiryTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); PaymentInviteMessage.create = function create(properties) { return new PaymentInviteMessage(properties); @@ -20493,6 +46271,71 @@ export const proto = $root.proto = (() => { return m; }; + PaymentInviteMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PaymentInviteMessage) + return d; + var m = new $root.proto.Message.PaymentInviteMessage(); + switch (d.serviceType) { + default: + if (typeof d.serviceType === "number") { + m.serviceType = d.serviceType; + break; + } + break; + case "UNKNOWN": + case 0: + m.serviceType = 0; + break; + case "FBPAY": + case 1: + m.serviceType = 1; + break; + case "NOVI": + case 2: + m.serviceType = 2; + break; + case "UPI": + case 3: + m.serviceType = 3; + break; + } + if (d.expiryTimestamp != null) { + if ($util.Long) + (m.expiryTimestamp = $util.Long.fromValue(d.expiryTimestamp)).unsigned = false; + else if (typeof d.expiryTimestamp === "string") + m.expiryTimestamp = parseInt(d.expiryTimestamp, 10); + else if (typeof d.expiryTimestamp === "number") + m.expiryTimestamp = d.expiryTimestamp; + else if (typeof d.expiryTimestamp === "object") + m.expiryTimestamp = new $util.LongBits(d.expiryTimestamp.low >>> 0, d.expiryTimestamp.high >>> 0).toNumber(); + } + return m; + }; + + PaymentInviteMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.serviceType != null && m.hasOwnProperty("serviceType")) { + d.serviceType = o.enums === String ? $root.proto.Message.PaymentInviteMessage.ServiceType[m.serviceType] === undefined ? m.serviceType : $root.proto.Message.PaymentInviteMessage.ServiceType[m.serviceType] : m.serviceType; + if (o.oneofs) + d._serviceType = "serviceType"; + } + if (m.expiryTimestamp != null && m.hasOwnProperty("expiryTimestamp")) { + if (typeof m.expiryTimestamp === "number") + d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp; + else + d.expiryTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expiryTimestamp) : o.longs === Number ? new $util.LongBits(m.expiryTimestamp.low >>> 0, m.expiryTimestamp.high >>> 0).toNumber() : m.expiryTimestamp; + if (o.oneofs) + d._expiryTimestamp = "expiryTimestamp"; + } + return d; + }; + + PaymentInviteMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentInviteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20524,6 +46367,20 @@ export const proto = $root.proto = (() => { PaymentLinkMetadata.prototype.button = null; PaymentLinkMetadata.prototype.header = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentLinkMetadata.prototype, "_button", { + get: $util.oneOfGetter($oneOfFields = ["button"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentLinkMetadata.prototype, "_header", { + get: $util.oneOfGetter($oneOfFields = ["header"]), + set: $util.oneOfSetter($oneOfFields) + }); + PaymentLinkMetadata.create = function create(properties) { return new PaymentLinkMetadata(properties); }; @@ -20563,6 +46420,44 @@ export const proto = $root.proto = (() => { return m; }; + PaymentLinkMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PaymentLinkMetadata) + return d; + var m = new $root.proto.Message.PaymentLinkMetadata(); + if (d.button != null) { + if (typeof d.button !== "object") + throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected"); + m.button = $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(d.button); + } + if (d.header != null) { + if (typeof d.header !== "object") + throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected"); + m.header = $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(d.header); + } + return m; + }; + + PaymentLinkMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.button != null && m.hasOwnProperty("button")) { + d.button = $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(m.button, o); + if (o.oneofs) + d._button = "button"; + } + if (m.header != null && m.hasOwnProperty("header")) { + d.header = $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(m.header, o); + if (o.oneofs) + d._header = "header"; + } + return d; + }; + + PaymentLinkMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentLinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20579,7 +46474,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PaymentLinkButton.prototype.displayText = ""; + PaymentLinkButton.prototype.displayText = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentLinkButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); PaymentLinkButton.create = function create(properties) { return new PaymentLinkButton(properties); @@ -20614,6 +46517,32 @@ export const proto = $root.proto = (() => { return m; }; + PaymentLinkButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton) + return d; + var m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkButton(); + if (d.displayText != null) { + m.displayText = String(d.displayText); + } + return m; + }; + + PaymentLinkButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = m.displayText; + if (o.oneofs) + d._displayText = "displayText"; + } + return d; + }; + + PaymentLinkButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentLinkButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20633,7 +46562,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PaymentLinkHeader.prototype.headerType = 0; + PaymentLinkHeader.prototype.headerType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentLinkHeader.prototype, "_headerType", { + get: $util.oneOfGetter($oneOfFields = ["headerType"]), + set: $util.oneOfSetter($oneOfFields) + }); PaymentLinkHeader.create = function create(properties) { return new PaymentLinkHeader(properties); @@ -20668,6 +46605,45 @@ export const proto = $root.proto = (() => { return m; }; + PaymentLinkHeader.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader) + return d; + var m = new $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader(); + switch (d.headerType) { + default: + if (typeof d.headerType === "number") { + m.headerType = d.headerType; + break; + } + break; + case "LINK_PREVIEW": + case 0: + m.headerType = 0; + break; + case "ORDER": + case 1: + m.headerType = 1; + break; + } + return m; + }; + + PaymentLinkHeader.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.headerType != null && m.hasOwnProperty("headerType")) { + d.headerType = o.enums === String ? $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[m.headerType] === undefined ? m.headerType : $root.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[m.headerType] : m.headerType; + if (o.oneofs) + d._headerType = "headerType"; + } + return d; + }; + + PaymentLinkHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentLinkHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20700,7 +46676,7 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PeerDataOperationRequestMessage.prototype.peerDataOperationRequestType = 0; + PeerDataOperationRequestMessage.prototype.peerDataOperationRequestType = null; PeerDataOperationRequestMessage.prototype.requestStickerReupload = $util.emptyArray; PeerDataOperationRequestMessage.prototype.requestUrlPreview = $util.emptyArray; PeerDataOperationRequestMessage.prototype.historySyncOnDemandRequest = null; @@ -20708,6 +46684,32 @@ export const proto = $root.proto = (() => { PeerDataOperationRequestMessage.prototype.fullHistorySyncOnDemandRequest = null; PeerDataOperationRequestMessage.prototype.syncdCollectionFatalRecoveryRequest = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_peerDataOperationRequestType", { + get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_historySyncOnDemandRequest", { + get: $util.oneOfGetter($oneOfFields = ["historySyncOnDemandRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_fullHistorySyncOnDemandRequest", { + get: $util.oneOfGetter($oneOfFields = ["fullHistorySyncOnDemandRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationRequestMessage.prototype, "_syncdCollectionFatalRecoveryRequest", { + get: $util.oneOfGetter($oneOfFields = ["syncdCollectionFatalRecoveryRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + PeerDataOperationRequestMessage.create = function create(properties) { return new PeerDataOperationRequestMessage(properties); }; @@ -20789,6 +46791,156 @@ export const proto = $root.proto = (() => { return m; }; + PeerDataOperationRequestMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage(); + switch (d.peerDataOperationRequestType) { + default: + if (typeof d.peerDataOperationRequestType === "number") { + m.peerDataOperationRequestType = d.peerDataOperationRequestType; + break; + } + break; + case "UPLOAD_STICKER": + case 0: + m.peerDataOperationRequestType = 0; + break; + case "SEND_RECENT_STICKER_BOOTSTRAP": + case 1: + m.peerDataOperationRequestType = 1; + break; + case "GENERATE_LINK_PREVIEW": + case 2: + m.peerDataOperationRequestType = 2; + break; + case "HISTORY_SYNC_ON_DEMAND": + case 3: + m.peerDataOperationRequestType = 3; + break; + case "PLACEHOLDER_MESSAGE_RESEND": + case 4: + m.peerDataOperationRequestType = 4; + break; + case "WAFFLE_LINKING_NONCE_FETCH": + case 5: + m.peerDataOperationRequestType = 5; + break; + case "FULL_HISTORY_SYNC_ON_DEMAND": + case 6: + m.peerDataOperationRequestType = 6; + break; + case "COMPANION_META_NONCE_FETCH": + case 7: + m.peerDataOperationRequestType = 7; + break; + case "COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY": + case 8: + m.peerDataOperationRequestType = 8; + break; + } + if (d.requestStickerReupload) { + if (!Array.isArray(d.requestStickerReupload)) + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected"); + m.requestStickerReupload = []; + for (var i = 0; i < d.requestStickerReupload.length; ++i) { + if (typeof d.requestStickerReupload[i] !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: object expected"); + m.requestStickerReupload[i] = $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.fromObject(d.requestStickerReupload[i]); + } + } + if (d.requestUrlPreview) { + if (!Array.isArray(d.requestUrlPreview)) + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestUrlPreview: array expected"); + m.requestUrlPreview = []; + for (var i = 0; i < d.requestUrlPreview.length; ++i) { + if (typeof d.requestUrlPreview[i] !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestUrlPreview: object expected"); + m.requestUrlPreview[i] = $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.fromObject(d.requestUrlPreview[i]); + } + } + if (d.historySyncOnDemandRequest != null) { + if (typeof d.historySyncOnDemandRequest !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.historySyncOnDemandRequest: object expected"); + m.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.fromObject(d.historySyncOnDemandRequest); + } + if (d.placeholderMessageResendRequest) { + if (!Array.isArray(d.placeholderMessageResendRequest)) + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.placeholderMessageResendRequest: array expected"); + m.placeholderMessageResendRequest = []; + for (var i = 0; i < d.placeholderMessageResendRequest.length; ++i) { + if (typeof d.placeholderMessageResendRequest[i] !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.placeholderMessageResendRequest: object expected"); + m.placeholderMessageResendRequest[i] = $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.fromObject(d.placeholderMessageResendRequest[i]); + } + } + if (d.fullHistorySyncOnDemandRequest != null) { + if (typeof d.fullHistorySyncOnDemandRequest !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.fullHistorySyncOnDemandRequest: object expected"); + m.fullHistorySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.fromObject(d.fullHistorySyncOnDemandRequest); + } + if (d.syncdCollectionFatalRecoveryRequest != null) { + if (typeof d.syncdCollectionFatalRecoveryRequest !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.syncdCollectionFatalRecoveryRequest: object expected"); + m.syncdCollectionFatalRecoveryRequest = $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.fromObject(d.syncdCollectionFatalRecoveryRequest); + } + return m; + }; + + PeerDataOperationRequestMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.requestStickerReupload = []; + d.requestUrlPreview = []; + d.placeholderMessageResendRequest = []; + } + if (m.peerDataOperationRequestType != null && m.hasOwnProperty("peerDataOperationRequestType")) { + d.peerDataOperationRequestType = o.enums === String ? $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] === undefined ? m.peerDataOperationRequestType : $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] : m.peerDataOperationRequestType; + if (o.oneofs) + d._peerDataOperationRequestType = "peerDataOperationRequestType"; + } + if (m.requestStickerReupload && m.requestStickerReupload.length) { + d.requestStickerReupload = []; + for (var j = 0; j < m.requestStickerReupload.length; ++j) { + d.requestStickerReupload[j] = $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.toObject(m.requestStickerReupload[j], o); + } + } + if (m.requestUrlPreview && m.requestUrlPreview.length) { + d.requestUrlPreview = []; + for (var j = 0; j < m.requestUrlPreview.length; ++j) { + d.requestUrlPreview[j] = $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.toObject(m.requestUrlPreview[j], o); + } + } + if (m.historySyncOnDemandRequest != null && m.hasOwnProperty("historySyncOnDemandRequest")) { + d.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.toObject(m.historySyncOnDemandRequest, o); + if (o.oneofs) + d._historySyncOnDemandRequest = "historySyncOnDemandRequest"; + } + if (m.placeholderMessageResendRequest && m.placeholderMessageResendRequest.length) { + d.placeholderMessageResendRequest = []; + for (var j = 0; j < m.placeholderMessageResendRequest.length; ++j) { + d.placeholderMessageResendRequest[j] = $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.toObject(m.placeholderMessageResendRequest[j], o); + } + } + if (m.fullHistorySyncOnDemandRequest != null && m.hasOwnProperty("fullHistorySyncOnDemandRequest")) { + d.fullHistorySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.toObject(m.fullHistorySyncOnDemandRequest, o); + if (o.oneofs) + d._fullHistorySyncOnDemandRequest = "fullHistorySyncOnDemandRequest"; + } + if (m.syncdCollectionFatalRecoveryRequest != null && m.hasOwnProperty("syncdCollectionFatalRecoveryRequest")) { + d.syncdCollectionFatalRecoveryRequest = $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.toObject(m.syncdCollectionFatalRecoveryRequest, o); + if (o.oneofs) + d._syncdCollectionFatalRecoveryRequest = "syncdCollectionFatalRecoveryRequest"; + } + return d; + }; + + PeerDataOperationRequestMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PeerDataOperationRequestMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20808,6 +46960,20 @@ export const proto = $root.proto = (() => { FullHistorySyncOnDemandRequest.prototype.requestMetadata = null; FullHistorySyncOnDemandRequest.prototype.historySyncConfig = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FullHistorySyncOnDemandRequest.prototype, "_requestMetadata", { + get: $util.oneOfGetter($oneOfFields = ["requestMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FullHistorySyncOnDemandRequest.prototype, "_historySyncConfig", { + get: $util.oneOfGetter($oneOfFields = ["historySyncConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + FullHistorySyncOnDemandRequest.create = function create(properties) { return new FullHistorySyncOnDemandRequest(properties); }; @@ -20847,6 +47013,44 @@ export const proto = $root.proto = (() => { return m; }; + FullHistorySyncOnDemandRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest(); + if (d.requestMetadata != null) { + if (typeof d.requestMetadata !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected"); + m.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(d.requestMetadata); + } + if (d.historySyncConfig != null) { + if (typeof d.historySyncConfig !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected"); + m.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.fromObject(d.historySyncConfig); + } + return m; + }; + + FullHistorySyncOnDemandRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.requestMetadata != null && m.hasOwnProperty("requestMetadata")) { + d.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(m.requestMetadata, o); + if (o.oneofs) + d._requestMetadata = "requestMetadata"; + } + if (m.historySyncConfig != null && m.hasOwnProperty("historySyncConfig")) { + d.historySyncConfig = $root.proto.DeviceProps.HistorySyncConfig.toObject(m.historySyncConfig, o); + if (o.oneofs) + d._historySyncConfig = "historySyncConfig"; + } + return d; + }; + + FullHistorySyncOnDemandRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FullHistorySyncOnDemandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20866,12 +47070,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HistorySyncOnDemandRequest.prototype.chatJid = ""; - HistorySyncOnDemandRequest.prototype.oldestMsgId = ""; - HistorySyncOnDemandRequest.prototype.oldestMsgFromMe = false; - HistorySyncOnDemandRequest.prototype.onDemandMsgCount = 0; - HistorySyncOnDemandRequest.prototype.oldestMsgTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - HistorySyncOnDemandRequest.prototype.accountLid = ""; + HistorySyncOnDemandRequest.prototype.chatJid = null; + HistorySyncOnDemandRequest.prototype.oldestMsgId = null; + HistorySyncOnDemandRequest.prototype.oldestMsgFromMe = null; + HistorySyncOnDemandRequest.prototype.onDemandMsgCount = null; + HistorySyncOnDemandRequest.prototype.oldestMsgTimestampMs = null; + HistorySyncOnDemandRequest.prototype.accountLid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_chatJid", { + get: $util.oneOfGetter($oneOfFields = ["chatJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_oldestMsgId", { + get: $util.oneOfGetter($oneOfFields = ["oldestMsgId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_oldestMsgFromMe", { + get: $util.oneOfGetter($oneOfFields = ["oldestMsgFromMe"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_onDemandMsgCount", { + get: $util.oneOfGetter($oneOfFields = ["onDemandMsgCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_oldestMsgTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["oldestMsgTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HistorySyncOnDemandRequest.prototype, "_accountLid", { + get: $util.oneOfGetter($oneOfFields = ["accountLid"]), + set: $util.oneOfSetter($oneOfFields) + }); HistorySyncOnDemandRequest.create = function create(properties) { return new HistorySyncOnDemandRequest(properties); @@ -20936,6 +47178,82 @@ export const proto = $root.proto = (() => { return m; }; + HistorySyncOnDemandRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest(); + if (d.chatJid != null) { + m.chatJid = String(d.chatJid); + } + if (d.oldestMsgId != null) { + m.oldestMsgId = String(d.oldestMsgId); + } + if (d.oldestMsgFromMe != null) { + m.oldestMsgFromMe = Boolean(d.oldestMsgFromMe); + } + if (d.onDemandMsgCount != null) { + m.onDemandMsgCount = d.onDemandMsgCount | 0; + } + if (d.oldestMsgTimestampMs != null) { + if ($util.Long) + (m.oldestMsgTimestampMs = $util.Long.fromValue(d.oldestMsgTimestampMs)).unsigned = false; + else if (typeof d.oldestMsgTimestampMs === "string") + m.oldestMsgTimestampMs = parseInt(d.oldestMsgTimestampMs, 10); + else if (typeof d.oldestMsgTimestampMs === "number") + m.oldestMsgTimestampMs = d.oldestMsgTimestampMs; + else if (typeof d.oldestMsgTimestampMs === "object") + m.oldestMsgTimestampMs = new $util.LongBits(d.oldestMsgTimestampMs.low >>> 0, d.oldestMsgTimestampMs.high >>> 0).toNumber(); + } + if (d.accountLid != null) { + m.accountLid = String(d.accountLid); + } + return m; + }; + + HistorySyncOnDemandRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.chatJid != null && m.hasOwnProperty("chatJid")) { + d.chatJid = m.chatJid; + if (o.oneofs) + d._chatJid = "chatJid"; + } + if (m.oldestMsgId != null && m.hasOwnProperty("oldestMsgId")) { + d.oldestMsgId = m.oldestMsgId; + if (o.oneofs) + d._oldestMsgId = "oldestMsgId"; + } + if (m.oldestMsgFromMe != null && m.hasOwnProperty("oldestMsgFromMe")) { + d.oldestMsgFromMe = m.oldestMsgFromMe; + if (o.oneofs) + d._oldestMsgFromMe = "oldestMsgFromMe"; + } + if (m.onDemandMsgCount != null && m.hasOwnProperty("onDemandMsgCount")) { + d.onDemandMsgCount = m.onDemandMsgCount; + if (o.oneofs) + d._onDemandMsgCount = "onDemandMsgCount"; + } + if (m.oldestMsgTimestampMs != null && m.hasOwnProperty("oldestMsgTimestampMs")) { + if (typeof m.oldestMsgTimestampMs === "number") + d.oldestMsgTimestampMs = o.longs === String ? String(m.oldestMsgTimestampMs) : m.oldestMsgTimestampMs; + else + d.oldestMsgTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.oldestMsgTimestampMs) : o.longs === Number ? new $util.LongBits(m.oldestMsgTimestampMs.low >>> 0, m.oldestMsgTimestampMs.high >>> 0).toNumber() : m.oldestMsgTimestampMs; + if (o.oneofs) + d._oldestMsgTimestampMs = "oldestMsgTimestampMs"; + } + if (m.accountLid != null && m.hasOwnProperty("accountLid")) { + d.accountLid = m.accountLid; + if (o.oneofs) + d._accountLid = "accountLid"; + } + return d; + }; + + HistorySyncOnDemandRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HistorySyncOnDemandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -20957,6 +47275,14 @@ export const proto = $root.proto = (() => { PlaceholderMessageResendRequest.prototype.messageKey = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PlaceholderMessageResendRequest.prototype, "_messageKey", { + get: $util.oneOfGetter($oneOfFields = ["messageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + PlaceholderMessageResendRequest.create = function create(properties) { return new PlaceholderMessageResendRequest(properties); }; @@ -20990,6 +47316,34 @@ export const proto = $root.proto = (() => { return m; }; + PlaceholderMessageResendRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest(); + if (d.messageKey != null) { + if (typeof d.messageKey !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected"); + m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey); + } + return m; + }; + + PlaceholderMessageResendRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageKey != null && m.hasOwnProperty("messageKey")) { + d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o); + if (o.oneofs) + d._messageKey = "messageKey"; + } + return d; + }; + + PlaceholderMessageResendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PlaceholderMessageResendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21009,7 +47363,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - RequestStickerReupload.prototype.fileSha256 = ""; + RequestStickerReupload.prototype.fileSha256 = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestStickerReupload.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); RequestStickerReupload.create = function create(properties) { return new RequestStickerReupload(properties); @@ -21044,6 +47406,32 @@ export const proto = $root.proto = (() => { return m; }; + RequestStickerReupload.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload(); + if (d.fileSha256 != null) { + m.fileSha256 = String(d.fileSha256); + } + return m; + }; + + RequestStickerReupload.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + return d; + }; + + RequestStickerReupload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RequestStickerReupload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21063,8 +47451,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - RequestUrlPreview.prototype.url = ""; - RequestUrlPreview.prototype.includeHqThumbnail = false; + RequestUrlPreview.prototype.url = null; + RequestUrlPreview.prototype.includeHqThumbnail = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestUrlPreview.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestUrlPreview.prototype, "_includeHqThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["includeHqThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); RequestUrlPreview.create = function create(properties) { return new RequestUrlPreview(properties); @@ -21105,6 +47507,40 @@ export const proto = $root.proto = (() => { return m; }; + RequestUrlPreview.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.includeHqThumbnail != null) { + m.includeHqThumbnail = Boolean(d.includeHqThumbnail); + } + return m; + }; + + RequestUrlPreview.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.includeHqThumbnail != null && m.hasOwnProperty("includeHqThumbnail")) { + d.includeHqThumbnail = m.includeHqThumbnail; + if (o.oneofs) + d._includeHqThumbnail = "includeHqThumbnail"; + } + return d; + }; + + RequestUrlPreview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RequestUrlPreview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21124,8 +47560,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncDCollectionFatalRecoveryRequest.prototype.collectionName = ""; - SyncDCollectionFatalRecoveryRequest.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SyncDCollectionFatalRecoveryRequest.prototype.collectionName = null; + SyncDCollectionFatalRecoveryRequest.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncDCollectionFatalRecoveryRequest.prototype, "_collectionName", { + get: $util.oneOfGetter($oneOfFields = ["collectionName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncDCollectionFatalRecoveryRequest.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncDCollectionFatalRecoveryRequest.create = function create(properties) { return new SyncDCollectionFatalRecoveryRequest(properties); @@ -21166,6 +47616,50 @@ export const proto = $root.proto = (() => { return m; }; + SyncDCollectionFatalRecoveryRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest(); + if (d.collectionName != null) { + m.collectionName = String(d.collectionName); + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + SyncDCollectionFatalRecoveryRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.collectionName != null && m.hasOwnProperty("collectionName")) { + d.collectionName = m.collectionName; + if (o.oneofs) + d._collectionName = "collectionName"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + SyncDCollectionFatalRecoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncDCollectionFatalRecoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21189,10 +47683,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PeerDataOperationRequestResponseMessage.prototype.peerDataOperationRequestType = 0; - PeerDataOperationRequestResponseMessage.prototype.stanzaId = ""; + PeerDataOperationRequestResponseMessage.prototype.peerDataOperationRequestType = null; + PeerDataOperationRequestResponseMessage.prototype.stanzaId = null; PeerDataOperationRequestResponseMessage.prototype.peerDataOperationResult = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationRequestResponseMessage.prototype, "_peerDataOperationRequestType", { + get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationRequestResponseMessage.prototype, "_stanzaId", { + get: $util.oneOfGetter($oneOfFields = ["stanzaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + PeerDataOperationRequestResponseMessage.create = function create(properties) { return new PeerDataOperationRequestResponseMessage(properties); }; @@ -21242,6 +47750,100 @@ export const proto = $root.proto = (() => { return m; }; + PeerDataOperationRequestResponseMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage(); + switch (d.peerDataOperationRequestType) { + default: + if (typeof d.peerDataOperationRequestType === "number") { + m.peerDataOperationRequestType = d.peerDataOperationRequestType; + break; + } + break; + case "UPLOAD_STICKER": + case 0: + m.peerDataOperationRequestType = 0; + break; + case "SEND_RECENT_STICKER_BOOTSTRAP": + case 1: + m.peerDataOperationRequestType = 1; + break; + case "GENERATE_LINK_PREVIEW": + case 2: + m.peerDataOperationRequestType = 2; + break; + case "HISTORY_SYNC_ON_DEMAND": + case 3: + m.peerDataOperationRequestType = 3; + break; + case "PLACEHOLDER_MESSAGE_RESEND": + case 4: + m.peerDataOperationRequestType = 4; + break; + case "WAFFLE_LINKING_NONCE_FETCH": + case 5: + m.peerDataOperationRequestType = 5; + break; + case "FULL_HISTORY_SYNC_ON_DEMAND": + case 6: + m.peerDataOperationRequestType = 6; + break; + case "COMPANION_META_NONCE_FETCH": + case 7: + m.peerDataOperationRequestType = 7; + break; + case "COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY": + case 8: + m.peerDataOperationRequestType = 8; + break; + } + if (d.stanzaId != null) { + m.stanzaId = String(d.stanzaId); + } + if (d.peerDataOperationResult) { + if (!Array.isArray(d.peerDataOperationResult)) + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected"); + m.peerDataOperationResult = []; + for (var i = 0; i < d.peerDataOperationResult.length; ++i) { + if (typeof d.peerDataOperationResult[i] !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: object expected"); + m.peerDataOperationResult[i] = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fromObject(d.peerDataOperationResult[i]); + } + } + return m; + }; + + PeerDataOperationRequestResponseMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.peerDataOperationResult = []; + } + if (m.peerDataOperationRequestType != null && m.hasOwnProperty("peerDataOperationRequestType")) { + d.peerDataOperationRequestType = o.enums === String ? $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] === undefined ? m.peerDataOperationRequestType : $root.proto.Message.PeerDataOperationRequestType[m.peerDataOperationRequestType] : m.peerDataOperationRequestType; + if (o.oneofs) + d._peerDataOperationRequestType = "peerDataOperationRequestType"; + } + if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) { + d.stanzaId = m.stanzaId; + if (o.oneofs) + d._stanzaId = "stanzaId"; + } + if (m.peerDataOperationResult && m.peerDataOperationResult.length) { + d.peerDataOperationResult = []; + for (var j = 0; j < m.peerDataOperationResult.length; ++j) { + d.peerDataOperationResult[j] = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.toObject(m.peerDataOperationResult[j], o); + } + } + return d; + }; + + PeerDataOperationRequestResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PeerDataOperationRequestResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21258,7 +47860,7 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PeerDataOperationResult.prototype.mediaUploadResult = 0; + PeerDataOperationResult.prototype.mediaUploadResult = null; PeerDataOperationResult.prototype.stickerMessage = null; PeerDataOperationResult.prototype.linkPreviewResponse = null; PeerDataOperationResult.prototype.placeholderMessageResendResponse = null; @@ -21267,6 +47869,56 @@ export const proto = $root.proto = (() => { PeerDataOperationResult.prototype.companionMetaNonceFetchRequestResponse = null; PeerDataOperationResult.prototype.syncdSnapshotFatalRecoveryResponse = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_mediaUploadResult", { + get: $util.oneOfGetter($oneOfFields = ["mediaUploadResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_stickerMessage", { + get: $util.oneOfGetter($oneOfFields = ["stickerMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_linkPreviewResponse", { + get: $util.oneOfGetter($oneOfFields = ["linkPreviewResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_placeholderMessageResendResponse", { + get: $util.oneOfGetter($oneOfFields = ["placeholderMessageResendResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_waffleNonceFetchRequestResponse", { + get: $util.oneOfGetter($oneOfFields = ["waffleNonceFetchRequestResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_fullHistorySyncOnDemandRequestResponse", { + get: $util.oneOfGetter($oneOfFields = ["fullHistorySyncOnDemandRequestResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_companionMetaNonceFetchRequestResponse", { + get: $util.oneOfGetter($oneOfFields = ["companionMetaNonceFetchRequestResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PeerDataOperationResult.prototype, "_syncdSnapshotFatalRecoveryResponse", { + get: $util.oneOfGetter($oneOfFields = ["syncdSnapshotFatalRecoveryResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + PeerDataOperationResult.create = function create(properties) { return new PeerDataOperationResult(properties); }; @@ -21342,6 +47994,123 @@ export const proto = $root.proto = (() => { return m; }; + PeerDataOperationResult.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult(); + switch (d.mediaUploadResult) { + default: + if (typeof d.mediaUploadResult === "number") { + m.mediaUploadResult = d.mediaUploadResult; + break; + } + break; + case "GENERAL_ERROR": + case 0: + m.mediaUploadResult = 0; + break; + case "SUCCESS": + case 1: + m.mediaUploadResult = 1; + break; + case "NOT_FOUND": + case 2: + m.mediaUploadResult = 2; + break; + case "DECRYPTION_ERROR": + case 3: + m.mediaUploadResult = 3; + break; + } + if (d.stickerMessage != null) { + if (typeof d.stickerMessage !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected"); + m.stickerMessage = $root.proto.Message.StickerMessage.fromObject(d.stickerMessage); + } + if (d.linkPreviewResponse != null) { + if (typeof d.linkPreviewResponse !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected"); + m.linkPreviewResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(d.linkPreviewResponse); + } + if (d.placeholderMessageResendResponse != null) { + if (typeof d.placeholderMessageResendResponse !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected"); + m.placeholderMessageResendResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(d.placeholderMessageResendResponse); + } + if (d.waffleNonceFetchRequestResponse != null) { + if (typeof d.waffleNonceFetchRequestResponse !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected"); + m.waffleNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(d.waffleNonceFetchRequestResponse); + } + if (d.fullHistorySyncOnDemandRequestResponse != null) { + if (typeof d.fullHistorySyncOnDemandRequestResponse !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected"); + m.fullHistorySyncOnDemandRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(d.fullHistorySyncOnDemandRequestResponse); + } + if (d.companionMetaNonceFetchRequestResponse != null) { + if (typeof d.companionMetaNonceFetchRequestResponse !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected"); + m.companionMetaNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(d.companionMetaNonceFetchRequestResponse); + } + if (d.syncdSnapshotFatalRecoveryResponse != null) { + if (typeof d.syncdSnapshotFatalRecoveryResponse !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected"); + m.syncdSnapshotFatalRecoveryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(d.syncdSnapshotFatalRecoveryResponse); + } + return m; + }; + + PeerDataOperationResult.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.mediaUploadResult != null && m.hasOwnProperty("mediaUploadResult")) { + d.mediaUploadResult = o.enums === String ? $root.proto.MediaRetryNotification.ResultType[m.mediaUploadResult] === undefined ? m.mediaUploadResult : $root.proto.MediaRetryNotification.ResultType[m.mediaUploadResult] : m.mediaUploadResult; + if (o.oneofs) + d._mediaUploadResult = "mediaUploadResult"; + } + if (m.stickerMessage != null && m.hasOwnProperty("stickerMessage")) { + d.stickerMessage = $root.proto.Message.StickerMessage.toObject(m.stickerMessage, o); + if (o.oneofs) + d._stickerMessage = "stickerMessage"; + } + if (m.linkPreviewResponse != null && m.hasOwnProperty("linkPreviewResponse")) { + d.linkPreviewResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(m.linkPreviewResponse, o); + if (o.oneofs) + d._linkPreviewResponse = "linkPreviewResponse"; + } + if (m.placeholderMessageResendResponse != null && m.hasOwnProperty("placeholderMessageResendResponse")) { + d.placeholderMessageResendResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(m.placeholderMessageResendResponse, o); + if (o.oneofs) + d._placeholderMessageResendResponse = "placeholderMessageResendResponse"; + } + if (m.waffleNonceFetchRequestResponse != null && m.hasOwnProperty("waffleNonceFetchRequestResponse")) { + d.waffleNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(m.waffleNonceFetchRequestResponse, o); + if (o.oneofs) + d._waffleNonceFetchRequestResponse = "waffleNonceFetchRequestResponse"; + } + if (m.fullHistorySyncOnDemandRequestResponse != null && m.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")) { + d.fullHistorySyncOnDemandRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(m.fullHistorySyncOnDemandRequestResponse, o); + if (o.oneofs) + d._fullHistorySyncOnDemandRequestResponse = "fullHistorySyncOnDemandRequestResponse"; + } + if (m.companionMetaNonceFetchRequestResponse != null && m.hasOwnProperty("companionMetaNonceFetchRequestResponse")) { + d.companionMetaNonceFetchRequestResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(m.companionMetaNonceFetchRequestResponse, o); + if (o.oneofs) + d._companionMetaNonceFetchRequestResponse = "companionMetaNonceFetchRequestResponse"; + } + if (m.syncdSnapshotFatalRecoveryResponse != null && m.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")) { + d.syncdSnapshotFatalRecoveryResponse = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(m.syncdSnapshotFatalRecoveryResponse, o); + if (o.oneofs) + d._syncdSnapshotFatalRecoveryResponse = "syncdSnapshotFatalRecoveryResponse"; + } + return d; + }; + + PeerDataOperationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PeerDataOperationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21358,7 +48127,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CompanionMetaNonceFetchResponse.prototype.nonce = ""; + CompanionMetaNonceFetchResponse.prototype.nonce = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CompanionMetaNonceFetchResponse.prototype, "_nonce", { + get: $util.oneOfGetter($oneOfFields = ["nonce"]), + set: $util.oneOfSetter($oneOfFields) + }); CompanionMetaNonceFetchResponse.create = function create(properties) { return new CompanionMetaNonceFetchResponse(properties); @@ -21393,6 +48170,32 @@ export const proto = $root.proto = (() => { return m; }; + CompanionMetaNonceFetchResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse(); + if (d.nonce != null) { + m.nonce = String(d.nonce); + } + return m; + }; + + CompanionMetaNonceFetchResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.nonce != null && m.hasOwnProperty("nonce")) { + d.nonce = m.nonce; + if (o.oneofs) + d._nonce = "nonce"; + } + return d; + }; + + CompanionMetaNonceFetchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CompanionMetaNonceFetchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21413,7 +48216,21 @@ export const proto = $root.proto = (() => { } FullHistorySyncOnDemandRequestResponse.prototype.requestMetadata = null; - FullHistorySyncOnDemandRequestResponse.prototype.responseCode = 0; + FullHistorySyncOnDemandRequestResponse.prototype.responseCode = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FullHistorySyncOnDemandRequestResponse.prototype, "_requestMetadata", { + get: $util.oneOfGetter($oneOfFields = ["requestMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FullHistorySyncOnDemandRequestResponse.prototype, "_responseCode", { + get: $util.oneOfGetter($oneOfFields = ["responseCode"]), + set: $util.oneOfSetter($oneOfFields) + }); FullHistorySyncOnDemandRequestResponse.create = function create(properties) { return new FullHistorySyncOnDemandRequestResponse(properties); @@ -21454,6 +48271,75 @@ export const proto = $root.proto = (() => { return m; }; + FullHistorySyncOnDemandRequestResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse(); + if (d.requestMetadata != null) { + if (typeof d.requestMetadata !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected"); + m.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(d.requestMetadata); + } + switch (d.responseCode) { + default: + if (typeof d.responseCode === "number") { + m.responseCode = d.responseCode; + break; + } + break; + case "REQUEST_SUCCESS": + case 0: + m.responseCode = 0; + break; + case "REQUEST_TIME_EXPIRED": + case 1: + m.responseCode = 1; + break; + case "DECLINED_SHARING_HISTORY": + case 2: + m.responseCode = 2; + break; + case "GENERIC_ERROR": + case 3: + m.responseCode = 3; + break; + case "ERROR_REQUEST_ON_NON_SMB_PRIMARY": + case 4: + m.responseCode = 4; + break; + case "ERROR_HOSTED_DEVICE_NOT_CONNECTED": + case 5: + m.responseCode = 5; + break; + case "ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET": + case 6: + m.responseCode = 6; + break; + } + return m; + }; + + FullHistorySyncOnDemandRequestResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.requestMetadata != null && m.hasOwnProperty("requestMetadata")) { + d.requestMetadata = $root.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(m.requestMetadata, o); + if (o.oneofs) + d._requestMetadata = "requestMetadata"; + } + if (m.responseCode != null && m.hasOwnProperty("responseCode")) { + d.responseCode = o.enums === String ? $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[m.responseCode] === undefined ? m.responseCode : $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[m.responseCode] : m.responseCode; + if (o.oneofs) + d._responseCode = "responseCode"; + } + return d; + }; + + FullHistorySyncOnDemandRequestResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FullHistorySyncOnDemandRequestResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21485,14 +48371,58 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LinkPreviewResponse.prototype.url = ""; - LinkPreviewResponse.prototype.title = ""; - LinkPreviewResponse.prototype.description = ""; - LinkPreviewResponse.prototype.thumbData = $util.newBuffer([]); - LinkPreviewResponse.prototype.matchText = ""; - LinkPreviewResponse.prototype.previewType = ""; + LinkPreviewResponse.prototype.url = null; + LinkPreviewResponse.prototype.title = null; + LinkPreviewResponse.prototype.description = null; + LinkPreviewResponse.prototype.thumbData = null; + LinkPreviewResponse.prototype.matchText = null; + LinkPreviewResponse.prototype.previewType = null; LinkPreviewResponse.prototype.hqThumbnail = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_thumbData", { + get: $util.oneOfGetter($oneOfFields = ["thumbData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_matchText", { + get: $util.oneOfGetter($oneOfFields = ["matchText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_previewType", { + get: $util.oneOfGetter($oneOfFields = ["previewType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewResponse.prototype, "_hqThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["hqThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + LinkPreviewResponse.create = function create(properties) { return new LinkPreviewResponse(properties); }; @@ -21562,6 +48492,85 @@ export const proto = $root.proto = (() => { return m; }; + LinkPreviewResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.thumbData != null) { + if (typeof d.thumbData === "string") + $util.base64.decode(d.thumbData, m.thumbData = $util.newBuffer($util.base64.length(d.thumbData)), 0); + else if (d.thumbData.length >= 0) + m.thumbData = d.thumbData; + } + if (d.matchText != null) { + m.matchText = String(d.matchText); + } + if (d.previewType != null) { + m.previewType = String(d.previewType); + } + if (d.hqThumbnail != null) { + if (typeof d.hqThumbnail !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected"); + m.hqThumbnail = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(d.hqThumbnail); + } + return m; + }; + + LinkPreviewResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.thumbData != null && m.hasOwnProperty("thumbData")) { + d.thumbData = o.bytes === String ? $util.base64.encode(m.thumbData, 0, m.thumbData.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbData) : m.thumbData; + if (o.oneofs) + d._thumbData = "thumbData"; + } + if (m.matchText != null && m.hasOwnProperty("matchText")) { + d.matchText = m.matchText; + if (o.oneofs) + d._matchText = "matchText"; + } + if (m.previewType != null && m.hasOwnProperty("previewType")) { + d.previewType = m.previewType; + if (o.oneofs) + d._previewType = "previewType"; + } + if (m.hqThumbnail != null && m.hasOwnProperty("hqThumbnail")) { + d.hqThumbnail = $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(m.hqThumbnail, o); + if (o.oneofs) + d._hqThumbnail = "hqThumbnail"; + } + return d; + }; + + LinkPreviewResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LinkPreviewResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21578,13 +48587,57 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LinkPreviewHighQualityThumbnail.prototype.directPath = ""; - LinkPreviewHighQualityThumbnail.prototype.thumbHash = ""; - LinkPreviewHighQualityThumbnail.prototype.encThumbHash = ""; - LinkPreviewHighQualityThumbnail.prototype.mediaKey = $util.newBuffer([]); - LinkPreviewHighQualityThumbnail.prototype.mediaKeyTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - LinkPreviewHighQualityThumbnail.prototype.thumbWidth = 0; - LinkPreviewHighQualityThumbnail.prototype.thumbHeight = 0; + LinkPreviewHighQualityThumbnail.prototype.directPath = null; + LinkPreviewHighQualityThumbnail.prototype.thumbHash = null; + LinkPreviewHighQualityThumbnail.prototype.encThumbHash = null; + LinkPreviewHighQualityThumbnail.prototype.mediaKey = null; + LinkPreviewHighQualityThumbnail.prototype.mediaKeyTimestampMs = null; + LinkPreviewHighQualityThumbnail.prototype.thumbWidth = null; + LinkPreviewHighQualityThumbnail.prototype.thumbHeight = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_thumbHash", { + get: $util.oneOfGetter($oneOfFields = ["thumbHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_encThumbHash", { + get: $util.oneOfGetter($oneOfFields = ["encThumbHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_mediaKeyTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_thumbWidth", { + get: $util.oneOfGetter($oneOfFields = ["thumbWidth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LinkPreviewHighQualityThumbnail.prototype, "_thumbHeight", { + get: $util.oneOfGetter($oneOfFields = ["thumbHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); LinkPreviewHighQualityThumbnail.create = function create(properties) { return new LinkPreviewHighQualityThumbnail(properties); @@ -21655,6 +48708,93 @@ export const proto = $root.proto = (() => { return m; }; + LinkPreviewHighQualityThumbnail.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail(); + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.thumbHash != null) { + m.thumbHash = String(d.thumbHash); + } + if (d.encThumbHash != null) { + m.encThumbHash = String(d.encThumbHash); + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mediaKeyTimestampMs != null) { + if ($util.Long) + (m.mediaKeyTimestampMs = $util.Long.fromValue(d.mediaKeyTimestampMs)).unsigned = false; + else if (typeof d.mediaKeyTimestampMs === "string") + m.mediaKeyTimestampMs = parseInt(d.mediaKeyTimestampMs, 10); + else if (typeof d.mediaKeyTimestampMs === "number") + m.mediaKeyTimestampMs = d.mediaKeyTimestampMs; + else if (typeof d.mediaKeyTimestampMs === "object") + m.mediaKeyTimestampMs = new $util.LongBits(d.mediaKeyTimestampMs.low >>> 0, d.mediaKeyTimestampMs.high >>> 0).toNumber(); + } + if (d.thumbWidth != null) { + m.thumbWidth = d.thumbWidth | 0; + } + if (d.thumbHeight != null) { + m.thumbHeight = d.thumbHeight | 0; + } + return m; + }; + + LinkPreviewHighQualityThumbnail.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.thumbHash != null && m.hasOwnProperty("thumbHash")) { + d.thumbHash = m.thumbHash; + if (o.oneofs) + d._thumbHash = "thumbHash"; + } + if (m.encThumbHash != null && m.hasOwnProperty("encThumbHash")) { + d.encThumbHash = m.encThumbHash; + if (o.oneofs) + d._encThumbHash = "encThumbHash"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mediaKeyTimestampMs != null && m.hasOwnProperty("mediaKeyTimestampMs")) { + if (typeof m.mediaKeyTimestampMs === "number") + d.mediaKeyTimestampMs = o.longs === String ? String(m.mediaKeyTimestampMs) : m.mediaKeyTimestampMs; + else + d.mediaKeyTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestampMs) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestampMs.low >>> 0, m.mediaKeyTimestampMs.high >>> 0).toNumber() : m.mediaKeyTimestampMs; + if (o.oneofs) + d._mediaKeyTimestampMs = "mediaKeyTimestampMs"; + } + if (m.thumbWidth != null && m.hasOwnProperty("thumbWidth")) { + d.thumbWidth = m.thumbWidth; + if (o.oneofs) + d._thumbWidth = "thumbWidth"; + } + if (m.thumbHeight != null && m.hasOwnProperty("thumbHeight")) { + d.thumbHeight = m.thumbHeight; + if (o.oneofs) + d._thumbHeight = "thumbHeight"; + } + return d; + }; + + LinkPreviewHighQualityThumbnail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LinkPreviewHighQualityThumbnail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21677,7 +48817,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PlaceholderMessageResendResponse.prototype.webMessageInfoBytes = $util.newBuffer([]); + PlaceholderMessageResendResponse.prototype.webMessageInfoBytes = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PlaceholderMessageResendResponse.prototype, "_webMessageInfoBytes", { + get: $util.oneOfGetter($oneOfFields = ["webMessageInfoBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); PlaceholderMessageResendResponse.create = function create(properties) { return new PlaceholderMessageResendResponse(properties); @@ -21712,6 +48860,35 @@ export const proto = $root.proto = (() => { return m; }; + PlaceholderMessageResendResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse(); + if (d.webMessageInfoBytes != null) { + if (typeof d.webMessageInfoBytes === "string") + $util.base64.decode(d.webMessageInfoBytes, m.webMessageInfoBytes = $util.newBuffer($util.base64.length(d.webMessageInfoBytes)), 0); + else if (d.webMessageInfoBytes.length >= 0) + m.webMessageInfoBytes = d.webMessageInfoBytes; + } + return m; + }; + + PlaceholderMessageResendResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.webMessageInfoBytes != null && m.hasOwnProperty("webMessageInfoBytes")) { + d.webMessageInfoBytes = o.bytes === String ? $util.base64.encode(m.webMessageInfoBytes, 0, m.webMessageInfoBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.webMessageInfoBytes) : m.webMessageInfoBytes; + if (o.oneofs) + d._webMessageInfoBytes = "webMessageInfoBytes"; + } + return d; + }; + + PlaceholderMessageResendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PlaceholderMessageResendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21731,8 +48908,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncDSnapshotFatalRecoveryResponse.prototype.collectionSnapshot = $util.newBuffer([]); - SyncDSnapshotFatalRecoveryResponse.prototype.isCompressed = false; + SyncDSnapshotFatalRecoveryResponse.prototype.collectionSnapshot = null; + SyncDSnapshotFatalRecoveryResponse.prototype.isCompressed = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncDSnapshotFatalRecoveryResponse.prototype, "_collectionSnapshot", { + get: $util.oneOfGetter($oneOfFields = ["collectionSnapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncDSnapshotFatalRecoveryResponse.prototype, "_isCompressed", { + get: $util.oneOfGetter($oneOfFields = ["isCompressed"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncDSnapshotFatalRecoveryResponse.create = function create(properties) { return new SyncDSnapshotFatalRecoveryResponse(properties); @@ -21773,6 +48964,43 @@ export const proto = $root.proto = (() => { return m; }; + SyncDSnapshotFatalRecoveryResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse(); + if (d.collectionSnapshot != null) { + if (typeof d.collectionSnapshot === "string") + $util.base64.decode(d.collectionSnapshot, m.collectionSnapshot = $util.newBuffer($util.base64.length(d.collectionSnapshot)), 0); + else if (d.collectionSnapshot.length >= 0) + m.collectionSnapshot = d.collectionSnapshot; + } + if (d.isCompressed != null) { + m.isCompressed = Boolean(d.isCompressed); + } + return m; + }; + + SyncDSnapshotFatalRecoveryResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.collectionSnapshot != null && m.hasOwnProperty("collectionSnapshot")) { + d.collectionSnapshot = o.bytes === String ? $util.base64.encode(m.collectionSnapshot, 0, m.collectionSnapshot.length) : o.bytes === Array ? Array.prototype.slice.call(m.collectionSnapshot) : m.collectionSnapshot; + if (o.oneofs) + d._collectionSnapshot = "collectionSnapshot"; + } + if (m.isCompressed != null && m.hasOwnProperty("isCompressed")) { + d.isCompressed = m.isCompressed; + if (o.oneofs) + d._isCompressed = "isCompressed"; + } + return d; + }; + + SyncDSnapshotFatalRecoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncDSnapshotFatalRecoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21792,8 +49020,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WaffleNonceFetchResponse.prototype.nonce = ""; - WaffleNonceFetchResponse.prototype.waEntFbid = ""; + WaffleNonceFetchResponse.prototype.nonce = null; + WaffleNonceFetchResponse.prototype.waEntFbid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WaffleNonceFetchResponse.prototype, "_nonce", { + get: $util.oneOfGetter($oneOfFields = ["nonce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WaffleNonceFetchResponse.prototype, "_waEntFbid", { + get: $util.oneOfGetter($oneOfFields = ["waEntFbid"]), + set: $util.oneOfSetter($oneOfFields) + }); WaffleNonceFetchResponse.create = function create(properties) { return new WaffleNonceFetchResponse(properties); @@ -21834,6 +49076,40 @@ export const proto = $root.proto = (() => { return m; }; + WaffleNonceFetchResponse.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse) + return d; + var m = new $root.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse(); + if (d.nonce != null) { + m.nonce = String(d.nonce); + } + if (d.waEntFbid != null) { + m.waEntFbid = String(d.waEntFbid); + } + return m; + }; + + WaffleNonceFetchResponse.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.nonce != null && m.hasOwnProperty("nonce")) { + d.nonce = m.nonce; + if (o.oneofs) + d._nonce = "nonce"; + } + if (m.waEntFbid != null && m.hasOwnProperty("waEntFbid")) { + d.waEntFbid = m.waEntFbid; + if (o.oneofs) + d._waEntFbid = "waEntFbid"; + } + return d; + }; + + WaffleNonceFetchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WaffleNonceFetchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21874,8 +49150,28 @@ export const proto = $root.proto = (() => { } PinInChatMessage.prototype.key = null; - PinInChatMessage.prototype.type = 0; - PinInChatMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PinInChatMessage.prototype.type = null; + PinInChatMessage.prototype.senderTimestampMs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChatMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChatMessage.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChatMessage.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); PinInChatMessage.create = function create(properties) { return new PinInChatMessage(properties); @@ -21922,6 +49218,77 @@ export const proto = $root.proto = (() => { return m; }; + PinInChatMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PinInChatMessage) + return d; + var m = new $root.proto.Message.PinInChatMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.PinInChatMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNKNOWN_TYPE": + case 0: + m.type = 0; + break; + case "PIN_FOR_ALL": + case 1: + m.type = 1; + break; + case "UNPIN_FOR_ALL": + case 2: + m.type = 2; + break; + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + return m; + }; + + PinInChatMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.Message.PinInChatMessage.Type[m.type] === undefined ? m.type : $root.proto.Message.PinInChatMessage.Type[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + return d; + }; + + PinInChatMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PinInChatMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -21949,7 +49316,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PlaceholderMessage.prototype.type = 0; + PlaceholderMessage.prototype.type = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PlaceholderMessage.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); PlaceholderMessage.create = function create(properties) { return new PlaceholderMessage(properties); @@ -21984,6 +49359,41 @@ export const proto = $root.proto = (() => { return m; }; + PlaceholderMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PlaceholderMessage) + return d; + var m = new $root.proto.Message.PlaceholderMessage(); + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "MASK_LINKED_DEVICES": + case 0: + m.type = 0; + break; + } + return m; + }; + + PlaceholderMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.Message.PlaceholderMessage.PlaceholderType[m.type] === undefined ? m.type : $root.proto.Message.PlaceholderMessage.PlaceholderType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + return d; + }; + + PlaceholderMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PlaceholderMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22018,15 +49428,59 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollCreationMessage.prototype.encKey = $util.newBuffer([]); - PollCreationMessage.prototype.name = ""; + PollCreationMessage.prototype.encKey = null; + PollCreationMessage.prototype.name = null; PollCreationMessage.prototype.options = $util.emptyArray; - PollCreationMessage.prototype.selectableOptionsCount = 0; + PollCreationMessage.prototype.selectableOptionsCount = null; PollCreationMessage.prototype.contextInfo = null; - PollCreationMessage.prototype.pollContentType = 0; - PollCreationMessage.prototype.pollType = 0; + PollCreationMessage.prototype.pollContentType = null; + PollCreationMessage.prototype.pollType = null; PollCreationMessage.prototype.correctAnswer = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_encKey", { + get: $util.oneOfGetter($oneOfFields = ["encKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_selectableOptionsCount", { + get: $util.oneOfGetter($oneOfFields = ["selectableOptionsCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_pollContentType", { + get: $util.oneOfGetter($oneOfFields = ["pollContentType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_pollType", { + get: $util.oneOfGetter($oneOfFields = ["pollType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollCreationMessage.prototype, "_correctAnswer", { + get: $util.oneOfGetter($oneOfFields = ["correctAnswer"]), + set: $util.oneOfSetter($oneOfFields) + }); + PollCreationMessage.create = function create(properties) { return new PollCreationMessage(properties); }; @@ -22106,6 +49560,136 @@ export const proto = $root.proto = (() => { return m; }; + PollCreationMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollCreationMessage) + return d; + var m = new $root.proto.Message.PollCreationMessage(); + if (d.encKey != null) { + if (typeof d.encKey === "string") + $util.base64.decode(d.encKey, m.encKey = $util.newBuffer($util.base64.length(d.encKey)), 0); + else if (d.encKey.length >= 0) + m.encKey = d.encKey; + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.options) { + if (!Array.isArray(d.options)) + throw TypeError(".proto.Message.PollCreationMessage.options: array expected"); + m.options = []; + for (var i = 0; i < d.options.length; ++i) { + if (typeof d.options[i] !== "object") + throw TypeError(".proto.Message.PollCreationMessage.options: object expected"); + m.options[i] = $root.proto.Message.PollCreationMessage.Option.fromObject(d.options[i]); + } + } + if (d.selectableOptionsCount != null) { + m.selectableOptionsCount = d.selectableOptionsCount >>> 0; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + switch (d.pollContentType) { + default: + if (typeof d.pollContentType === "number") { + m.pollContentType = d.pollContentType; + break; + } + break; + case "UNKNOWN": + case 0: + m.pollContentType = 0; + break; + case "TEXT": + case 1: + m.pollContentType = 1; + break; + case "IMAGE": + case 2: + m.pollContentType = 2; + break; + } + switch (d.pollType) { + default: + if (typeof d.pollType === "number") { + m.pollType = d.pollType; + break; + } + break; + case "POLL": + case 0: + m.pollType = 0; + break; + case "QUIZ": + case 1: + m.pollType = 1; + break; + } + if (d.correctAnswer != null) { + if (typeof d.correctAnswer !== "object") + throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected"); + m.correctAnswer = $root.proto.Message.PollCreationMessage.Option.fromObject(d.correctAnswer); + } + return m; + }; + + PollCreationMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.options = []; + } + if (m.encKey != null && m.hasOwnProperty("encKey")) { + d.encKey = o.bytes === String ? $util.base64.encode(m.encKey, 0, m.encKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.encKey) : m.encKey; + if (o.oneofs) + d._encKey = "encKey"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.options && m.options.length) { + d.options = []; + for (var j = 0; j < m.options.length; ++j) { + d.options[j] = $root.proto.Message.PollCreationMessage.Option.toObject(m.options[j], o); + } + } + if (m.selectableOptionsCount != null && m.hasOwnProperty("selectableOptionsCount")) { + d.selectableOptionsCount = m.selectableOptionsCount; + if (o.oneofs) + d._selectableOptionsCount = "selectableOptionsCount"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.pollContentType != null && m.hasOwnProperty("pollContentType")) { + d.pollContentType = o.enums === String ? $root.proto.Message.PollContentType[m.pollContentType] === undefined ? m.pollContentType : $root.proto.Message.PollContentType[m.pollContentType] : m.pollContentType; + if (o.oneofs) + d._pollContentType = "pollContentType"; + } + if (m.pollType != null && m.hasOwnProperty("pollType")) { + d.pollType = o.enums === String ? $root.proto.Message.PollCreationMessage.PollType[m.pollType] === undefined ? m.pollType : $root.proto.Message.PollCreationMessage.PollType[m.pollType] : m.pollType; + if (o.oneofs) + d._pollType = "pollType"; + } + if (m.correctAnswer != null && m.hasOwnProperty("correctAnswer")) { + d.correctAnswer = $root.proto.Message.PollCreationMessage.Option.toObject(m.correctAnswer, o); + if (o.oneofs) + d._correctAnswer = "correctAnswer"; + } + return d; + }; + + PollCreationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollCreationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22122,8 +49706,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Option.prototype.optionName = ""; - Option.prototype.optionHash = ""; + Option.prototype.optionName = null; + Option.prototype.optionHash = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Option.prototype, "_optionName", { + get: $util.oneOfGetter($oneOfFields = ["optionName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Option.prototype, "_optionHash", { + get: $util.oneOfGetter($oneOfFields = ["optionHash"]), + set: $util.oneOfSetter($oneOfFields) + }); Option.create = function create(properties) { return new Option(properties); @@ -22164,6 +49762,40 @@ export const proto = $root.proto = (() => { return m; }; + Option.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollCreationMessage.Option) + return d; + var m = new $root.proto.Message.PollCreationMessage.Option(); + if (d.optionName != null) { + m.optionName = String(d.optionName); + } + if (d.optionHash != null) { + m.optionHash = String(d.optionHash); + } + return m; + }; + + Option.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.optionName != null && m.hasOwnProperty("optionName")) { + d.optionName = m.optionName; + if (o.oneofs) + d._optionName = "optionName"; + } + if (m.optionHash != null && m.hasOwnProperty("optionHash")) { + d.optionHash = m.optionHash; + if (o.oneofs) + d._optionHash = "optionHash"; + } + return d; + }; + + Option.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Option.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22193,8 +49825,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollEncValue.prototype.encPayload = $util.newBuffer([]); - PollEncValue.prototype.encIv = $util.newBuffer([]); + PollEncValue.prototype.encPayload = null; + PollEncValue.prototype.encIv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollEncValue.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollEncValue.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); PollEncValue.create = function create(properties) { return new PollEncValue(properties); @@ -22235,6 +49881,46 @@ export const proto = $root.proto = (() => { return m; }; + PollEncValue.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollEncValue) + return d; + var m = new $root.proto.Message.PollEncValue(); + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + return m; + }; + + PollEncValue.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + return d; + }; + + PollEncValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollEncValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22255,10 +49941,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollResultSnapshotMessage.prototype.name = ""; + PollResultSnapshotMessage.prototype.name = null; PollResultSnapshotMessage.prototype.pollVotes = $util.emptyArray; PollResultSnapshotMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollResultSnapshotMessage.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollResultSnapshotMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + PollResultSnapshotMessage.create = function create(properties) { return new PollResultSnapshotMessage(properties); }; @@ -22308,6 +50008,61 @@ export const proto = $root.proto = (() => { return m; }; + PollResultSnapshotMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollResultSnapshotMessage) + return d; + var m = new $root.proto.Message.PollResultSnapshotMessage(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.pollVotes) { + if (!Array.isArray(d.pollVotes)) + throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected"); + m.pollVotes = []; + for (var i = 0; i < d.pollVotes.length; ++i) { + if (typeof d.pollVotes[i] !== "object") + throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: object expected"); + m.pollVotes[i] = $root.proto.Message.PollResultSnapshotMessage.PollVote.fromObject(d.pollVotes[i]); + } + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.PollResultSnapshotMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + PollResultSnapshotMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.pollVotes = []; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.pollVotes && m.pollVotes.length) { + d.pollVotes = []; + for (var j = 0; j < m.pollVotes.length; ++j) { + d.pollVotes[j] = $root.proto.Message.PollResultSnapshotMessage.PollVote.toObject(m.pollVotes[j], o); + } + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + PollResultSnapshotMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollResultSnapshotMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22324,8 +50079,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollVote.prototype.optionName = ""; - PollVote.prototype.optionVoteCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PollVote.prototype.optionName = null; + PollVote.prototype.optionVoteCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollVote.prototype, "_optionName", { + get: $util.oneOfGetter($oneOfFields = ["optionName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollVote.prototype, "_optionVoteCount", { + get: $util.oneOfGetter($oneOfFields = ["optionVoteCount"]), + set: $util.oneOfSetter($oneOfFields) + }); PollVote.create = function create(properties) { return new PollVote(properties); @@ -22366,6 +50135,50 @@ export const proto = $root.proto = (() => { return m; }; + PollVote.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollResultSnapshotMessage.PollVote) + return d; + var m = new $root.proto.Message.PollResultSnapshotMessage.PollVote(); + if (d.optionName != null) { + m.optionName = String(d.optionName); + } + if (d.optionVoteCount != null) { + if ($util.Long) + (m.optionVoteCount = $util.Long.fromValue(d.optionVoteCount)).unsigned = false; + else if (typeof d.optionVoteCount === "string") + m.optionVoteCount = parseInt(d.optionVoteCount, 10); + else if (typeof d.optionVoteCount === "number") + m.optionVoteCount = d.optionVoteCount; + else if (typeof d.optionVoteCount === "object") + m.optionVoteCount = new $util.LongBits(d.optionVoteCount.low >>> 0, d.optionVoteCount.high >>> 0).toNumber(); + } + return m; + }; + + PollVote.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.optionName != null && m.hasOwnProperty("optionName")) { + d.optionName = m.optionName; + if (o.oneofs) + d._optionName = "optionName"; + } + if (m.optionVoteCount != null && m.hasOwnProperty("optionVoteCount")) { + if (typeof m.optionVoteCount === "number") + d.optionVoteCount = o.longs === String ? String(m.optionVoteCount) : m.optionVoteCount; + else + d.optionVoteCount = o.longs === String ? $util.Long.prototype.toString.call(m.optionVoteCount) : o.longs === Number ? new $util.LongBits(m.optionVoteCount.low >>> 0, m.optionVoteCount.high >>> 0).toNumber() : m.optionVoteCount; + if (o.oneofs) + d._optionVoteCount = "optionVoteCount"; + } + return d; + }; + + PollVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollVote.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22391,7 +50204,33 @@ export const proto = $root.proto = (() => { PollUpdateMessage.prototype.pollCreationMessageKey = null; PollUpdateMessage.prototype.vote = null; PollUpdateMessage.prototype.metadata = null; - PollUpdateMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PollUpdateMessage.prototype.senderTimestampMs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdateMessage.prototype, "_pollCreationMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdateMessage.prototype, "_vote", { + get: $util.oneOfGetter($oneOfFields = ["vote"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdateMessage.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdateMessage.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); PollUpdateMessage.create = function create(properties) { return new PollUpdateMessage(properties); @@ -22444,6 +50283,72 @@ export const proto = $root.proto = (() => { return m; }; + PollUpdateMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollUpdateMessage) + return d; + var m = new $root.proto.Message.PollUpdateMessage(); + if (d.pollCreationMessageKey != null) { + if (typeof d.pollCreationMessageKey !== "object") + throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected"); + m.pollCreationMessageKey = $root.proto.MessageKey.fromObject(d.pollCreationMessageKey); + } + if (d.vote != null) { + if (typeof d.vote !== "object") + throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected"); + m.vote = $root.proto.Message.PollEncValue.fromObject(d.vote); + } + if (d.metadata != null) { + if (typeof d.metadata !== "object") + throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected"); + m.metadata = $root.proto.Message.PollUpdateMessageMetadata.fromObject(d.metadata); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + return m; + }; + + PollUpdateMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.pollCreationMessageKey != null && m.hasOwnProperty("pollCreationMessageKey")) { + d.pollCreationMessageKey = $root.proto.MessageKey.toObject(m.pollCreationMessageKey, o); + if (o.oneofs) + d._pollCreationMessageKey = "pollCreationMessageKey"; + } + if (m.vote != null && m.hasOwnProperty("vote")) { + d.vote = $root.proto.Message.PollEncValue.toObject(m.vote, o); + if (o.oneofs) + d._vote = "vote"; + } + if (m.metadata != null && m.hasOwnProperty("metadata")) { + d.metadata = $root.proto.Message.PollUpdateMessageMetadata.toObject(m.metadata, o); + if (o.oneofs) + d._metadata = "metadata"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + return d; + }; + + PollUpdateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollUpdateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22490,6 +50395,20 @@ export const proto = $root.proto = (() => { return m; }; + PollUpdateMessageMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollUpdateMessageMetadata) + return d; + return new $root.proto.Message.PollUpdateMessageMetadata(); + }; + + PollUpdateMessageMetadata.toObject = function toObject() { + return {}; + }; + + PollUpdateMessageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollUpdateMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22549,6 +50468,44 @@ export const proto = $root.proto = (() => { return m; }; + PollVoteMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.PollVoteMessage) + return d; + var m = new $root.proto.Message.PollVoteMessage(); + if (d.selectedOptions) { + if (!Array.isArray(d.selectedOptions)) + throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected"); + m.selectedOptions = []; + for (var i = 0; i < d.selectedOptions.length; ++i) { + if (typeof d.selectedOptions[i] === "string") + $util.base64.decode(d.selectedOptions[i], m.selectedOptions[i] = $util.newBuffer($util.base64.length(d.selectedOptions[i])), 0); + else if (d.selectedOptions[i].length >= 0) + m.selectedOptions[i] = d.selectedOptions[i]; + } + } + return m; + }; + + PollVoteMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.selectedOptions = []; + } + if (m.selectedOptions && m.selectedOptions.length) { + d.selectedOptions = []; + for (var j = 0; j < m.selectedOptions.length; ++j) { + d.selectedOptions[j] = o.bytes === String ? $util.base64.encode(m.selectedOptions[j], 0, m.selectedOptions[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.selectedOptions[j]) : m.selectedOptions[j]; + } + } + return d; + }; + + PollVoteMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollVoteMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22569,12 +50526,50 @@ export const proto = $root.proto = (() => { } ProductMessage.prototype.product = null; - ProductMessage.prototype.businessOwnerJid = ""; + ProductMessage.prototype.businessOwnerJid = null; ProductMessage.prototype.catalog = null; - ProductMessage.prototype.body = ""; - ProductMessage.prototype.footer = ""; + ProductMessage.prototype.body = null; + ProductMessage.prototype.footer = null; ProductMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductMessage.prototype, "_product", { + get: $util.oneOfGetter($oneOfFields = ["product"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductMessage.prototype, "_businessOwnerJid", { + get: $util.oneOfGetter($oneOfFields = ["businessOwnerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductMessage.prototype, "_catalog", { + get: $util.oneOfGetter($oneOfFields = ["catalog"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductMessage.prototype, "_body", { + get: $util.oneOfGetter($oneOfFields = ["body"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductMessage.prototype, "_footer", { + get: $util.oneOfGetter($oneOfFields = ["footer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + ProductMessage.create = function create(properties) { return new ProductMessage(properties); }; @@ -22638,6 +50633,78 @@ export const proto = $root.proto = (() => { return m; }; + ProductMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ProductMessage) + return d; + var m = new $root.proto.Message.ProductMessage(); + if (d.product != null) { + if (typeof d.product !== "object") + throw TypeError(".proto.Message.ProductMessage.product: object expected"); + m.product = $root.proto.Message.ProductMessage.ProductSnapshot.fromObject(d.product); + } + if (d.businessOwnerJid != null) { + m.businessOwnerJid = String(d.businessOwnerJid); + } + if (d.catalog != null) { + if (typeof d.catalog !== "object") + throw TypeError(".proto.Message.ProductMessage.catalog: object expected"); + m.catalog = $root.proto.Message.ProductMessage.CatalogSnapshot.fromObject(d.catalog); + } + if (d.body != null) { + m.body = String(d.body); + } + if (d.footer != null) { + m.footer = String(d.footer); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + ProductMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.product != null && m.hasOwnProperty("product")) { + d.product = $root.proto.Message.ProductMessage.ProductSnapshot.toObject(m.product, o); + if (o.oneofs) + d._product = "product"; + } + if (m.businessOwnerJid != null && m.hasOwnProperty("businessOwnerJid")) { + d.businessOwnerJid = m.businessOwnerJid; + if (o.oneofs) + d._businessOwnerJid = "businessOwnerJid"; + } + if (m.catalog != null && m.hasOwnProperty("catalog")) { + d.catalog = $root.proto.Message.ProductMessage.CatalogSnapshot.toObject(m.catalog, o); + if (o.oneofs) + d._catalog = "catalog"; + } + if (m.body != null && m.hasOwnProperty("body")) { + d.body = m.body; + if (o.oneofs) + d._body = "body"; + } + if (m.footer != null && m.hasOwnProperty("footer")) { + d.footer = m.footer; + if (o.oneofs) + d._footer = "footer"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + ProductMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProductMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22655,8 +50722,28 @@ export const proto = $root.proto = (() => { } CatalogSnapshot.prototype.catalogImage = null; - CatalogSnapshot.prototype.title = ""; - CatalogSnapshot.prototype.description = ""; + CatalogSnapshot.prototype.title = null; + CatalogSnapshot.prototype.description = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CatalogSnapshot.prototype, "_catalogImage", { + get: $util.oneOfGetter($oneOfFields = ["catalogImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CatalogSnapshot.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CatalogSnapshot.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); CatalogSnapshot.create = function create(properties) { return new CatalogSnapshot(properties); @@ -22703,6 +50790,50 @@ export const proto = $root.proto = (() => { return m; }; + CatalogSnapshot.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ProductMessage.CatalogSnapshot) + return d; + var m = new $root.proto.Message.ProductMessage.CatalogSnapshot(); + if (d.catalogImage != null) { + if (typeof d.catalogImage !== "object") + throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected"); + m.catalogImage = $root.proto.Message.ImageMessage.fromObject(d.catalogImage); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + return m; + }; + + CatalogSnapshot.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.catalogImage != null && m.hasOwnProperty("catalogImage")) { + d.catalogImage = $root.proto.Message.ImageMessage.toObject(m.catalogImage, o); + if (o.oneofs) + d._catalogImage = "catalogImage"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + return d; + }; + + CatalogSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CatalogSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22723,17 +50854,91 @@ export const proto = $root.proto = (() => { } ProductSnapshot.prototype.productImage = null; - ProductSnapshot.prototype.productId = ""; - ProductSnapshot.prototype.title = ""; - ProductSnapshot.prototype.description = ""; - ProductSnapshot.prototype.currencyCode = ""; - ProductSnapshot.prototype.priceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - ProductSnapshot.prototype.retailerId = ""; - ProductSnapshot.prototype.url = ""; - ProductSnapshot.prototype.productImageCount = 0; - ProductSnapshot.prototype.firstImageId = ""; - ProductSnapshot.prototype.salePriceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - ProductSnapshot.prototype.signedUrl = ""; + ProductSnapshot.prototype.productId = null; + ProductSnapshot.prototype.title = null; + ProductSnapshot.prototype.description = null; + ProductSnapshot.prototype.currencyCode = null; + ProductSnapshot.prototype.priceAmount1000 = null; + ProductSnapshot.prototype.retailerId = null; + ProductSnapshot.prototype.url = null; + ProductSnapshot.prototype.productImageCount = null; + ProductSnapshot.prototype.firstImageId = null; + ProductSnapshot.prototype.salePriceAmount1000 = null; + ProductSnapshot.prototype.signedUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_productImage", { + get: $util.oneOfGetter($oneOfFields = ["productImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_productId", { + get: $util.oneOfGetter($oneOfFields = ["productId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_priceAmount1000", { + get: $util.oneOfGetter($oneOfFields = ["priceAmount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_retailerId", { + get: $util.oneOfGetter($oneOfFields = ["retailerId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_productImageCount", { + get: $util.oneOfGetter($oneOfFields = ["productImageCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_firstImageId", { + get: $util.oneOfGetter($oneOfFields = ["firstImageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_salePriceAmount1000", { + get: $util.oneOfGetter($oneOfFields = ["salePriceAmount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProductSnapshot.prototype, "_signedUrl", { + get: $util.oneOfGetter($oneOfFields = ["signedUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); ProductSnapshot.create = function create(properties) { return new ProductSnapshot(properties); @@ -22834,6 +51039,142 @@ export const proto = $root.proto = (() => { return m; }; + ProductSnapshot.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ProductMessage.ProductSnapshot) + return d; + var m = new $root.proto.Message.ProductMessage.ProductSnapshot(); + if (d.productImage != null) { + if (typeof d.productImage !== "object") + throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected"); + m.productImage = $root.proto.Message.ImageMessage.fromObject(d.productImage); + } + if (d.productId != null) { + m.productId = String(d.productId); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.currencyCode != null) { + m.currencyCode = String(d.currencyCode); + } + if (d.priceAmount1000 != null) { + if ($util.Long) + (m.priceAmount1000 = $util.Long.fromValue(d.priceAmount1000)).unsigned = false; + else if (typeof d.priceAmount1000 === "string") + m.priceAmount1000 = parseInt(d.priceAmount1000, 10); + else if (typeof d.priceAmount1000 === "number") + m.priceAmount1000 = d.priceAmount1000; + else if (typeof d.priceAmount1000 === "object") + m.priceAmount1000 = new $util.LongBits(d.priceAmount1000.low >>> 0, d.priceAmount1000.high >>> 0).toNumber(); + } + if (d.retailerId != null) { + m.retailerId = String(d.retailerId); + } + if (d.url != null) { + m.url = String(d.url); + } + if (d.productImageCount != null) { + m.productImageCount = d.productImageCount >>> 0; + } + if (d.firstImageId != null) { + m.firstImageId = String(d.firstImageId); + } + if (d.salePriceAmount1000 != null) { + if ($util.Long) + (m.salePriceAmount1000 = $util.Long.fromValue(d.salePriceAmount1000)).unsigned = false; + else if (typeof d.salePriceAmount1000 === "string") + m.salePriceAmount1000 = parseInt(d.salePriceAmount1000, 10); + else if (typeof d.salePriceAmount1000 === "number") + m.salePriceAmount1000 = d.salePriceAmount1000; + else if (typeof d.salePriceAmount1000 === "object") + m.salePriceAmount1000 = new $util.LongBits(d.salePriceAmount1000.low >>> 0, d.salePriceAmount1000.high >>> 0).toNumber(); + } + if (d.signedUrl != null) { + m.signedUrl = String(d.signedUrl); + } + return m; + }; + + ProductSnapshot.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.productImage != null && m.hasOwnProperty("productImage")) { + d.productImage = $root.proto.Message.ImageMessage.toObject(m.productImage, o); + if (o.oneofs) + d._productImage = "productImage"; + } + if (m.productId != null && m.hasOwnProperty("productId")) { + d.productId = m.productId; + if (o.oneofs) + d._productId = "productId"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.currencyCode != null && m.hasOwnProperty("currencyCode")) { + d.currencyCode = m.currencyCode; + if (o.oneofs) + d._currencyCode = "currencyCode"; + } + if (m.priceAmount1000 != null && m.hasOwnProperty("priceAmount1000")) { + if (typeof m.priceAmount1000 === "number") + d.priceAmount1000 = o.longs === String ? String(m.priceAmount1000) : m.priceAmount1000; + else + d.priceAmount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.priceAmount1000) : o.longs === Number ? new $util.LongBits(m.priceAmount1000.low >>> 0, m.priceAmount1000.high >>> 0).toNumber() : m.priceAmount1000; + if (o.oneofs) + d._priceAmount1000 = "priceAmount1000"; + } + if (m.retailerId != null && m.hasOwnProperty("retailerId")) { + d.retailerId = m.retailerId; + if (o.oneofs) + d._retailerId = "retailerId"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.productImageCount != null && m.hasOwnProperty("productImageCount")) { + d.productImageCount = m.productImageCount; + if (o.oneofs) + d._productImageCount = "productImageCount"; + } + if (m.firstImageId != null && m.hasOwnProperty("firstImageId")) { + d.firstImageId = m.firstImageId; + if (o.oneofs) + d._firstImageId = "firstImageId"; + } + if (m.salePriceAmount1000 != null && m.hasOwnProperty("salePriceAmount1000")) { + if (typeof m.salePriceAmount1000 === "number") + d.salePriceAmount1000 = o.longs === String ? String(m.salePriceAmount1000) : m.salePriceAmount1000; + else + d.salePriceAmount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.salePriceAmount1000) : o.longs === Number ? new $util.LongBits(m.salePriceAmount1000.low >>> 0, m.salePriceAmount1000.high >>> 0).toNumber() : m.salePriceAmount1000; + if (o.oneofs) + d._salePriceAmount1000 = "salePriceAmount1000"; + } + if (m.signedUrl != null && m.hasOwnProperty("signedUrl")) { + d.signedUrl = m.signedUrl; + if (o.oneofs) + d._signedUrl = "signedUrl"; + } + return d; + }; + + ProductSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProductSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -22857,9 +51198,9 @@ export const proto = $root.proto = (() => { } ProtocolMessage.prototype.key = null; - ProtocolMessage.prototype.type = 0; - ProtocolMessage.prototype.ephemeralExpiration = 0; - ProtocolMessage.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ProtocolMessage.prototype.type = null; + ProtocolMessage.prototype.ephemeralExpiration = null; + ProtocolMessage.prototype.ephemeralSettingTimestamp = null; ProtocolMessage.prototype.historySyncNotification = null; ProtocolMessage.prototype.appStateSyncKeyShare = null; ProtocolMessage.prototype.appStateSyncKeyRequest = null; @@ -22867,20 +51208,166 @@ export const proto = $root.proto = (() => { ProtocolMessage.prototype.appStateFatalExceptionNotification = null; ProtocolMessage.prototype.disappearingMode = null; ProtocolMessage.prototype.editedMessage = null; - ProtocolMessage.prototype.timestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ProtocolMessage.prototype.timestampMs = null; ProtocolMessage.prototype.peerDataOperationRequestMessage = null; ProtocolMessage.prototype.peerDataOperationRequestResponseMessage = null; ProtocolMessage.prototype.botFeedbackMessage = null; - ProtocolMessage.prototype.invokerJid = ""; + ProtocolMessage.prototype.invokerJid = null; ProtocolMessage.prototype.requestWelcomeMessageMetadata = null; ProtocolMessage.prototype.mediaNotifyMessage = null; ProtocolMessage.prototype.cloudApiThreadControlNotification = null; ProtocolMessage.prototype.lidMigrationMappingSyncMessage = null; ProtocolMessage.prototype.limitSharing = null; - ProtocolMessage.prototype.aiPsiMetadata = $util.newBuffer([]); + ProtocolMessage.prototype.aiPsiMetadata = null; ProtocolMessage.prototype.aiQueryFanout = null; ProtocolMessage.prototype.memberLabel = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_ephemeralExpiration", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralExpiration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_ephemeralSettingTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralSettingTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_historySyncNotification", { + get: $util.oneOfGetter($oneOfFields = ["historySyncNotification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_appStateSyncKeyShare", { + get: $util.oneOfGetter($oneOfFields = ["appStateSyncKeyShare"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_appStateSyncKeyRequest", { + get: $util.oneOfGetter($oneOfFields = ["appStateSyncKeyRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_initialSecurityNotificationSettingSync", { + get: $util.oneOfGetter($oneOfFields = ["initialSecurityNotificationSettingSync"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_appStateFatalExceptionNotification", { + get: $util.oneOfGetter($oneOfFields = ["appStateFatalExceptionNotification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_disappearingMode", { + get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_editedMessage", { + get: $util.oneOfGetter($oneOfFields = ["editedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_timestampMs", { + get: $util.oneOfGetter($oneOfFields = ["timestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_peerDataOperationRequestMessage", { + get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_peerDataOperationRequestResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["peerDataOperationRequestResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_botFeedbackMessage", { + get: $util.oneOfGetter($oneOfFields = ["botFeedbackMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_invokerJid", { + get: $util.oneOfGetter($oneOfFields = ["invokerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_requestWelcomeMessageMetadata", { + get: $util.oneOfGetter($oneOfFields = ["requestWelcomeMessageMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_mediaNotifyMessage", { + get: $util.oneOfGetter($oneOfFields = ["mediaNotifyMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_cloudApiThreadControlNotification", { + get: $util.oneOfGetter($oneOfFields = ["cloudApiThreadControlNotification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_lidMigrationMappingSyncMessage", { + get: $util.oneOfGetter($oneOfFields = ["lidMigrationMappingSyncMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_limitSharing", { + get: $util.oneOfGetter($oneOfFields = ["limitSharing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_aiPsiMetadata", { + get: $util.oneOfGetter($oneOfFields = ["aiPsiMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_aiQueryFanout", { + get: $util.oneOfGetter($oneOfFields = ["aiQueryFanout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProtocolMessage.prototype, "_memberLabel", { + get: $util.oneOfGetter($oneOfFields = ["memberLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + ProtocolMessage.create = function create(properties) { return new ProtocolMessage(properties); }; @@ -23052,6 +51539,384 @@ export const proto = $root.proto = (() => { return m; }; + ProtocolMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ProtocolMessage) + return d; + var m = new $root.proto.Message.ProtocolMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.ProtocolMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "REVOKE": + case 0: + m.type = 0; + break; + case "EPHEMERAL_SETTING": + case 3: + m.type = 3; + break; + case "EPHEMERAL_SYNC_RESPONSE": + case 4: + m.type = 4; + break; + case "HISTORY_SYNC_NOTIFICATION": + case 5: + m.type = 5; + break; + case "APP_STATE_SYNC_KEY_SHARE": + case 6: + m.type = 6; + break; + case "APP_STATE_SYNC_KEY_REQUEST": + case 7: + m.type = 7; + break; + case "MSG_FANOUT_BACKFILL_REQUEST": + case 8: + m.type = 8; + break; + case "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC": + case 9: + m.type = 9; + break; + case "APP_STATE_FATAL_EXCEPTION_NOTIFICATION": + case 10: + m.type = 10; + break; + case "SHARE_PHONE_NUMBER": + case 11: + m.type = 11; + break; + case "MESSAGE_EDIT": + case 14: + m.type = 14; + break; + case "PEER_DATA_OPERATION_REQUEST_MESSAGE": + case 16: + m.type = 16; + break; + case "PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE": + case 17: + m.type = 17; + break; + case "REQUEST_WELCOME_MESSAGE": + case 18: + m.type = 18; + break; + case "BOT_FEEDBACK_MESSAGE": + case 19: + m.type = 19; + break; + case "MEDIA_NOTIFY_MESSAGE": + case 20: + m.type = 20; + break; + case "CLOUD_API_THREAD_CONTROL_NOTIFICATION": + case 21: + m.type = 21; + break; + case "LID_MIGRATION_MAPPING_SYNC": + case 22: + m.type = 22; + break; + case "REMINDER_MESSAGE": + case 23: + m.type = 23; + break; + case "BOT_MEMU_ONBOARDING_MESSAGE": + case 24: + m.type = 24; + break; + case "STATUS_MENTION_MESSAGE": + case 25: + m.type = 25; + break; + case "STOP_GENERATION_MESSAGE": + case 26: + m.type = 26; + break; + case "LIMIT_SHARING": + case 27: + m.type = 27; + break; + case "AI_PSI_METADATA": + case 28: + m.type = 28; + break; + case "AI_QUERY_FANOUT": + case 29: + m.type = 29; + break; + case "GROUP_MEMBER_LABEL_CHANGE": + case 30: + m.type = 30; + break; + } + if (d.ephemeralExpiration != null) { + m.ephemeralExpiration = d.ephemeralExpiration >>> 0; + } + if (d.ephemeralSettingTimestamp != null) { + if ($util.Long) + (m.ephemeralSettingTimestamp = $util.Long.fromValue(d.ephemeralSettingTimestamp)).unsigned = false; + else if (typeof d.ephemeralSettingTimestamp === "string") + m.ephemeralSettingTimestamp = parseInt(d.ephemeralSettingTimestamp, 10); + else if (typeof d.ephemeralSettingTimestamp === "number") + m.ephemeralSettingTimestamp = d.ephemeralSettingTimestamp; + else if (typeof d.ephemeralSettingTimestamp === "object") + m.ephemeralSettingTimestamp = new $util.LongBits(d.ephemeralSettingTimestamp.low >>> 0, d.ephemeralSettingTimestamp.high >>> 0).toNumber(); + } + if (d.historySyncNotification != null) { + if (typeof d.historySyncNotification !== "object") + throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected"); + m.historySyncNotification = $root.proto.Message.HistorySyncNotification.fromObject(d.historySyncNotification); + } + if (d.appStateSyncKeyShare != null) { + if (typeof d.appStateSyncKeyShare !== "object") + throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected"); + m.appStateSyncKeyShare = $root.proto.Message.AppStateSyncKeyShare.fromObject(d.appStateSyncKeyShare); + } + if (d.appStateSyncKeyRequest != null) { + if (typeof d.appStateSyncKeyRequest !== "object") + throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected"); + m.appStateSyncKeyRequest = $root.proto.Message.AppStateSyncKeyRequest.fromObject(d.appStateSyncKeyRequest); + } + if (d.initialSecurityNotificationSettingSync != null) { + if (typeof d.initialSecurityNotificationSettingSync !== "object") + throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected"); + m.initialSecurityNotificationSettingSync = $root.proto.Message.InitialSecurityNotificationSettingSync.fromObject(d.initialSecurityNotificationSettingSync); + } + if (d.appStateFatalExceptionNotification != null) { + if (typeof d.appStateFatalExceptionNotification !== "object") + throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected"); + m.appStateFatalExceptionNotification = $root.proto.Message.AppStateFatalExceptionNotification.fromObject(d.appStateFatalExceptionNotification); + } + if (d.disappearingMode != null) { + if (typeof d.disappearingMode !== "object") + throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected"); + m.disappearingMode = $root.proto.DisappearingMode.fromObject(d.disappearingMode); + } + if (d.editedMessage != null) { + if (typeof d.editedMessage !== "object") + throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected"); + m.editedMessage = $root.proto.Message.fromObject(d.editedMessage); + } + if (d.timestampMs != null) { + if ($util.Long) + (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false; + else if (typeof d.timestampMs === "string") + m.timestampMs = parseInt(d.timestampMs, 10); + else if (typeof d.timestampMs === "number") + m.timestampMs = d.timestampMs; + else if (typeof d.timestampMs === "object") + m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber(); + } + if (d.peerDataOperationRequestMessage != null) { + if (typeof d.peerDataOperationRequestMessage !== "object") + throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected"); + m.peerDataOperationRequestMessage = $root.proto.Message.PeerDataOperationRequestMessage.fromObject(d.peerDataOperationRequestMessage); + } + if (d.peerDataOperationRequestResponseMessage != null) { + if (typeof d.peerDataOperationRequestResponseMessage !== "object") + throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected"); + m.peerDataOperationRequestResponseMessage = $root.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(d.peerDataOperationRequestResponseMessage); + } + if (d.botFeedbackMessage != null) { + if (typeof d.botFeedbackMessage !== "object") + throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected"); + m.botFeedbackMessage = $root.proto.Message.BotFeedbackMessage.fromObject(d.botFeedbackMessage); + } + if (d.invokerJid != null) { + m.invokerJid = String(d.invokerJid); + } + if (d.requestWelcomeMessageMetadata != null) { + if (typeof d.requestWelcomeMessageMetadata !== "object") + throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected"); + m.requestWelcomeMessageMetadata = $root.proto.Message.RequestWelcomeMessageMetadata.fromObject(d.requestWelcomeMessageMetadata); + } + if (d.mediaNotifyMessage != null) { + if (typeof d.mediaNotifyMessage !== "object") + throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected"); + m.mediaNotifyMessage = $root.proto.MediaNotifyMessage.fromObject(d.mediaNotifyMessage); + } + if (d.cloudApiThreadControlNotification != null) { + if (typeof d.cloudApiThreadControlNotification !== "object") + throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected"); + m.cloudApiThreadControlNotification = $root.proto.Message.CloudAPIThreadControlNotification.fromObject(d.cloudApiThreadControlNotification); + } + if (d.lidMigrationMappingSyncMessage != null) { + if (typeof d.lidMigrationMappingSyncMessage !== "object") + throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected"); + m.lidMigrationMappingSyncMessage = $root.proto.LIDMigrationMappingSyncMessage.fromObject(d.lidMigrationMappingSyncMessage); + } + if (d.limitSharing != null) { + if (typeof d.limitSharing !== "object") + throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected"); + m.limitSharing = $root.proto.LimitSharing.fromObject(d.limitSharing); + } + if (d.aiPsiMetadata != null) { + if (typeof d.aiPsiMetadata === "string") + $util.base64.decode(d.aiPsiMetadata, m.aiPsiMetadata = $util.newBuffer($util.base64.length(d.aiPsiMetadata)), 0); + else if (d.aiPsiMetadata.length >= 0) + m.aiPsiMetadata = d.aiPsiMetadata; + } + if (d.aiQueryFanout != null) { + if (typeof d.aiQueryFanout !== "object") + throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected"); + m.aiQueryFanout = $root.proto.AIQueryFanout.fromObject(d.aiQueryFanout); + } + if (d.memberLabel != null) { + if (typeof d.memberLabel !== "object") + throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected"); + m.memberLabel = $root.proto.MemberLabel.fromObject(d.memberLabel); + } + return m; + }; + + ProtocolMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.Message.ProtocolMessage.Type[m.type] === undefined ? m.type : $root.proto.Message.ProtocolMessage.Type[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.ephemeralExpiration != null && m.hasOwnProperty("ephemeralExpiration")) { + d.ephemeralExpiration = m.ephemeralExpiration; + if (o.oneofs) + d._ephemeralExpiration = "ephemeralExpiration"; + } + if (m.ephemeralSettingTimestamp != null && m.hasOwnProperty("ephemeralSettingTimestamp")) { + if (typeof m.ephemeralSettingTimestamp === "number") + d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; + else + d.ephemeralSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralSettingTimestamp.low >>> 0, m.ephemeralSettingTimestamp.high >>> 0).toNumber() : m.ephemeralSettingTimestamp; + if (o.oneofs) + d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp"; + } + if (m.historySyncNotification != null && m.hasOwnProperty("historySyncNotification")) { + d.historySyncNotification = $root.proto.Message.HistorySyncNotification.toObject(m.historySyncNotification, o); + if (o.oneofs) + d._historySyncNotification = "historySyncNotification"; + } + if (m.appStateSyncKeyShare != null && m.hasOwnProperty("appStateSyncKeyShare")) { + d.appStateSyncKeyShare = $root.proto.Message.AppStateSyncKeyShare.toObject(m.appStateSyncKeyShare, o); + if (o.oneofs) + d._appStateSyncKeyShare = "appStateSyncKeyShare"; + } + if (m.appStateSyncKeyRequest != null && m.hasOwnProperty("appStateSyncKeyRequest")) { + d.appStateSyncKeyRequest = $root.proto.Message.AppStateSyncKeyRequest.toObject(m.appStateSyncKeyRequest, o); + if (o.oneofs) + d._appStateSyncKeyRequest = "appStateSyncKeyRequest"; + } + if (m.initialSecurityNotificationSettingSync != null && m.hasOwnProperty("initialSecurityNotificationSettingSync")) { + d.initialSecurityNotificationSettingSync = $root.proto.Message.InitialSecurityNotificationSettingSync.toObject(m.initialSecurityNotificationSettingSync, o); + if (o.oneofs) + d._initialSecurityNotificationSettingSync = "initialSecurityNotificationSettingSync"; + } + if (m.appStateFatalExceptionNotification != null && m.hasOwnProperty("appStateFatalExceptionNotification")) { + d.appStateFatalExceptionNotification = $root.proto.Message.AppStateFatalExceptionNotification.toObject(m.appStateFatalExceptionNotification, o); + if (o.oneofs) + d._appStateFatalExceptionNotification = "appStateFatalExceptionNotification"; + } + if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) { + d.disappearingMode = $root.proto.DisappearingMode.toObject(m.disappearingMode, o); + if (o.oneofs) + d._disappearingMode = "disappearingMode"; + } + if (m.editedMessage != null && m.hasOwnProperty("editedMessage")) { + d.editedMessage = $root.proto.Message.toObject(m.editedMessage, o); + if (o.oneofs) + d._editedMessage = "editedMessage"; + } + if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) { + if (typeof m.timestampMs === "number") + d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; + else + d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + if (o.oneofs) + d._timestampMs = "timestampMs"; + } + if (m.peerDataOperationRequestMessage != null && m.hasOwnProperty("peerDataOperationRequestMessage")) { + d.peerDataOperationRequestMessage = $root.proto.Message.PeerDataOperationRequestMessage.toObject(m.peerDataOperationRequestMessage, o); + if (o.oneofs) + d._peerDataOperationRequestMessage = "peerDataOperationRequestMessage"; + } + if (m.peerDataOperationRequestResponseMessage != null && m.hasOwnProperty("peerDataOperationRequestResponseMessage")) { + d.peerDataOperationRequestResponseMessage = $root.proto.Message.PeerDataOperationRequestResponseMessage.toObject(m.peerDataOperationRequestResponseMessage, o); + if (o.oneofs) + d._peerDataOperationRequestResponseMessage = "peerDataOperationRequestResponseMessage"; + } + if (m.botFeedbackMessage != null && m.hasOwnProperty("botFeedbackMessage")) { + d.botFeedbackMessage = $root.proto.Message.BotFeedbackMessage.toObject(m.botFeedbackMessage, o); + if (o.oneofs) + d._botFeedbackMessage = "botFeedbackMessage"; + } + if (m.invokerJid != null && m.hasOwnProperty("invokerJid")) { + d.invokerJid = m.invokerJid; + if (o.oneofs) + d._invokerJid = "invokerJid"; + } + if (m.requestWelcomeMessageMetadata != null && m.hasOwnProperty("requestWelcomeMessageMetadata")) { + d.requestWelcomeMessageMetadata = $root.proto.Message.RequestWelcomeMessageMetadata.toObject(m.requestWelcomeMessageMetadata, o); + if (o.oneofs) + d._requestWelcomeMessageMetadata = "requestWelcomeMessageMetadata"; + } + if (m.mediaNotifyMessage != null && m.hasOwnProperty("mediaNotifyMessage")) { + d.mediaNotifyMessage = $root.proto.MediaNotifyMessage.toObject(m.mediaNotifyMessage, o); + if (o.oneofs) + d._mediaNotifyMessage = "mediaNotifyMessage"; + } + if (m.cloudApiThreadControlNotification != null && m.hasOwnProperty("cloudApiThreadControlNotification")) { + d.cloudApiThreadControlNotification = $root.proto.Message.CloudAPIThreadControlNotification.toObject(m.cloudApiThreadControlNotification, o); + if (o.oneofs) + d._cloudApiThreadControlNotification = "cloudApiThreadControlNotification"; + } + if (m.lidMigrationMappingSyncMessage != null && m.hasOwnProperty("lidMigrationMappingSyncMessage")) { + d.lidMigrationMappingSyncMessage = $root.proto.LIDMigrationMappingSyncMessage.toObject(m.lidMigrationMappingSyncMessage, o); + if (o.oneofs) + d._lidMigrationMappingSyncMessage = "lidMigrationMappingSyncMessage"; + } + if (m.limitSharing != null && m.hasOwnProperty("limitSharing")) { + d.limitSharing = $root.proto.LimitSharing.toObject(m.limitSharing, o); + if (o.oneofs) + d._limitSharing = "limitSharing"; + } + if (m.aiPsiMetadata != null && m.hasOwnProperty("aiPsiMetadata")) { + d.aiPsiMetadata = o.bytes === String ? $util.base64.encode(m.aiPsiMetadata, 0, m.aiPsiMetadata.length) : o.bytes === Array ? Array.prototype.slice.call(m.aiPsiMetadata) : m.aiPsiMetadata; + if (o.oneofs) + d._aiPsiMetadata = "aiPsiMetadata"; + } + if (m.aiQueryFanout != null && m.hasOwnProperty("aiQueryFanout")) { + d.aiQueryFanout = $root.proto.AIQueryFanout.toObject(m.aiQueryFanout, o); + if (o.oneofs) + d._aiQueryFanout = "aiQueryFanout"; + } + if (m.memberLabel != null && m.hasOwnProperty("memberLabel")) { + d.memberLabel = $root.proto.MemberLabel.toObject(m.memberLabel, o); + if (o.oneofs) + d._memberLabel = "memberLabel"; + } + return d; + }; + + ProtocolMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProtocolMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23103,9 +51968,35 @@ export const proto = $root.proto = (() => { } ReactionMessage.prototype.key = null; - ReactionMessage.prototype.text = ""; - ReactionMessage.prototype.groupingKey = ""; - ReactionMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ReactionMessage.prototype.text = null; + ReactionMessage.prototype.groupingKey = null; + ReactionMessage.prototype.senderTimestampMs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReactionMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReactionMessage.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReactionMessage.prototype, "_groupingKey", { + get: $util.oneOfGetter($oneOfFields = ["groupingKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReactionMessage.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); ReactionMessage.create = function create(properties) { return new ReactionMessage(properties); @@ -23158,6 +52049,68 @@ export const proto = $root.proto = (() => { return m; }; + ReactionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ReactionMessage) + return d; + var m = new $root.proto.Message.ReactionMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.ReactionMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.text != null) { + m.text = String(d.text); + } + if (d.groupingKey != null) { + m.groupingKey = String(d.groupingKey); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + return m; + }; + + ReactionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.groupingKey != null && m.hasOwnProperty("groupingKey")) { + d.groupingKey = m.groupingKey; + if (o.oneofs) + d._groupingKey = "groupingKey"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + return d; + }; + + ReactionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ReactionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23178,13 +52131,57 @@ export const proto = $root.proto = (() => { } RequestPaymentMessage.prototype.noteMessage = null; - RequestPaymentMessage.prototype.currencyCodeIso4217 = ""; - RequestPaymentMessage.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - RequestPaymentMessage.prototype.requestFrom = ""; - RequestPaymentMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + RequestPaymentMessage.prototype.currencyCodeIso4217 = null; + RequestPaymentMessage.prototype.amount1000 = null; + RequestPaymentMessage.prototype.requestFrom = null; + RequestPaymentMessage.prototype.expiryTimestamp = null; RequestPaymentMessage.prototype.amount = null; RequestPaymentMessage.prototype.background = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_noteMessage", { + get: $util.oneOfGetter($oneOfFields = ["noteMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_currencyCodeIso4217", { + get: $util.oneOfGetter($oneOfFields = ["currencyCodeIso4217"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_amount1000", { + get: $util.oneOfGetter($oneOfFields = ["amount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_requestFrom", { + get: $util.oneOfGetter($oneOfFields = ["requestFrom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_expiryTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["expiryTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_amount", { + get: $util.oneOfGetter($oneOfFields = ["amount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPaymentMessage.prototype, "_background", { + get: $util.oneOfGetter($oneOfFields = ["background"]), + set: $util.oneOfSetter($oneOfFields) + }); + RequestPaymentMessage.create = function create(properties) { return new RequestPaymentMessage(properties); }; @@ -23254,6 +52251,106 @@ export const proto = $root.proto = (() => { return m; }; + RequestPaymentMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.RequestPaymentMessage) + return d; + var m = new $root.proto.Message.RequestPaymentMessage(); + if (d.noteMessage != null) { + if (typeof d.noteMessage !== "object") + throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected"); + m.noteMessage = $root.proto.Message.fromObject(d.noteMessage); + } + if (d.currencyCodeIso4217 != null) { + m.currencyCodeIso4217 = String(d.currencyCodeIso4217); + } + if (d.amount1000 != null) { + if ($util.Long) + (m.amount1000 = $util.Long.fromValue(d.amount1000)).unsigned = true; + else if (typeof d.amount1000 === "string") + m.amount1000 = parseInt(d.amount1000, 10); + else if (typeof d.amount1000 === "number") + m.amount1000 = d.amount1000; + else if (typeof d.amount1000 === "object") + m.amount1000 = new $util.LongBits(d.amount1000.low >>> 0, d.amount1000.high >>> 0).toNumber(true); + } + if (d.requestFrom != null) { + m.requestFrom = String(d.requestFrom); + } + if (d.expiryTimestamp != null) { + if ($util.Long) + (m.expiryTimestamp = $util.Long.fromValue(d.expiryTimestamp)).unsigned = false; + else if (typeof d.expiryTimestamp === "string") + m.expiryTimestamp = parseInt(d.expiryTimestamp, 10); + else if (typeof d.expiryTimestamp === "number") + m.expiryTimestamp = d.expiryTimestamp; + else if (typeof d.expiryTimestamp === "object") + m.expiryTimestamp = new $util.LongBits(d.expiryTimestamp.low >>> 0, d.expiryTimestamp.high >>> 0).toNumber(); + } + if (d.amount != null) { + if (typeof d.amount !== "object") + throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected"); + m.amount = $root.proto.Money.fromObject(d.amount); + } + if (d.background != null) { + if (typeof d.background !== "object") + throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected"); + m.background = $root.proto.PaymentBackground.fromObject(d.background); + } + return m; + }; + + RequestPaymentMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.currencyCodeIso4217 != null && m.hasOwnProperty("currencyCodeIso4217")) { + d.currencyCodeIso4217 = m.currencyCodeIso4217; + if (o.oneofs) + d._currencyCodeIso4217 = "currencyCodeIso4217"; + } + if (m.amount1000 != null && m.hasOwnProperty("amount1000")) { + if (typeof m.amount1000 === "number") + d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000; + else + d.amount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.amount1000) : o.longs === Number ? new $util.LongBits(m.amount1000.low >>> 0, m.amount1000.high >>> 0).toNumber(true) : m.amount1000; + if (o.oneofs) + d._amount1000 = "amount1000"; + } + if (m.requestFrom != null && m.hasOwnProperty("requestFrom")) { + d.requestFrom = m.requestFrom; + if (o.oneofs) + d._requestFrom = "requestFrom"; + } + if (m.noteMessage != null && m.hasOwnProperty("noteMessage")) { + d.noteMessage = $root.proto.Message.toObject(m.noteMessage, o); + if (o.oneofs) + d._noteMessage = "noteMessage"; + } + if (m.expiryTimestamp != null && m.hasOwnProperty("expiryTimestamp")) { + if (typeof m.expiryTimestamp === "number") + d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp; + else + d.expiryTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expiryTimestamp) : o.longs === Number ? new $util.LongBits(m.expiryTimestamp.low >>> 0, m.expiryTimestamp.high >>> 0).toNumber() : m.expiryTimestamp; + if (o.oneofs) + d._expiryTimestamp = "expiryTimestamp"; + } + if (m.amount != null && m.hasOwnProperty("amount")) { + d.amount = $root.proto.Money.toObject(m.amount, o); + if (o.oneofs) + d._amount = "amount"; + } + if (m.background != null && m.hasOwnProperty("background")) { + d.background = $root.proto.PaymentBackground.toObject(m.background, o); + if (o.oneofs) + d._background = "background"; + } + return d; + }; + + RequestPaymentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RequestPaymentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23275,6 +52372,14 @@ export const proto = $root.proto = (() => { RequestPhoneNumberMessage.prototype.contextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestPhoneNumberMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + RequestPhoneNumberMessage.create = function create(properties) { return new RequestPhoneNumberMessage(properties); }; @@ -23308,6 +52413,34 @@ export const proto = $root.proto = (() => { return m; }; + RequestPhoneNumberMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.RequestPhoneNumberMessage) + return d; + var m = new $root.proto.Message.RequestPhoneNumberMessage(); + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + return m; + }; + + RequestPhoneNumberMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + return d; + }; + + RequestPhoneNumberMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RequestPhoneNumberMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23327,7 +52460,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - RequestWelcomeMessageMetadata.prototype.localChatState = 0; + RequestWelcomeMessageMetadata.prototype.localChatState = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RequestWelcomeMessageMetadata.prototype, "_localChatState", { + get: $util.oneOfGetter($oneOfFields = ["localChatState"]), + set: $util.oneOfSetter($oneOfFields) + }); RequestWelcomeMessageMetadata.create = function create(properties) { return new RequestWelcomeMessageMetadata(properties); @@ -23362,6 +52503,45 @@ export const proto = $root.proto = (() => { return m; }; + RequestWelcomeMessageMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.RequestWelcomeMessageMetadata) + return d; + var m = new $root.proto.Message.RequestWelcomeMessageMetadata(); + switch (d.localChatState) { + default: + if (typeof d.localChatState === "number") { + m.localChatState = d.localChatState; + break; + } + break; + case "EMPTY": + case 0: + m.localChatState = 0; + break; + case "NON_EMPTY": + case 1: + m.localChatState = 1; + break; + } + return m; + }; + + RequestWelcomeMessageMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.localChatState != null && m.hasOwnProperty("localChatState")) { + d.localChatState = o.enums === String ? $root.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[m.localChatState] === undefined ? m.localChatState : $root.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[m.localChatState] : m.localChatState; + if (o.oneofs) + d._localChatState = "localChatState"; + } + return d; + }; + + RequestWelcomeMessageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RequestWelcomeMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23388,9 +52568,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ScheduledCallCreationMessage.prototype.scheduledTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - ScheduledCallCreationMessage.prototype.callType = 0; - ScheduledCallCreationMessage.prototype.title = ""; + ScheduledCallCreationMessage.prototype.scheduledTimestampMs = null; + ScheduledCallCreationMessage.prototype.callType = null; + ScheduledCallCreationMessage.prototype.title = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScheduledCallCreationMessage.prototype, "_scheduledTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["scheduledTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScheduledCallCreationMessage.prototype, "_callType", { + get: $util.oneOfGetter($oneOfFields = ["callType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScheduledCallCreationMessage.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); ScheduledCallCreationMessage.create = function create(properties) { return new ScheduledCallCreationMessage(properties); @@ -23437,6 +52637,75 @@ export const proto = $root.proto = (() => { return m; }; + ScheduledCallCreationMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ScheduledCallCreationMessage) + return d; + var m = new $root.proto.Message.ScheduledCallCreationMessage(); + if (d.scheduledTimestampMs != null) { + if ($util.Long) + (m.scheduledTimestampMs = $util.Long.fromValue(d.scheduledTimestampMs)).unsigned = false; + else if (typeof d.scheduledTimestampMs === "string") + m.scheduledTimestampMs = parseInt(d.scheduledTimestampMs, 10); + else if (typeof d.scheduledTimestampMs === "number") + m.scheduledTimestampMs = d.scheduledTimestampMs; + else if (typeof d.scheduledTimestampMs === "object") + m.scheduledTimestampMs = new $util.LongBits(d.scheduledTimestampMs.low >>> 0, d.scheduledTimestampMs.high >>> 0).toNumber(); + } + switch (d.callType) { + default: + if (typeof d.callType === "number") { + m.callType = d.callType; + break; + } + break; + case "UNKNOWN": + case 0: + m.callType = 0; + break; + case "VOICE": + case 1: + m.callType = 1; + break; + case "VIDEO": + case 2: + m.callType = 2; + break; + } + if (d.title != null) { + m.title = String(d.title); + } + return m; + }; + + ScheduledCallCreationMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.scheduledTimestampMs != null && m.hasOwnProperty("scheduledTimestampMs")) { + if (typeof m.scheduledTimestampMs === "number") + d.scheduledTimestampMs = o.longs === String ? String(m.scheduledTimestampMs) : m.scheduledTimestampMs; + else + d.scheduledTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.scheduledTimestampMs) : o.longs === Number ? new $util.LongBits(m.scheduledTimestampMs.low >>> 0, m.scheduledTimestampMs.high >>> 0).toNumber() : m.scheduledTimestampMs; + if (o.oneofs) + d._scheduledTimestampMs = "scheduledTimestampMs"; + } + if (m.callType != null && m.hasOwnProperty("callType")) { + d.callType = o.enums === String ? $root.proto.Message.ScheduledCallCreationMessage.CallType[m.callType] === undefined ? m.callType : $root.proto.Message.ScheduledCallCreationMessage.CallType[m.callType] : m.callType; + if (o.oneofs) + d._callType = "callType"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + return d; + }; + + ScheduledCallCreationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ScheduledCallCreationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23465,7 +52734,21 @@ export const proto = $root.proto = (() => { } ScheduledCallEditMessage.prototype.key = null; - ScheduledCallEditMessage.prototype.editType = 0; + ScheduledCallEditMessage.prototype.editType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScheduledCallEditMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScheduledCallEditMessage.prototype, "_editType", { + get: $util.oneOfGetter($oneOfFields = ["editType"]), + set: $util.oneOfSetter($oneOfFields) + }); ScheduledCallEditMessage.create = function create(properties) { return new ScheduledCallEditMessage(properties); @@ -23506,6 +52789,55 @@ export const proto = $root.proto = (() => { return m; }; + ScheduledCallEditMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.ScheduledCallEditMessage) + return d; + var m = new $root.proto.Message.ScheduledCallEditMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + switch (d.editType) { + default: + if (typeof d.editType === "number") { + m.editType = d.editType; + break; + } + break; + case "UNKNOWN": + case 0: + m.editType = 0; + break; + case "CANCEL": + case 1: + m.editType = 1; + break; + } + return m; + }; + + ScheduledCallEditMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.editType != null && m.hasOwnProperty("editType")) { + d.editType = o.enums === String ? $root.proto.Message.ScheduledCallEditMessage.EditType[m.editType] === undefined ? m.editType : $root.proto.Message.ScheduledCallEditMessage.EditType[m.editType] : m.editType; + if (o.oneofs) + d._editType = "editType"; + } + return d; + }; + + ScheduledCallEditMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ScheduledCallEditMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23533,9 +52865,35 @@ export const proto = $root.proto = (() => { } SecretEncryptedMessage.prototype.targetMessageKey = null; - SecretEncryptedMessage.prototype.encPayload = $util.newBuffer([]); - SecretEncryptedMessage.prototype.encIv = $util.newBuffer([]); - SecretEncryptedMessage.prototype.secretEncType = 0; + SecretEncryptedMessage.prototype.encPayload = null; + SecretEncryptedMessage.prototype.encIv = null; + SecretEncryptedMessage.prototype.secretEncType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SecretEncryptedMessage.prototype, "_targetMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SecretEncryptedMessage.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SecretEncryptedMessage.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SecretEncryptedMessage.prototype, "_secretEncType", { + get: $util.oneOfGetter($oneOfFields = ["secretEncType"]), + set: $util.oneOfSetter($oneOfFields) + }); SecretEncryptedMessage.create = function create(properties) { return new SecretEncryptedMessage(properties); @@ -23588,6 +52946,81 @@ export const proto = $root.proto = (() => { return m; }; + SecretEncryptedMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.SecretEncryptedMessage) + return d; + var m = new $root.proto.Message.SecretEncryptedMessage(); + if (d.targetMessageKey != null) { + if (typeof d.targetMessageKey !== "object") + throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected"); + m.targetMessageKey = $root.proto.MessageKey.fromObject(d.targetMessageKey); + } + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + switch (d.secretEncType) { + default: + if (typeof d.secretEncType === "number") { + m.secretEncType = d.secretEncType; + break; + } + break; + case "UNKNOWN": + case 0: + m.secretEncType = 0; + break; + case "EVENT_EDIT": + case 1: + m.secretEncType = 1; + break; + case "MESSAGE_EDIT": + case 2: + m.secretEncType = 2; + break; + } + return m; + }; + + SecretEncryptedMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) { + d.targetMessageKey = $root.proto.MessageKey.toObject(m.targetMessageKey, o); + if (o.oneofs) + d._targetMessageKey = "targetMessageKey"; + } + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + if (m.secretEncType != null && m.hasOwnProperty("secretEncType")) { + d.secretEncType = o.enums === String ? $root.proto.Message.SecretEncryptedMessage.SecretEncType[m.secretEncType] === undefined ? m.secretEncType : $root.proto.Message.SecretEncryptedMessage.SecretEncType[m.secretEncType] : m.secretEncType; + if (o.oneofs) + d._secretEncType = "secretEncType"; + } + return d; + }; + + SecretEncryptedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SecretEncryptedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23619,6 +53052,26 @@ export const proto = $root.proto = (() => { SendPaymentMessage.prototype.requestMessageKey = null; SendPaymentMessage.prototype.background = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SendPaymentMessage.prototype, "_noteMessage", { + get: $util.oneOfGetter($oneOfFields = ["noteMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SendPaymentMessage.prototype, "_requestMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["requestMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SendPaymentMessage.prototype, "_background", { + get: $util.oneOfGetter($oneOfFields = ["background"]), + set: $util.oneOfSetter($oneOfFields) + }); + SendPaymentMessage.create = function create(properties) { return new SendPaymentMessage(properties); }; @@ -23664,6 +53117,54 @@ export const proto = $root.proto = (() => { return m; }; + SendPaymentMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.SendPaymentMessage) + return d; + var m = new $root.proto.Message.SendPaymentMessage(); + if (d.noteMessage != null) { + if (typeof d.noteMessage !== "object") + throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected"); + m.noteMessage = $root.proto.Message.fromObject(d.noteMessage); + } + if (d.requestMessageKey != null) { + if (typeof d.requestMessageKey !== "object") + throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected"); + m.requestMessageKey = $root.proto.MessageKey.fromObject(d.requestMessageKey); + } + if (d.background != null) { + if (typeof d.background !== "object") + throw TypeError(".proto.Message.SendPaymentMessage.background: object expected"); + m.background = $root.proto.PaymentBackground.fromObject(d.background); + } + return m; + }; + + SendPaymentMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.noteMessage != null && m.hasOwnProperty("noteMessage")) { + d.noteMessage = $root.proto.Message.toObject(m.noteMessage, o); + if (o.oneofs) + d._noteMessage = "noteMessage"; + } + if (m.requestMessageKey != null && m.hasOwnProperty("requestMessageKey")) { + d.requestMessageKey = $root.proto.MessageKey.toObject(m.requestMessageKey, o); + if (o.oneofs) + d._requestMessageKey = "requestMessageKey"; + } + if (m.background != null && m.hasOwnProperty("background")) { + d.background = $root.proto.PaymentBackground.toObject(m.background, o); + if (o.oneofs) + d._background = "background"; + } + return d; + }; + + SendPaymentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SendPaymentMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23683,8 +53184,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderKeyDistributionMessage.prototype.groupId = ""; - SenderKeyDistributionMessage.prototype.axolotlSenderKeyDistributionMessage = $util.newBuffer([]); + SenderKeyDistributionMessage.prototype.groupId = null; + SenderKeyDistributionMessage.prototype.axolotlSenderKeyDistributionMessage = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyDistributionMessage.prototype, "_groupId", { + get: $util.oneOfGetter($oneOfFields = ["groupId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyDistributionMessage.prototype, "_axolotlSenderKeyDistributionMessage", { + get: $util.oneOfGetter($oneOfFields = ["axolotlSenderKeyDistributionMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); SenderKeyDistributionMessage.create = function create(properties) { return new SenderKeyDistributionMessage(properties); @@ -23725,6 +53240,43 @@ export const proto = $root.proto = (() => { return m; }; + SenderKeyDistributionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.SenderKeyDistributionMessage) + return d; + var m = new $root.proto.Message.SenderKeyDistributionMessage(); + if (d.groupId != null) { + m.groupId = String(d.groupId); + } + if (d.axolotlSenderKeyDistributionMessage != null) { + if (typeof d.axolotlSenderKeyDistributionMessage === "string") + $util.base64.decode(d.axolotlSenderKeyDistributionMessage, m.axolotlSenderKeyDistributionMessage = $util.newBuffer($util.base64.length(d.axolotlSenderKeyDistributionMessage)), 0); + else if (d.axolotlSenderKeyDistributionMessage.length >= 0) + m.axolotlSenderKeyDistributionMessage = d.axolotlSenderKeyDistributionMessage; + } + return m; + }; + + SenderKeyDistributionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.groupId != null && m.hasOwnProperty("groupId")) { + d.groupId = m.groupId; + if (o.oneofs) + d._groupId = "groupId"; + } + if (m.axolotlSenderKeyDistributionMessage != null && m.hasOwnProperty("axolotlSenderKeyDistributionMessage")) { + d.axolotlSenderKeyDistributionMessage = o.bytes === String ? $util.base64.encode(m.axolotlSenderKeyDistributionMessage, 0, m.axolotlSenderKeyDistributionMessage.length) : o.bytes === Array ? Array.prototype.slice.call(m.axolotlSenderKeyDistributionMessage) : m.axolotlSenderKeyDistributionMessage; + if (o.oneofs) + d._axolotlSenderKeyDistributionMessage = "axolotlSenderKeyDistributionMessage"; + } + return d; + }; + + SenderKeyDistributionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderKeyDistributionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23746,7 +53298,27 @@ export const proto = $root.proto = (() => { StatusNotificationMessage.prototype.responseMessageKey = null; StatusNotificationMessage.prototype.originalMessageKey = null; - StatusNotificationMessage.prototype.type = 0; + StatusNotificationMessage.prototype.type = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StatusNotificationMessage.prototype, "_responseMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["responseMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StatusNotificationMessage.prototype, "_originalMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["originalMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StatusNotificationMessage.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); StatusNotificationMessage.create = function create(properties) { return new StatusNotificationMessage(properties); @@ -23793,6 +53365,69 @@ export const proto = $root.proto = (() => { return m; }; + StatusNotificationMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.StatusNotificationMessage) + return d; + var m = new $root.proto.Message.StatusNotificationMessage(); + if (d.responseMessageKey != null) { + if (typeof d.responseMessageKey !== "object") + throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected"); + m.responseMessageKey = $root.proto.MessageKey.fromObject(d.responseMessageKey); + } + if (d.originalMessageKey != null) { + if (typeof d.originalMessageKey !== "object") + throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected"); + m.originalMessageKey = $root.proto.MessageKey.fromObject(d.originalMessageKey); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNKNOWN": + case 0: + m.type = 0; + break; + case "STATUS_ADD_YOURS": + case 1: + m.type = 1; + break; + case "STATUS_RESHARE": + case 2: + m.type = 2; + break; + } + return m; + }; + + StatusNotificationMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.responseMessageKey != null && m.hasOwnProperty("responseMessageKey")) { + d.responseMessageKey = $root.proto.MessageKey.toObject(m.responseMessageKey, o); + if (o.oneofs) + d._responseMessageKey = "responseMessageKey"; + } + if (m.originalMessageKey != null && m.hasOwnProperty("originalMessageKey")) { + d.originalMessageKey = $root.proto.MessageKey.toObject(m.originalMessageKey, o); + if (o.oneofs) + d._originalMessageKey = "originalMessageKey"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.Message.StatusNotificationMessage.StatusNotificationType[m.type] === undefined ? m.type : $root.proto.Message.StatusNotificationMessage.StatusNotificationType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + return d; + }; + + StatusNotificationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StatusNotificationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -23820,26 +53455,148 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - StickerMessage.prototype.url = ""; - StickerMessage.prototype.fileSha256 = $util.newBuffer([]); - StickerMessage.prototype.fileEncSha256 = $util.newBuffer([]); - StickerMessage.prototype.mediaKey = $util.newBuffer([]); - StickerMessage.prototype.mimetype = ""; - StickerMessage.prototype.height = 0; - StickerMessage.prototype.width = 0; - StickerMessage.prototype.directPath = ""; - StickerMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - StickerMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - StickerMessage.prototype.firstFrameLength = 0; - StickerMessage.prototype.firstFrameSidecar = $util.newBuffer([]); - StickerMessage.prototype.isAnimated = false; - StickerMessage.prototype.pngThumbnail = $util.newBuffer([]); + StickerMessage.prototype.url = null; + StickerMessage.prototype.fileSha256 = null; + StickerMessage.prototype.fileEncSha256 = null; + StickerMessage.prototype.mediaKey = null; + StickerMessage.prototype.mimetype = null; + StickerMessage.prototype.height = null; + StickerMessage.prototype.width = null; + StickerMessage.prototype.directPath = null; + StickerMessage.prototype.fileLength = null; + StickerMessage.prototype.mediaKeyTimestamp = null; + StickerMessage.prototype.firstFrameLength = null; + StickerMessage.prototype.firstFrameSidecar = null; + StickerMessage.prototype.isAnimated = null; + StickerMessage.prototype.pngThumbnail = null; StickerMessage.prototype.contextInfo = null; - StickerMessage.prototype.stickerSentTs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - StickerMessage.prototype.isAvatar = false; - StickerMessage.prototype.isAiSticker = false; - StickerMessage.prototype.isLottie = false; - StickerMessage.prototype.accessibilityLabel = ""; + StickerMessage.prototype.stickerSentTs = null; + StickerMessage.prototype.isAvatar = null; + StickerMessage.prototype.isAiSticker = null; + StickerMessage.prototype.isLottie = null; + StickerMessage.prototype.accessibilityLabel = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_firstFrameLength", { + get: $util.oneOfGetter($oneOfFields = ["firstFrameLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_firstFrameSidecar", { + get: $util.oneOfGetter($oneOfFields = ["firstFrameSidecar"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_isAnimated", { + get: $util.oneOfGetter($oneOfFields = ["isAnimated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_pngThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["pngThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_stickerSentTs", { + get: $util.oneOfGetter($oneOfFields = ["stickerSentTs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_isAvatar", { + get: $util.oneOfGetter($oneOfFields = ["isAvatar"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_isAiSticker", { + get: $util.oneOfGetter($oneOfFields = ["isAiSticker"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_isLottie", { + get: $util.oneOfGetter($oneOfFields = ["isLottie"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMessage.prototype, "_accessibilityLabel", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); StickerMessage.create = function create(properties) { return new StickerMessage(properties); @@ -23988,6 +53745,231 @@ export const proto = $root.proto = (() => { return m; }; + StickerMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.StickerMessage) + return d; + var m = new $root.proto.Message.StickerMessage(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.firstFrameLength != null) { + m.firstFrameLength = d.firstFrameLength >>> 0; + } + if (d.firstFrameSidecar != null) { + if (typeof d.firstFrameSidecar === "string") + $util.base64.decode(d.firstFrameSidecar, m.firstFrameSidecar = $util.newBuffer($util.base64.length(d.firstFrameSidecar)), 0); + else if (d.firstFrameSidecar.length >= 0) + m.firstFrameSidecar = d.firstFrameSidecar; + } + if (d.isAnimated != null) { + m.isAnimated = Boolean(d.isAnimated); + } + if (d.pngThumbnail != null) { + if (typeof d.pngThumbnail === "string") + $util.base64.decode(d.pngThumbnail, m.pngThumbnail = $util.newBuffer($util.base64.length(d.pngThumbnail)), 0); + else if (d.pngThumbnail.length >= 0) + m.pngThumbnail = d.pngThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.stickerSentTs != null) { + if ($util.Long) + (m.stickerSentTs = $util.Long.fromValue(d.stickerSentTs)).unsigned = false; + else if (typeof d.stickerSentTs === "string") + m.stickerSentTs = parseInt(d.stickerSentTs, 10); + else if (typeof d.stickerSentTs === "number") + m.stickerSentTs = d.stickerSentTs; + else if (typeof d.stickerSentTs === "object") + m.stickerSentTs = new $util.LongBits(d.stickerSentTs.low >>> 0, d.stickerSentTs.high >>> 0).toNumber(); + } + if (d.isAvatar != null) { + m.isAvatar = Boolean(d.isAvatar); + } + if (d.isAiSticker != null) { + m.isAiSticker = Boolean(d.isAiSticker); + } + if (d.isLottie != null) { + m.isLottie = Boolean(d.isLottie); + } + if (d.accessibilityLabel != null) { + m.accessibilityLabel = String(d.accessibilityLabel); + } + return m; + }; + + StickerMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.firstFrameLength != null && m.hasOwnProperty("firstFrameLength")) { + d.firstFrameLength = m.firstFrameLength; + if (o.oneofs) + d._firstFrameLength = "firstFrameLength"; + } + if (m.firstFrameSidecar != null && m.hasOwnProperty("firstFrameSidecar")) { + d.firstFrameSidecar = o.bytes === String ? $util.base64.encode(m.firstFrameSidecar, 0, m.firstFrameSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.firstFrameSidecar) : m.firstFrameSidecar; + if (o.oneofs) + d._firstFrameSidecar = "firstFrameSidecar"; + } + if (m.isAnimated != null && m.hasOwnProperty("isAnimated")) { + d.isAnimated = m.isAnimated; + if (o.oneofs) + d._isAnimated = "isAnimated"; + } + if (m.pngThumbnail != null && m.hasOwnProperty("pngThumbnail")) { + d.pngThumbnail = o.bytes === String ? $util.base64.encode(m.pngThumbnail, 0, m.pngThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.pngThumbnail) : m.pngThumbnail; + if (o.oneofs) + d._pngThumbnail = "pngThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.stickerSentTs != null && m.hasOwnProperty("stickerSentTs")) { + if (typeof m.stickerSentTs === "number") + d.stickerSentTs = o.longs === String ? String(m.stickerSentTs) : m.stickerSentTs; + else + d.stickerSentTs = o.longs === String ? $util.Long.prototype.toString.call(m.stickerSentTs) : o.longs === Number ? new $util.LongBits(m.stickerSentTs.low >>> 0, m.stickerSentTs.high >>> 0).toNumber() : m.stickerSentTs; + if (o.oneofs) + d._stickerSentTs = "stickerSentTs"; + } + if (m.isAvatar != null && m.hasOwnProperty("isAvatar")) { + d.isAvatar = m.isAvatar; + if (o.oneofs) + d._isAvatar = "isAvatar"; + } + if (m.isAiSticker != null && m.hasOwnProperty("isAiSticker")) { + d.isAiSticker = m.isAiSticker; + if (o.oneofs) + d._isAiSticker = "isAiSticker"; + } + if (m.isLottie != null && m.hasOwnProperty("isLottie")) { + d.isLottie = m.isLottie; + if (o.oneofs) + d._isLottie = "isLottie"; + } + if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) { + d.accessibilityLabel = m.accessibilityLabel; + if (o.oneofs) + d._accessibilityLabel = "accessibilityLabel"; + } + return d; + }; + + StickerMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StickerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24008,28 +53990,156 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - StickerPackMessage.prototype.stickerPackId = ""; - StickerPackMessage.prototype.name = ""; - StickerPackMessage.prototype.publisher = ""; + StickerPackMessage.prototype.stickerPackId = null; + StickerPackMessage.prototype.name = null; + StickerPackMessage.prototype.publisher = null; StickerPackMessage.prototype.stickers = $util.emptyArray; - StickerPackMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - StickerPackMessage.prototype.fileSha256 = $util.newBuffer([]); - StickerPackMessage.prototype.fileEncSha256 = $util.newBuffer([]); - StickerPackMessage.prototype.mediaKey = $util.newBuffer([]); - StickerPackMessage.prototype.directPath = ""; - StickerPackMessage.prototype.caption = ""; + StickerPackMessage.prototype.fileLength = null; + StickerPackMessage.prototype.fileSha256 = null; + StickerPackMessage.prototype.fileEncSha256 = null; + StickerPackMessage.prototype.mediaKey = null; + StickerPackMessage.prototype.directPath = null; + StickerPackMessage.prototype.caption = null; StickerPackMessage.prototype.contextInfo = null; - StickerPackMessage.prototype.packDescription = ""; - StickerPackMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - StickerPackMessage.prototype.trayIconFileName = ""; - StickerPackMessage.prototype.thumbnailDirectPath = ""; - StickerPackMessage.prototype.thumbnailSha256 = $util.newBuffer([]); - StickerPackMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); - StickerPackMessage.prototype.thumbnailHeight = 0; - StickerPackMessage.prototype.thumbnailWidth = 0; - StickerPackMessage.prototype.imageDataHash = ""; - StickerPackMessage.prototype.stickerPackSize = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - StickerPackMessage.prototype.stickerPackOrigin = 0; + StickerPackMessage.prototype.packDescription = null; + StickerPackMessage.prototype.mediaKeyTimestamp = null; + StickerPackMessage.prototype.trayIconFileName = null; + StickerPackMessage.prototype.thumbnailDirectPath = null; + StickerPackMessage.prototype.thumbnailSha256 = null; + StickerPackMessage.prototype.thumbnailEncSha256 = null; + StickerPackMessage.prototype.thumbnailHeight = null; + StickerPackMessage.prototype.thumbnailWidth = null; + StickerPackMessage.prototype.imageDataHash = null; + StickerPackMessage.prototype.stickerPackSize = null; + StickerPackMessage.prototype.stickerPackOrigin = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_stickerPackId", { + get: $util.oneOfGetter($oneOfFields = ["stickerPackId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_publisher", { + get: $util.oneOfGetter($oneOfFields = ["publisher"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_packDescription", { + get: $util.oneOfGetter($oneOfFields = ["packDescription"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_trayIconFileName", { + get: $util.oneOfGetter($oneOfFields = ["trayIconFileName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_thumbnailDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_thumbnailSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_thumbnailEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_thumbnailHeight", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_thumbnailWidth", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailWidth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_imageDataHash", { + get: $util.oneOfGetter($oneOfFields = ["imageDataHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_stickerPackSize", { + get: $util.oneOfGetter($oneOfFields = ["stickerPackSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerPackMessage.prototype, "_stickerPackOrigin", { + get: $util.oneOfGetter($oneOfFields = ["stickerPackOrigin"]), + set: $util.oneOfSetter($oneOfFields) + }); StickerPackMessage.create = function create(properties) { return new StickerPackMessage(properties); @@ -24194,6 +54304,275 @@ export const proto = $root.proto = (() => { return m; }; + StickerPackMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.StickerPackMessage) + return d; + var m = new $root.proto.Message.StickerPackMessage(); + if (d.stickerPackId != null) { + m.stickerPackId = String(d.stickerPackId); + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.publisher != null) { + m.publisher = String(d.publisher); + } + if (d.stickers) { + if (!Array.isArray(d.stickers)) + throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected"); + m.stickers = []; + for (var i = 0; i < d.stickers.length; ++i) { + if (typeof d.stickers[i] !== "object") + throw TypeError(".proto.Message.StickerPackMessage.stickers: object expected"); + m.stickers[i] = $root.proto.Message.StickerPackMessage.Sticker.fromObject(d.stickers[i]); + } + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.packDescription != null) { + m.packDescription = String(d.packDescription); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.trayIconFileName != null) { + m.trayIconFileName = String(d.trayIconFileName); + } + if (d.thumbnailDirectPath != null) { + m.thumbnailDirectPath = String(d.thumbnailDirectPath); + } + if (d.thumbnailSha256 != null) { + if (typeof d.thumbnailSha256 === "string") + $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0); + else if (d.thumbnailSha256.length >= 0) + m.thumbnailSha256 = d.thumbnailSha256; + } + if (d.thumbnailEncSha256 != null) { + if (typeof d.thumbnailEncSha256 === "string") + $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0); + else if (d.thumbnailEncSha256.length >= 0) + m.thumbnailEncSha256 = d.thumbnailEncSha256; + } + if (d.thumbnailHeight != null) { + m.thumbnailHeight = d.thumbnailHeight >>> 0; + } + if (d.thumbnailWidth != null) { + m.thumbnailWidth = d.thumbnailWidth >>> 0; + } + if (d.imageDataHash != null) { + m.imageDataHash = String(d.imageDataHash); + } + if (d.stickerPackSize != null) { + if ($util.Long) + (m.stickerPackSize = $util.Long.fromValue(d.stickerPackSize)).unsigned = true; + else if (typeof d.stickerPackSize === "string") + m.stickerPackSize = parseInt(d.stickerPackSize, 10); + else if (typeof d.stickerPackSize === "number") + m.stickerPackSize = d.stickerPackSize; + else if (typeof d.stickerPackSize === "object") + m.stickerPackSize = new $util.LongBits(d.stickerPackSize.low >>> 0, d.stickerPackSize.high >>> 0).toNumber(true); + } + switch (d.stickerPackOrigin) { + default: + if (typeof d.stickerPackOrigin === "number") { + m.stickerPackOrigin = d.stickerPackOrigin; + break; + } + break; + case "FIRST_PARTY": + case 0: + m.stickerPackOrigin = 0; + break; + case "THIRD_PARTY": + case 1: + m.stickerPackOrigin = 1; + break; + case "USER_CREATED": + case 2: + m.stickerPackOrigin = 2; + break; + } + return m; + }; + + StickerPackMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.stickers = []; + } + if (m.stickerPackId != null && m.hasOwnProperty("stickerPackId")) { + d.stickerPackId = m.stickerPackId; + if (o.oneofs) + d._stickerPackId = "stickerPackId"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.publisher != null && m.hasOwnProperty("publisher")) { + d.publisher = m.publisher; + if (o.oneofs) + d._publisher = "publisher"; + } + if (m.stickers && m.stickers.length) { + d.stickers = []; + for (var j = 0; j < m.stickers.length; ++j) { + d.stickers[j] = $root.proto.Message.StickerPackMessage.Sticker.toObject(m.stickers[j], o); + } + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.packDescription != null && m.hasOwnProperty("packDescription")) { + d.packDescription = m.packDescription; + if (o.oneofs) + d._packDescription = "packDescription"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.trayIconFileName != null && m.hasOwnProperty("trayIconFileName")) { + d.trayIconFileName = m.trayIconFileName; + if (o.oneofs) + d._trayIconFileName = "trayIconFileName"; + } + if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) { + d.thumbnailDirectPath = m.thumbnailDirectPath; + if (o.oneofs) + d._thumbnailDirectPath = "thumbnailDirectPath"; + } + if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) { + d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256; + if (o.oneofs) + d._thumbnailSha256 = "thumbnailSha256"; + } + if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) { + d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256; + if (o.oneofs) + d._thumbnailEncSha256 = "thumbnailEncSha256"; + } + if (m.thumbnailHeight != null && m.hasOwnProperty("thumbnailHeight")) { + d.thumbnailHeight = m.thumbnailHeight; + if (o.oneofs) + d._thumbnailHeight = "thumbnailHeight"; + } + if (m.thumbnailWidth != null && m.hasOwnProperty("thumbnailWidth")) { + d.thumbnailWidth = m.thumbnailWidth; + if (o.oneofs) + d._thumbnailWidth = "thumbnailWidth"; + } + if (m.imageDataHash != null && m.hasOwnProperty("imageDataHash")) { + d.imageDataHash = m.imageDataHash; + if (o.oneofs) + d._imageDataHash = "imageDataHash"; + } + if (m.stickerPackSize != null && m.hasOwnProperty("stickerPackSize")) { + if (typeof m.stickerPackSize === "number") + d.stickerPackSize = o.longs === String ? String(m.stickerPackSize) : m.stickerPackSize; + else + d.stickerPackSize = o.longs === String ? $util.Long.prototype.toString.call(m.stickerPackSize) : o.longs === Number ? new $util.LongBits(m.stickerPackSize.low >>> 0, m.stickerPackSize.high >>> 0).toNumber(true) : m.stickerPackSize; + if (o.oneofs) + d._stickerPackSize = "stickerPackSize"; + } + if (m.stickerPackOrigin != null && m.hasOwnProperty("stickerPackOrigin")) { + d.stickerPackOrigin = o.enums === String ? $root.proto.Message.StickerPackMessage.StickerPackOrigin[m.stickerPackOrigin] === undefined ? m.stickerPackOrigin : $root.proto.Message.StickerPackMessage.StickerPackOrigin[m.stickerPackOrigin] : m.stickerPackOrigin; + if (o.oneofs) + d._stickerPackOrigin = "stickerPackOrigin"; + } + return d; + }; + + StickerPackMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StickerPackMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24211,12 +54590,44 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Sticker.prototype.fileName = ""; - Sticker.prototype.isAnimated = false; + Sticker.prototype.fileName = null; + Sticker.prototype.isAnimated = null; Sticker.prototype.emojis = $util.emptyArray; - Sticker.prototype.accessibilityLabel = ""; - Sticker.prototype.isLottie = false; - Sticker.prototype.mimetype = ""; + Sticker.prototype.accessibilityLabel = null; + Sticker.prototype.isLottie = null; + Sticker.prototype.mimetype = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Sticker.prototype, "_fileName", { + get: $util.oneOfGetter($oneOfFields = ["fileName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Sticker.prototype, "_isAnimated", { + get: $util.oneOfGetter($oneOfFields = ["isAnimated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Sticker.prototype, "_accessibilityLabel", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Sticker.prototype, "_isLottie", { + get: $util.oneOfGetter($oneOfFields = ["isLottie"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Sticker.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); Sticker.create = function create(properties) { return new Sticker(properties); @@ -24285,6 +54696,81 @@ export const proto = $root.proto = (() => { return m; }; + Sticker.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.StickerPackMessage.Sticker) + return d; + var m = new $root.proto.Message.StickerPackMessage.Sticker(); + if (d.fileName != null) { + m.fileName = String(d.fileName); + } + if (d.isAnimated != null) { + m.isAnimated = Boolean(d.isAnimated); + } + if (d.emojis) { + if (!Array.isArray(d.emojis)) + throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected"); + m.emojis = []; + for (var i = 0; i < d.emojis.length; ++i) { + m.emojis[i] = String(d.emojis[i]); + } + } + if (d.accessibilityLabel != null) { + m.accessibilityLabel = String(d.accessibilityLabel); + } + if (d.isLottie != null) { + m.isLottie = Boolean(d.isLottie); + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + return m; + }; + + Sticker.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.emojis = []; + } + if (m.fileName != null && m.hasOwnProperty("fileName")) { + d.fileName = m.fileName; + if (o.oneofs) + d._fileName = "fileName"; + } + if (m.isAnimated != null && m.hasOwnProperty("isAnimated")) { + d.isAnimated = m.isAnimated; + if (o.oneofs) + d._isAnimated = "isAnimated"; + } + if (m.emojis && m.emojis.length) { + d.emojis = []; + for (var j = 0; j < m.emojis.length; ++j) { + d.emojis[j] = m.emojis[j]; + } + } + if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) { + d.accessibilityLabel = m.accessibilityLabel; + if (o.oneofs) + d._accessibilityLabel = "accessibilityLabel"; + } + if (m.isLottie != null && m.hasOwnProperty("isLottie")) { + d.isLottie = m.isLottie; + if (o.oneofs) + d._isLottie = "isLottie"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + return d; + }; + + Sticker.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Sticker.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24317,8 +54803,22 @@ export const proto = $root.proto = (() => { } StickerSyncRMRMessage.prototype.filehash = $util.emptyArray; - StickerSyncRMRMessage.prototype.rmrSource = ""; - StickerSyncRMRMessage.prototype.requestTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + StickerSyncRMRMessage.prototype.rmrSource = null; + StickerSyncRMRMessage.prototype.requestTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerSyncRMRMessage.prototype, "_rmrSource", { + get: $util.oneOfGetter($oneOfFields = ["rmrSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerSyncRMRMessage.prototype, "_requestTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["requestTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); StickerSyncRMRMessage.create = function create(properties) { return new StickerSyncRMRMessage(properties); @@ -24369,6 +54869,67 @@ export const proto = $root.proto = (() => { return m; }; + StickerSyncRMRMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.StickerSyncRMRMessage) + return d; + var m = new $root.proto.Message.StickerSyncRMRMessage(); + if (d.filehash) { + if (!Array.isArray(d.filehash)) + throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected"); + m.filehash = []; + for (var i = 0; i < d.filehash.length; ++i) { + m.filehash[i] = String(d.filehash[i]); + } + } + if (d.rmrSource != null) { + m.rmrSource = String(d.rmrSource); + } + if (d.requestTimestamp != null) { + if ($util.Long) + (m.requestTimestamp = $util.Long.fromValue(d.requestTimestamp)).unsigned = false; + else if (typeof d.requestTimestamp === "string") + m.requestTimestamp = parseInt(d.requestTimestamp, 10); + else if (typeof d.requestTimestamp === "number") + m.requestTimestamp = d.requestTimestamp; + else if (typeof d.requestTimestamp === "object") + m.requestTimestamp = new $util.LongBits(d.requestTimestamp.low >>> 0, d.requestTimestamp.high >>> 0).toNumber(); + } + return m; + }; + + StickerSyncRMRMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.filehash = []; + } + if (m.filehash && m.filehash.length) { + d.filehash = []; + for (var j = 0; j < m.filehash.length; ++j) { + d.filehash[j] = m.filehash[j]; + } + } + if (m.rmrSource != null && m.hasOwnProperty("rmrSource")) { + d.rmrSource = m.rmrSource; + if (o.oneofs) + d._rmrSource = "rmrSource"; + } + if (m.requestTimestamp != null && m.hasOwnProperty("requestTimestamp")) { + if (typeof m.requestTimestamp === "number") + d.requestTimestamp = o.longs === String ? String(m.requestTimestamp) : m.requestTimestamp; + else + d.requestTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.requestTimestamp) : o.longs === Number ? new $util.LongBits(m.requestTimestamp.low >>> 0, m.requestTimestamp.high >>> 0).toNumber() : m.requestTimestamp; + if (o.oneofs) + d._requestTimestamp = "requestTimestamp"; + } + return d; + }; + + StickerSyncRMRMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StickerSyncRMRMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24388,11 +54949,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - TemplateButtonReplyMessage.prototype.selectedId = ""; - TemplateButtonReplyMessage.prototype.selectedDisplayText = ""; + TemplateButtonReplyMessage.prototype.selectedId = null; + TemplateButtonReplyMessage.prototype.selectedDisplayText = null; TemplateButtonReplyMessage.prototype.contextInfo = null; - TemplateButtonReplyMessage.prototype.selectedIndex = 0; - TemplateButtonReplyMessage.prototype.selectedCarouselCardIndex = 0; + TemplateButtonReplyMessage.prototype.selectedIndex = null; + TemplateButtonReplyMessage.prototype.selectedCarouselCardIndex = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedId", { + get: $util.oneOfGetter($oneOfFields = ["selectedId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedDisplayText", { + get: $util.oneOfGetter($oneOfFields = ["selectedDisplayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateButtonReplyMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedIndex", { + get: $util.oneOfGetter($oneOfFields = ["selectedIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateButtonReplyMessage.prototype, "_selectedCarouselCardIndex", { + get: $util.oneOfGetter($oneOfFields = ["selectedCarouselCardIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); TemplateButtonReplyMessage.create = function create(properties) { return new TemplateButtonReplyMessage(properties); @@ -24451,6 +55044,66 @@ export const proto = $root.proto = (() => { return m; }; + TemplateButtonReplyMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.TemplateButtonReplyMessage) + return d; + var m = new $root.proto.Message.TemplateButtonReplyMessage(); + if (d.selectedId != null) { + m.selectedId = String(d.selectedId); + } + if (d.selectedDisplayText != null) { + m.selectedDisplayText = String(d.selectedDisplayText); + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.selectedIndex != null) { + m.selectedIndex = d.selectedIndex >>> 0; + } + if (d.selectedCarouselCardIndex != null) { + m.selectedCarouselCardIndex = d.selectedCarouselCardIndex >>> 0; + } + return m; + }; + + TemplateButtonReplyMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.selectedId != null && m.hasOwnProperty("selectedId")) { + d.selectedId = m.selectedId; + if (o.oneofs) + d._selectedId = "selectedId"; + } + if (m.selectedDisplayText != null && m.hasOwnProperty("selectedDisplayText")) { + d.selectedDisplayText = m.selectedDisplayText; + if (o.oneofs) + d._selectedDisplayText = "selectedDisplayText"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.selectedIndex != null && m.hasOwnProperty("selectedIndex")) { + d.selectedIndex = m.selectedIndex; + if (o.oneofs) + d._selectedIndex = "selectedIndex"; + } + if (m.selectedCarouselCardIndex != null && m.hasOwnProperty("selectedCarouselCardIndex")) { + d.selectedCarouselCardIndex = m.selectedCarouselCardIndex; + if (o.oneofs) + d._selectedCarouselCardIndex = "selectedCarouselCardIndex"; + } + return d; + }; + + TemplateButtonReplyMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TemplateButtonReplyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24472,13 +55125,31 @@ export const proto = $root.proto = (() => { TemplateMessage.prototype.contextInfo = null; TemplateMessage.prototype.hydratedTemplate = null; - TemplateMessage.prototype.templateId = ""; + TemplateMessage.prototype.templateId = null; TemplateMessage.prototype.fourRowTemplate = null; TemplateMessage.prototype.hydratedFourRowTemplate = null; TemplateMessage.prototype.interactiveMessageTemplate = null; let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateMessage.prototype, "_hydratedTemplate", { + get: $util.oneOfGetter($oneOfFields = ["hydratedTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateMessage.prototype, "_templateId", { + get: $util.oneOfGetter($oneOfFields = ["templateId"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(TemplateMessage.prototype, "format", { get: $util.oneOfGetter($oneOfFields = ["fourRowTemplate", "hydratedFourRowTemplate", "interactiveMessageTemplate"]), set: $util.oneOfSetter($oneOfFields) @@ -24547,6 +55218,82 @@ export const proto = $root.proto = (() => { return m; }; + TemplateMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.TemplateMessage) + return d; + var m = new $root.proto.Message.TemplateMessage(); + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.hydratedTemplate != null) { + if (typeof d.hydratedTemplate !== "object") + throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected"); + m.hydratedTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(d.hydratedTemplate); + } + if (d.templateId != null) { + m.templateId = String(d.templateId); + } + if (d.fourRowTemplate != null) { + if (typeof d.fourRowTemplate !== "object") + throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected"); + m.fourRowTemplate = $root.proto.Message.TemplateMessage.FourRowTemplate.fromObject(d.fourRowTemplate); + } + if (d.hydratedFourRowTemplate != null) { + if (typeof d.hydratedFourRowTemplate !== "object") + throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected"); + m.hydratedFourRowTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(d.hydratedFourRowTemplate); + } + if (d.interactiveMessageTemplate != null) { + if (typeof d.interactiveMessageTemplate !== "object") + throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected"); + m.interactiveMessageTemplate = $root.proto.Message.InteractiveMessage.fromObject(d.interactiveMessageTemplate); + } + return m; + }; + + TemplateMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fourRowTemplate != null && m.hasOwnProperty("fourRowTemplate")) { + d.fourRowTemplate = $root.proto.Message.TemplateMessage.FourRowTemplate.toObject(m.fourRowTemplate, o); + if (o.oneofs) + d.format = "fourRowTemplate"; + } + if (m.hydratedFourRowTemplate != null && m.hasOwnProperty("hydratedFourRowTemplate")) { + d.hydratedFourRowTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(m.hydratedFourRowTemplate, o); + if (o.oneofs) + d.format = "hydratedFourRowTemplate"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.hydratedTemplate != null && m.hasOwnProperty("hydratedTemplate")) { + d.hydratedTemplate = $root.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(m.hydratedTemplate, o); + if (o.oneofs) + d._hydratedTemplate = "hydratedTemplate"; + } + if (m.interactiveMessageTemplate != null && m.hasOwnProperty("interactiveMessageTemplate")) { + d.interactiveMessageTemplate = $root.proto.Message.InteractiveMessage.toObject(m.interactiveMessageTemplate, o); + if (o.oneofs) + d.format = "interactiveMessageTemplate"; + } + if (m.templateId != null && m.hasOwnProperty("templateId")) { + d.templateId = m.templateId; + if (o.oneofs) + d._templateId = "templateId"; + } + return d; + }; + + TemplateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TemplateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24575,6 +55322,18 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(FourRowTemplate.prototype, "_content", { + get: $util.oneOfGetter($oneOfFields = ["content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FourRowTemplate.prototype, "_footer", { + get: $util.oneOfGetter($oneOfFields = ["footer"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(FourRowTemplate.prototype, "title", { get: $util.oneOfGetter($oneOfFields = ["documentMessage", "highlyStructuredMessage", "imageMessage", "videoMessage", "locationMessage"]), set: $util.oneOfSetter($oneOfFields) @@ -24659,6 +55418,113 @@ export const proto = $root.proto = (() => { return m; }; + FourRowTemplate.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.TemplateMessage.FourRowTemplate) + return d; + var m = new $root.proto.Message.TemplateMessage.FourRowTemplate(); + if (d.content != null) { + if (typeof d.content !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected"); + m.content = $root.proto.Message.HighlyStructuredMessage.fromObject(d.content); + } + if (d.footer != null) { + if (typeof d.footer !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected"); + m.footer = $root.proto.Message.HighlyStructuredMessage.fromObject(d.footer); + } + if (d.buttons) { + if (!Array.isArray(d.buttons)) + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected"); + m.buttons = []; + for (var i = 0; i < d.buttons.length; ++i) { + if (typeof d.buttons[i] !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: object expected"); + m.buttons[i] = $root.proto.TemplateButton.fromObject(d.buttons[i]); + } + } + if (d.documentMessage != null) { + if (typeof d.documentMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.documentMessage: object expected"); + m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage); + } + if (d.highlyStructuredMessage != null) { + if (typeof d.highlyStructuredMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.highlyStructuredMessage: object expected"); + m.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.fromObject(d.highlyStructuredMessage); + } + if (d.imageMessage != null) { + if (typeof d.imageMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.imageMessage: object expected"); + m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage); + } + if (d.videoMessage != null) { + if (typeof d.videoMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.videoMessage: object expected"); + m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage); + } + if (d.locationMessage != null) { + if (typeof d.locationMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.locationMessage: object expected"); + m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage); + } + return m; + }; + + FourRowTemplate.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.buttons = []; + } + if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) { + d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o); + if (o.oneofs) + d.title = "documentMessage"; + } + if (m.highlyStructuredMessage != null && m.hasOwnProperty("highlyStructuredMessage")) { + d.highlyStructuredMessage = $root.proto.Message.HighlyStructuredMessage.toObject(m.highlyStructuredMessage, o); + if (o.oneofs) + d.title = "highlyStructuredMessage"; + } + if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) { + d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o); + if (o.oneofs) + d.title = "imageMessage"; + } + if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) { + d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o); + if (o.oneofs) + d.title = "videoMessage"; + } + if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) { + d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o); + if (o.oneofs) + d.title = "locationMessage"; + } + if (m.content != null && m.hasOwnProperty("content")) { + d.content = $root.proto.Message.HighlyStructuredMessage.toObject(m.content, o); + if (o.oneofs) + d._content = "content"; + } + if (m.footer != null && m.hasOwnProperty("footer")) { + d.footer = $root.proto.Message.HighlyStructuredMessage.toObject(m.footer, o); + if (o.oneofs) + d._footer = "footer"; + } + if (m.buttons && m.buttons.length) { + d.buttons = []; + for (var j = 0; j < m.buttons.length; ++j) { + d.buttons[j] = $root.proto.TemplateButton.toObject(m.buttons[j], o); + } + } + return d; + }; + + FourRowTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FourRowTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24679,11 +55545,11 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - HydratedFourRowTemplate.prototype.hydratedContentText = ""; - HydratedFourRowTemplate.prototype.hydratedFooterText = ""; + HydratedFourRowTemplate.prototype.hydratedContentText = null; + HydratedFourRowTemplate.prototype.hydratedFooterText = null; HydratedFourRowTemplate.prototype.hydratedButtons = $util.emptyArray; - HydratedFourRowTemplate.prototype.templateId = ""; - HydratedFourRowTemplate.prototype.maskLinkedDevices = false; + HydratedFourRowTemplate.prototype.templateId = null; + HydratedFourRowTemplate.prototype.maskLinkedDevices = null; HydratedFourRowTemplate.prototype.documentMessage = null; HydratedFourRowTemplate.prototype.hydratedTitleText = null; HydratedFourRowTemplate.prototype.imageMessage = null; @@ -24692,6 +55558,30 @@ export const proto = $root.proto = (() => { let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedFourRowTemplate.prototype, "_hydratedContentText", { + get: $util.oneOfGetter($oneOfFields = ["hydratedContentText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedFourRowTemplate.prototype, "_hydratedFooterText", { + get: $util.oneOfGetter($oneOfFields = ["hydratedFooterText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedFourRowTemplate.prototype, "_templateId", { + get: $util.oneOfGetter($oneOfFields = ["templateId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HydratedFourRowTemplate.prototype, "_maskLinkedDevices", { + get: $util.oneOfGetter($oneOfFields = ["maskLinkedDevices"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(HydratedFourRowTemplate.prototype, "title", { get: $util.oneOfGetter($oneOfFields = ["documentMessage", "hydratedTitleText", "imageMessage", "videoMessage", "locationMessage"]), set: $util.oneOfSetter($oneOfFields) @@ -24788,6 +55678,123 @@ export const proto = $root.proto = (() => { return m; }; + HydratedFourRowTemplate.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.TemplateMessage.HydratedFourRowTemplate) + return d; + var m = new $root.proto.Message.TemplateMessage.HydratedFourRowTemplate(); + if (d.hydratedContentText != null) { + m.hydratedContentText = String(d.hydratedContentText); + } + if (d.hydratedFooterText != null) { + m.hydratedFooterText = String(d.hydratedFooterText); + } + if (d.hydratedButtons) { + if (!Array.isArray(d.hydratedButtons)) + throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected"); + m.hydratedButtons = []; + for (var i = 0; i < d.hydratedButtons.length; ++i) { + if (typeof d.hydratedButtons[i] !== "object") + throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: object expected"); + m.hydratedButtons[i] = $root.proto.HydratedTemplateButton.fromObject(d.hydratedButtons[i]); + } + } + if (d.templateId != null) { + m.templateId = String(d.templateId); + } + if (d.maskLinkedDevices != null) { + m.maskLinkedDevices = Boolean(d.maskLinkedDevices); + } + if (d.documentMessage != null) { + if (typeof d.documentMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.documentMessage: object expected"); + m.documentMessage = $root.proto.Message.DocumentMessage.fromObject(d.documentMessage); + } + if (d.hydratedTitleText != null) { + m.hydratedTitleText = String(d.hydratedTitleText); + } + if (d.imageMessage != null) { + if (typeof d.imageMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.imageMessage: object expected"); + m.imageMessage = $root.proto.Message.ImageMessage.fromObject(d.imageMessage); + } + if (d.videoMessage != null) { + if (typeof d.videoMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.videoMessage: object expected"); + m.videoMessage = $root.proto.Message.VideoMessage.fromObject(d.videoMessage); + } + if (d.locationMessage != null) { + if (typeof d.locationMessage !== "object") + throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.locationMessage: object expected"); + m.locationMessage = $root.proto.Message.LocationMessage.fromObject(d.locationMessage); + } + return m; + }; + + HydratedFourRowTemplate.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.hydratedButtons = []; + } + if (m.documentMessage != null && m.hasOwnProperty("documentMessage")) { + d.documentMessage = $root.proto.Message.DocumentMessage.toObject(m.documentMessage, o); + if (o.oneofs) + d.title = "documentMessage"; + } + if (m.hydratedTitleText != null && m.hasOwnProperty("hydratedTitleText")) { + d.hydratedTitleText = m.hydratedTitleText; + if (o.oneofs) + d.title = "hydratedTitleText"; + } + if (m.imageMessage != null && m.hasOwnProperty("imageMessage")) { + d.imageMessage = $root.proto.Message.ImageMessage.toObject(m.imageMessage, o); + if (o.oneofs) + d.title = "imageMessage"; + } + if (m.videoMessage != null && m.hasOwnProperty("videoMessage")) { + d.videoMessage = $root.proto.Message.VideoMessage.toObject(m.videoMessage, o); + if (o.oneofs) + d.title = "videoMessage"; + } + if (m.locationMessage != null && m.hasOwnProperty("locationMessage")) { + d.locationMessage = $root.proto.Message.LocationMessage.toObject(m.locationMessage, o); + if (o.oneofs) + d.title = "locationMessage"; + } + if (m.hydratedContentText != null && m.hasOwnProperty("hydratedContentText")) { + d.hydratedContentText = m.hydratedContentText; + if (o.oneofs) + d._hydratedContentText = "hydratedContentText"; + } + if (m.hydratedFooterText != null && m.hasOwnProperty("hydratedFooterText")) { + d.hydratedFooterText = m.hydratedFooterText; + if (o.oneofs) + d._hydratedFooterText = "hydratedFooterText"; + } + if (m.hydratedButtons && m.hydratedButtons.length) { + d.hydratedButtons = []; + for (var j = 0; j < m.hydratedButtons.length; ++j) { + d.hydratedButtons[j] = $root.proto.HydratedTemplateButton.toObject(m.hydratedButtons[j], o); + } + } + if (m.templateId != null && m.hasOwnProperty("templateId")) { + d.templateId = m.templateId; + if (o.oneofs) + d._templateId = "templateId"; + } + if (m.maskLinkedDevices != null && m.hasOwnProperty("maskLinkedDevices")) { + d.maskLinkedDevices = m.maskLinkedDevices; + if (o.oneofs) + d._maskLinkedDevices = "maskLinkedDevices"; + } + return d; + }; + + HydratedFourRowTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HydratedFourRowTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24810,7 +55817,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - URLMetadata.prototype.fbExperimentId = 0; + URLMetadata.prototype.fbExperimentId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(URLMetadata.prototype, "_fbExperimentId", { + get: $util.oneOfGetter($oneOfFields = ["fbExperimentId"]), + set: $util.oneOfSetter($oneOfFields) + }); URLMetadata.create = function create(properties) { return new URLMetadata(properties); @@ -24845,6 +55860,32 @@ export const proto = $root.proto = (() => { return m; }; + URLMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.URLMetadata) + return d; + var m = new $root.proto.Message.URLMetadata(); + if (d.fbExperimentId != null) { + m.fbExperimentId = d.fbExperimentId >>> 0; + } + return m; + }; + + URLMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fbExperimentId != null && m.hasOwnProperty("fbExperimentId")) { + d.fbExperimentId = m.fbExperimentId; + if (o.oneofs) + d._fbExperimentId = "fbExperimentId"; + } + return d; + }; + + URLMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + URLMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -24867,33 +55908,179 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - VideoMessage.prototype.url = ""; - VideoMessage.prototype.mimetype = ""; - VideoMessage.prototype.fileSha256 = $util.newBuffer([]); - VideoMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - VideoMessage.prototype.seconds = 0; - VideoMessage.prototype.mediaKey = $util.newBuffer([]); - VideoMessage.prototype.caption = ""; - VideoMessage.prototype.gifPlayback = false; - VideoMessage.prototype.height = 0; - VideoMessage.prototype.width = 0; - VideoMessage.prototype.fileEncSha256 = $util.newBuffer([]); + VideoMessage.prototype.url = null; + VideoMessage.prototype.mimetype = null; + VideoMessage.prototype.fileSha256 = null; + VideoMessage.prototype.fileLength = null; + VideoMessage.prototype.seconds = null; + VideoMessage.prototype.mediaKey = null; + VideoMessage.prototype.caption = null; + VideoMessage.prototype.gifPlayback = null; + VideoMessage.prototype.height = null; + VideoMessage.prototype.width = null; + VideoMessage.prototype.fileEncSha256 = null; VideoMessage.prototype.interactiveAnnotations = $util.emptyArray; - VideoMessage.prototype.directPath = ""; - VideoMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - VideoMessage.prototype.jpegThumbnail = $util.newBuffer([]); + VideoMessage.prototype.directPath = null; + VideoMessage.prototype.mediaKeyTimestamp = null; + VideoMessage.prototype.jpegThumbnail = null; VideoMessage.prototype.contextInfo = null; - VideoMessage.prototype.streamingSidecar = $util.newBuffer([]); - VideoMessage.prototype.gifAttribution = 0; - VideoMessage.prototype.viewOnce = false; - VideoMessage.prototype.thumbnailDirectPath = ""; - VideoMessage.prototype.thumbnailSha256 = $util.newBuffer([]); - VideoMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); - VideoMessage.prototype.staticUrl = ""; + VideoMessage.prototype.streamingSidecar = null; + VideoMessage.prototype.gifAttribution = null; + VideoMessage.prototype.viewOnce = null; + VideoMessage.prototype.thumbnailDirectPath = null; + VideoMessage.prototype.thumbnailSha256 = null; + VideoMessage.prototype.thumbnailEncSha256 = null; + VideoMessage.prototype.staticUrl = null; VideoMessage.prototype.annotations = $util.emptyArray; - VideoMessage.prototype.accessibilityLabel = ""; + VideoMessage.prototype.accessibilityLabel = null; VideoMessage.prototype.processedVideos = $util.emptyArray; - VideoMessage.prototype.externalShareFullVideoDurationInSeconds = 0; + VideoMessage.prototype.externalShareFullVideoDurationInSeconds = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_seconds", { + get: $util.oneOfGetter($oneOfFields = ["seconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_gifPlayback", { + get: $util.oneOfGetter($oneOfFields = ["gifPlayback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_contextInfo", { + get: $util.oneOfGetter($oneOfFields = ["contextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_streamingSidecar", { + get: $util.oneOfGetter($oneOfFields = ["streamingSidecar"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_gifAttribution", { + get: $util.oneOfGetter($oneOfFields = ["gifAttribution"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_viewOnce", { + get: $util.oneOfGetter($oneOfFields = ["viewOnce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_thumbnailDirectPath", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailDirectPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_thumbnailSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_thumbnailEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["thumbnailEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_staticUrl", { + get: $util.oneOfGetter($oneOfFields = ["staticUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_accessibilityLabel", { + get: $util.oneOfGetter($oneOfFields = ["accessibilityLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VideoMessage.prototype, "_externalShareFullVideoDurationInSeconds", { + get: $util.oneOfGetter($oneOfFields = ["externalShareFullVideoDurationInSeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); VideoMessage.create = function create(properties) { return new VideoMessage(properties); @@ -25096,6 +56283,329 @@ export const proto = $root.proto = (() => { return m; }; + VideoMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Message.VideoMessage) + return d; + var m = new $root.proto.Message.VideoMessage(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.seconds != null) { + m.seconds = d.seconds >>> 0; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.gifPlayback != null) { + m.gifPlayback = Boolean(d.gifPlayback); + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.interactiveAnnotations) { + if (!Array.isArray(d.interactiveAnnotations)) + throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected"); + m.interactiveAnnotations = []; + for (var i = 0; i < d.interactiveAnnotations.length; ++i) { + if (typeof d.interactiveAnnotations[i] !== "object") + throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: object expected"); + m.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.interactiveAnnotations[i]); + } + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + if (d.contextInfo != null) { + if (typeof d.contextInfo !== "object") + throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected"); + m.contextInfo = $root.proto.ContextInfo.fromObject(d.contextInfo); + } + if (d.streamingSidecar != null) { + if (typeof d.streamingSidecar === "string") + $util.base64.decode(d.streamingSidecar, m.streamingSidecar = $util.newBuffer($util.base64.length(d.streamingSidecar)), 0); + else if (d.streamingSidecar.length >= 0) + m.streamingSidecar = d.streamingSidecar; + } + switch (d.gifAttribution) { + default: + if (typeof d.gifAttribution === "number") { + m.gifAttribution = d.gifAttribution; + break; + } + break; + case "NONE": + case 0: + m.gifAttribution = 0; + break; + case "GIPHY": + case 1: + m.gifAttribution = 1; + break; + case "TENOR": + case 2: + m.gifAttribution = 2; + break; + } + if (d.viewOnce != null) { + m.viewOnce = Boolean(d.viewOnce); + } + if (d.thumbnailDirectPath != null) { + m.thumbnailDirectPath = String(d.thumbnailDirectPath); + } + if (d.thumbnailSha256 != null) { + if (typeof d.thumbnailSha256 === "string") + $util.base64.decode(d.thumbnailSha256, m.thumbnailSha256 = $util.newBuffer($util.base64.length(d.thumbnailSha256)), 0); + else if (d.thumbnailSha256.length >= 0) + m.thumbnailSha256 = d.thumbnailSha256; + } + if (d.thumbnailEncSha256 != null) { + if (typeof d.thumbnailEncSha256 === "string") + $util.base64.decode(d.thumbnailEncSha256, m.thumbnailEncSha256 = $util.newBuffer($util.base64.length(d.thumbnailEncSha256)), 0); + else if (d.thumbnailEncSha256.length >= 0) + m.thumbnailEncSha256 = d.thumbnailEncSha256; + } + if (d.staticUrl != null) { + m.staticUrl = String(d.staticUrl); + } + if (d.annotations) { + if (!Array.isArray(d.annotations)) + throw TypeError(".proto.Message.VideoMessage.annotations: array expected"); + m.annotations = []; + for (var i = 0; i < d.annotations.length; ++i) { + if (typeof d.annotations[i] !== "object") + throw TypeError(".proto.Message.VideoMessage.annotations: object expected"); + m.annotations[i] = $root.proto.InteractiveAnnotation.fromObject(d.annotations[i]); + } + } + if (d.accessibilityLabel != null) { + m.accessibilityLabel = String(d.accessibilityLabel); + } + if (d.processedVideos) { + if (!Array.isArray(d.processedVideos)) + throw TypeError(".proto.Message.VideoMessage.processedVideos: array expected"); + m.processedVideos = []; + for (var i = 0; i < d.processedVideos.length; ++i) { + if (typeof d.processedVideos[i] !== "object") + throw TypeError(".proto.Message.VideoMessage.processedVideos: object expected"); + m.processedVideos[i] = $root.proto.ProcessedVideo.fromObject(d.processedVideos[i]); + } + } + if (d.externalShareFullVideoDurationInSeconds != null) { + m.externalShareFullVideoDurationInSeconds = d.externalShareFullVideoDurationInSeconds >>> 0; + } + return m; + }; + + VideoMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.interactiveAnnotations = []; + d.annotations = []; + d.processedVideos = []; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.seconds != null && m.hasOwnProperty("seconds")) { + d.seconds = m.seconds; + if (o.oneofs) + d._seconds = "seconds"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.gifPlayback != null && m.hasOwnProperty("gifPlayback")) { + d.gifPlayback = m.gifPlayback; + if (o.oneofs) + d._gifPlayback = "gifPlayback"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.interactiveAnnotations && m.interactiveAnnotations.length) { + d.interactiveAnnotations = []; + for (var j = 0; j < m.interactiveAnnotations.length; ++j) { + d.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(m.interactiveAnnotations[j], o); + } + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + if (m.contextInfo != null && m.hasOwnProperty("contextInfo")) { + d.contextInfo = $root.proto.ContextInfo.toObject(m.contextInfo, o); + if (o.oneofs) + d._contextInfo = "contextInfo"; + } + if (m.streamingSidecar != null && m.hasOwnProperty("streamingSidecar")) { + d.streamingSidecar = o.bytes === String ? $util.base64.encode(m.streamingSidecar, 0, m.streamingSidecar.length) : o.bytes === Array ? Array.prototype.slice.call(m.streamingSidecar) : m.streamingSidecar; + if (o.oneofs) + d._streamingSidecar = "streamingSidecar"; + } + if (m.gifAttribution != null && m.hasOwnProperty("gifAttribution")) { + d.gifAttribution = o.enums === String ? $root.proto.Message.VideoMessage.Attribution[m.gifAttribution] === undefined ? m.gifAttribution : $root.proto.Message.VideoMessage.Attribution[m.gifAttribution] : m.gifAttribution; + if (o.oneofs) + d._gifAttribution = "gifAttribution"; + } + if (m.viewOnce != null && m.hasOwnProperty("viewOnce")) { + d.viewOnce = m.viewOnce; + if (o.oneofs) + d._viewOnce = "viewOnce"; + } + if (m.thumbnailDirectPath != null && m.hasOwnProperty("thumbnailDirectPath")) { + d.thumbnailDirectPath = m.thumbnailDirectPath; + if (o.oneofs) + d._thumbnailDirectPath = "thumbnailDirectPath"; + } + if (m.thumbnailSha256 != null && m.hasOwnProperty("thumbnailSha256")) { + d.thumbnailSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailSha256, 0, m.thumbnailSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailSha256) : m.thumbnailSha256; + if (o.oneofs) + d._thumbnailSha256 = "thumbnailSha256"; + } + if (m.thumbnailEncSha256 != null && m.hasOwnProperty("thumbnailEncSha256")) { + d.thumbnailEncSha256 = o.bytes === String ? $util.base64.encode(m.thumbnailEncSha256, 0, m.thumbnailEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.thumbnailEncSha256) : m.thumbnailEncSha256; + if (o.oneofs) + d._thumbnailEncSha256 = "thumbnailEncSha256"; + } + if (m.staticUrl != null && m.hasOwnProperty("staticUrl")) { + d.staticUrl = m.staticUrl; + if (o.oneofs) + d._staticUrl = "staticUrl"; + } + if (m.annotations && m.annotations.length) { + d.annotations = []; + for (var j = 0; j < m.annotations.length; ++j) { + d.annotations[j] = $root.proto.InteractiveAnnotation.toObject(m.annotations[j], o); + } + } + if (m.accessibilityLabel != null && m.hasOwnProperty("accessibilityLabel")) { + d.accessibilityLabel = m.accessibilityLabel; + if (o.oneofs) + d._accessibilityLabel = "accessibilityLabel"; + } + if (m.processedVideos && m.processedVideos.length) { + d.processedVideos = []; + for (var j = 0; j < m.processedVideos.length; ++j) { + d.processedVideos[j] = $root.proto.ProcessedVideo.toObject(m.processedVideos[j], o); + } + } + if (m.externalShareFullVideoDurationInSeconds != null && m.hasOwnProperty("externalShareFullVideoDurationInSeconds")) { + d.externalShareFullVideoDurationInSeconds = m.externalShareFullVideoDurationInSeconds; + if (o.oneofs) + d._externalShareFullVideoDurationInSeconds = "externalShareFullVideoDurationInSeconds"; + } + return d; + }; + + VideoMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + VideoMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25126,15 +56636,65 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageAddOn.prototype.messageAddOnType = 0; + MessageAddOn.prototype.messageAddOnType = null; MessageAddOn.prototype.messageAddOn = null; - MessageAddOn.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MessageAddOn.prototype.serverTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MessageAddOn.prototype.status = 0; + MessageAddOn.prototype.senderTimestampMs = null; + MessageAddOn.prototype.serverTimestampMs = null; + MessageAddOn.prototype.status = null; MessageAddOn.prototype.addOnContextInfo = null; MessageAddOn.prototype.messageAddOnKey = null; MessageAddOn.prototype.legacyMessage = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_messageAddOnType", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_messageAddOn", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_serverTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_addOnContextInfo", { + get: $util.oneOfGetter($oneOfFields = ["addOnContextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_messageAddOnKey", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOn.prototype, "_legacyMessage", { + get: $util.oneOfGetter($oneOfFields = ["legacyMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + MessageAddOn.create = function create(properties) { return new MessageAddOn(properties); }; @@ -25210,6 +56770,170 @@ export const proto = $root.proto = (() => { return m; }; + MessageAddOn.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MessageAddOn) + return d; + var m = new $root.proto.MessageAddOn(); + switch (d.messageAddOnType) { + default: + if (typeof d.messageAddOnType === "number") { + m.messageAddOnType = d.messageAddOnType; + break; + } + break; + case "UNDEFINED": + case 0: + m.messageAddOnType = 0; + break; + case "REACTION": + case 1: + m.messageAddOnType = 1; + break; + case "EVENT_RESPONSE": + case 2: + m.messageAddOnType = 2; + break; + case "POLL_UPDATE": + case 3: + m.messageAddOnType = 3; + break; + case "PIN_IN_CHAT": + case 4: + m.messageAddOnType = 4; + break; + } + if (d.messageAddOn != null) { + if (typeof d.messageAddOn !== "object") + throw TypeError(".proto.MessageAddOn.messageAddOn: object expected"); + m.messageAddOn = $root.proto.Message.fromObject(d.messageAddOn); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + if (d.serverTimestampMs != null) { + if ($util.Long) + (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false; + else if (typeof d.serverTimestampMs === "string") + m.serverTimestampMs = parseInt(d.serverTimestampMs, 10); + else if (typeof d.serverTimestampMs === "number") + m.serverTimestampMs = d.serverTimestampMs; + else if (typeof d.serverTimestampMs === "object") + m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber(); + } + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "ERROR": + case 0: + m.status = 0; + break; + case "PENDING": + case 1: + m.status = 1; + break; + case "SERVER_ACK": + case 2: + m.status = 2; + break; + case "DELIVERY_ACK": + case 3: + m.status = 3; + break; + case "READ": + case 4: + m.status = 4; + break; + case "PLAYED": + case 5: + m.status = 5; + break; + } + if (d.addOnContextInfo != null) { + if (typeof d.addOnContextInfo !== "object") + throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected"); + m.addOnContextInfo = $root.proto.MessageAddOnContextInfo.fromObject(d.addOnContextInfo); + } + if (d.messageAddOnKey != null) { + if (typeof d.messageAddOnKey !== "object") + throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected"); + m.messageAddOnKey = $root.proto.MessageKey.fromObject(d.messageAddOnKey); + } + if (d.legacyMessage != null) { + if (typeof d.legacyMessage !== "object") + throw TypeError(".proto.MessageAddOn.legacyMessage: object expected"); + m.legacyMessage = $root.proto.LegacyMessage.fromObject(d.legacyMessage); + } + return m; + }; + + MessageAddOn.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageAddOnType != null && m.hasOwnProperty("messageAddOnType")) { + d.messageAddOnType = o.enums === String ? $root.proto.MessageAddOn.MessageAddOnType[m.messageAddOnType] === undefined ? m.messageAddOnType : $root.proto.MessageAddOn.MessageAddOnType[m.messageAddOnType] : m.messageAddOnType; + if (o.oneofs) + d._messageAddOnType = "messageAddOnType"; + } + if (m.messageAddOn != null && m.hasOwnProperty("messageAddOn")) { + d.messageAddOn = $root.proto.Message.toObject(m.messageAddOn, o); + if (o.oneofs) + d._messageAddOn = "messageAddOn"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) { + if (typeof m.serverTimestampMs === "number") + d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; + else + d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + if (o.oneofs) + d._serverTimestampMs = "serverTimestampMs"; + } + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.WebMessageInfo.Status[m.status] === undefined ? m.status : $root.proto.WebMessageInfo.Status[m.status] : m.status; + if (o.oneofs) + d._status = "status"; + } + if (m.addOnContextInfo != null && m.hasOwnProperty("addOnContextInfo")) { + d.addOnContextInfo = $root.proto.MessageAddOnContextInfo.toObject(m.addOnContextInfo, o); + if (o.oneofs) + d._addOnContextInfo = "addOnContextInfo"; + } + if (m.messageAddOnKey != null && m.hasOwnProperty("messageAddOnKey")) { + d.messageAddOnKey = $root.proto.MessageKey.toObject(m.messageAddOnKey, o); + if (o.oneofs) + d._messageAddOnKey = "messageAddOnKey"; + } + if (m.legacyMessage != null && m.hasOwnProperty("legacyMessage")) { + d.legacyMessage = $root.proto.LegacyMessage.toObject(m.legacyMessage, o); + if (o.oneofs) + d._legacyMessage = "legacyMessage"; + } + return d; + }; + + MessageAddOn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageAddOn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25239,8 +56963,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageAddOnContextInfo.prototype.messageAddOnDurationInSecs = 0; - MessageAddOnContextInfo.prototype.messageAddOnExpiryType = 1; + MessageAddOnContextInfo.prototype.messageAddOnDurationInSecs = null; + MessageAddOnContextInfo.prototype.messageAddOnExpiryType = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOnContextInfo.prototype, "_messageAddOnDurationInSecs", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnDurationInSecs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAddOnContextInfo.prototype, "_messageAddOnExpiryType", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnExpiryType"]), + set: $util.oneOfSetter($oneOfFields) + }); MessageAddOnContextInfo.create = function create(properties) { return new MessageAddOnContextInfo(properties); @@ -25281,6 +57019,53 @@ export const proto = $root.proto = (() => { return m; }; + MessageAddOnContextInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MessageAddOnContextInfo) + return d; + var m = new $root.proto.MessageAddOnContextInfo(); + if (d.messageAddOnDurationInSecs != null) { + m.messageAddOnDurationInSecs = d.messageAddOnDurationInSecs >>> 0; + } + switch (d.messageAddOnExpiryType) { + default: + if (typeof d.messageAddOnExpiryType === "number") { + m.messageAddOnExpiryType = d.messageAddOnExpiryType; + break; + } + break; + case "STATIC": + case 1: + m.messageAddOnExpiryType = 1; + break; + case "DEPENDENT_ON_PARENT": + case 2: + m.messageAddOnExpiryType = 2; + break; + } + return m; + }; + + MessageAddOnContextInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageAddOnDurationInSecs != null && m.hasOwnProperty("messageAddOnDurationInSecs")) { + d.messageAddOnDurationInSecs = m.messageAddOnDurationInSecs; + if (o.oneofs) + d._messageAddOnDurationInSecs = "messageAddOnDurationInSecs"; + } + if (m.messageAddOnExpiryType != null && m.hasOwnProperty("messageAddOnExpiryType")) { + d.messageAddOnExpiryType = o.enums === String ? $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] === undefined ? m.messageAddOnExpiryType : $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] : m.messageAddOnExpiryType; + if (o.oneofs) + d._messageAddOnExpiryType = "messageAddOnExpiryType"; + } + return d; + }; + + MessageAddOnContextInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageAddOnContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25300,9 +57085,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageAssociation.prototype.associationType = 0; + MessageAssociation.prototype.associationType = null; MessageAssociation.prototype.parentMessageKey = null; - MessageAssociation.prototype.messageIndex = 0; + MessageAssociation.prototype.messageIndex = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAssociation.prototype, "_associationType", { + get: $util.oneOfGetter($oneOfFields = ["associationType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAssociation.prototype, "_parentMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["parentMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageAssociation.prototype, "_messageIndex", { + get: $util.oneOfGetter($oneOfFields = ["messageIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); MessageAssociation.create = function create(properties) { return new MessageAssociation(properties); @@ -25349,6 +57154,115 @@ export const proto = $root.proto = (() => { return m; }; + MessageAssociation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MessageAssociation) + return d; + var m = new $root.proto.MessageAssociation(); + switch (d.associationType) { + default: + if (typeof d.associationType === "number") { + m.associationType = d.associationType; + break; + } + break; + case "UNKNOWN": + case 0: + m.associationType = 0; + break; + case "MEDIA_ALBUM": + case 1: + m.associationType = 1; + break; + case "BOT_PLUGIN": + case 2: + m.associationType = 2; + break; + case "EVENT_COVER_IMAGE": + case 3: + m.associationType = 3; + break; + case "STATUS_POLL": + case 4: + m.associationType = 4; + break; + case "HD_VIDEO_DUAL_UPLOAD": + case 5: + m.associationType = 5; + break; + case "STATUS_EXTERNAL_RESHARE": + case 6: + m.associationType = 6; + break; + case "MEDIA_POLL": + case 7: + m.associationType = 7; + break; + case "STATUS_ADD_YOURS": + case 8: + m.associationType = 8; + break; + case "STATUS_NOTIFICATION": + case 9: + m.associationType = 9; + break; + case "HD_IMAGE_DUAL_UPLOAD": + case 10: + m.associationType = 10; + break; + case "STICKER_ANNOTATION": + case 11: + m.associationType = 11; + break; + case "MOTION_PHOTO": + case 12: + m.associationType = 12; + break; + case "STATUS_LINK_ACTION": + case 13: + m.associationType = 13; + break; + case "VIEW_ALL_REPLIES": + case 14: + m.associationType = 14; + break; + } + if (d.parentMessageKey != null) { + if (typeof d.parentMessageKey !== "object") + throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected"); + m.parentMessageKey = $root.proto.MessageKey.fromObject(d.parentMessageKey); + } + if (d.messageIndex != null) { + m.messageIndex = d.messageIndex | 0; + } + return m; + }; + + MessageAssociation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.associationType != null && m.hasOwnProperty("associationType")) { + d.associationType = o.enums === String ? $root.proto.MessageAssociation.AssociationType[m.associationType] === undefined ? m.associationType : $root.proto.MessageAssociation.AssociationType[m.associationType] : m.associationType; + if (o.oneofs) + d._associationType = "associationType"; + } + if (m.parentMessageKey != null && m.hasOwnProperty("parentMessageKey")) { + d.parentMessageKey = $root.proto.MessageKey.toObject(m.parentMessageKey, o); + if (o.oneofs) + d._parentMessageKey = "parentMessageKey"; + } + if (m.messageIndex != null && m.hasOwnProperty("messageIndex")) { + d.messageIndex = m.messageIndex; + if (o.oneofs) + d._messageIndex = "messageIndex"; + } + return d; + }; + + MessageAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25389,20 +57303,106 @@ export const proto = $root.proto = (() => { } MessageContextInfo.prototype.deviceListMetadata = null; - MessageContextInfo.prototype.deviceListMetadataVersion = 0; - MessageContextInfo.prototype.messageSecret = $util.newBuffer([]); - MessageContextInfo.prototype.paddingBytes = $util.newBuffer([]); - MessageContextInfo.prototype.messageAddOnDurationInSecs = 0; - MessageContextInfo.prototype.botMessageSecret = $util.newBuffer([]); + MessageContextInfo.prototype.deviceListMetadataVersion = null; + MessageContextInfo.prototype.messageSecret = null; + MessageContextInfo.prototype.paddingBytes = null; + MessageContextInfo.prototype.messageAddOnDurationInSecs = null; + MessageContextInfo.prototype.botMessageSecret = null; MessageContextInfo.prototype.botMetadata = null; - MessageContextInfo.prototype.reportingTokenVersion = 0; - MessageContextInfo.prototype.messageAddOnExpiryType = 1; + MessageContextInfo.prototype.reportingTokenVersion = null; + MessageContextInfo.prototype.messageAddOnExpiryType = null; MessageContextInfo.prototype.messageAssociation = null; - MessageContextInfo.prototype.capiCreatedGroup = false; - MessageContextInfo.prototype.supportPayload = ""; + MessageContextInfo.prototype.capiCreatedGroup = null; + MessageContextInfo.prototype.supportPayload = null; MessageContextInfo.prototype.limitSharing = null; MessageContextInfo.prototype.limitSharingV2 = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_deviceListMetadata", { + get: $util.oneOfGetter($oneOfFields = ["deviceListMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_deviceListMetadataVersion", { + get: $util.oneOfGetter($oneOfFields = ["deviceListMetadataVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_messageSecret", { + get: $util.oneOfGetter($oneOfFields = ["messageSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_paddingBytes", { + get: $util.oneOfGetter($oneOfFields = ["paddingBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_messageAddOnDurationInSecs", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnDurationInSecs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_botMessageSecret", { + get: $util.oneOfGetter($oneOfFields = ["botMessageSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_botMetadata", { + get: $util.oneOfGetter($oneOfFields = ["botMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_reportingTokenVersion", { + get: $util.oneOfGetter($oneOfFields = ["reportingTokenVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_messageAddOnExpiryType", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnExpiryType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_messageAssociation", { + get: $util.oneOfGetter($oneOfFields = ["messageAssociation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_capiCreatedGroup", { + get: $util.oneOfGetter($oneOfFields = ["capiCreatedGroup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_supportPayload", { + get: $util.oneOfGetter($oneOfFields = ["supportPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_limitSharing", { + get: $util.oneOfGetter($oneOfFields = ["limitSharing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageContextInfo.prototype, "_limitSharingV2", { + get: $util.oneOfGetter($oneOfFields = ["limitSharingV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + MessageContextInfo.create = function create(properties) { return new MessageContextInfo(properties); }; @@ -25514,6 +57514,168 @@ export const proto = $root.proto = (() => { return m; }; + MessageContextInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MessageContextInfo) + return d; + var m = new $root.proto.MessageContextInfo(); + if (d.deviceListMetadata != null) { + if (typeof d.deviceListMetadata !== "object") + throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected"); + m.deviceListMetadata = $root.proto.DeviceListMetadata.fromObject(d.deviceListMetadata); + } + if (d.deviceListMetadataVersion != null) { + m.deviceListMetadataVersion = d.deviceListMetadataVersion | 0; + } + if (d.messageSecret != null) { + if (typeof d.messageSecret === "string") + $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0); + else if (d.messageSecret.length >= 0) + m.messageSecret = d.messageSecret; + } + if (d.paddingBytes != null) { + if (typeof d.paddingBytes === "string") + $util.base64.decode(d.paddingBytes, m.paddingBytes = $util.newBuffer($util.base64.length(d.paddingBytes)), 0); + else if (d.paddingBytes.length >= 0) + m.paddingBytes = d.paddingBytes; + } + if (d.messageAddOnDurationInSecs != null) { + m.messageAddOnDurationInSecs = d.messageAddOnDurationInSecs >>> 0; + } + if (d.botMessageSecret != null) { + if (typeof d.botMessageSecret === "string") + $util.base64.decode(d.botMessageSecret, m.botMessageSecret = $util.newBuffer($util.base64.length(d.botMessageSecret)), 0); + else if (d.botMessageSecret.length >= 0) + m.botMessageSecret = d.botMessageSecret; + } + if (d.botMetadata != null) { + if (typeof d.botMetadata !== "object") + throw TypeError(".proto.MessageContextInfo.botMetadata: object expected"); + m.botMetadata = $root.proto.BotMetadata.fromObject(d.botMetadata); + } + if (d.reportingTokenVersion != null) { + m.reportingTokenVersion = d.reportingTokenVersion | 0; + } + switch (d.messageAddOnExpiryType) { + default: + if (typeof d.messageAddOnExpiryType === "number") { + m.messageAddOnExpiryType = d.messageAddOnExpiryType; + break; + } + break; + case "STATIC": + case 1: + m.messageAddOnExpiryType = 1; + break; + case "DEPENDENT_ON_PARENT": + case 2: + m.messageAddOnExpiryType = 2; + break; + } + if (d.messageAssociation != null) { + if (typeof d.messageAssociation !== "object") + throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected"); + m.messageAssociation = $root.proto.MessageAssociation.fromObject(d.messageAssociation); + } + if (d.capiCreatedGroup != null) { + m.capiCreatedGroup = Boolean(d.capiCreatedGroup); + } + if (d.supportPayload != null) { + m.supportPayload = String(d.supportPayload); + } + if (d.limitSharing != null) { + if (typeof d.limitSharing !== "object") + throw TypeError(".proto.MessageContextInfo.limitSharing: object expected"); + m.limitSharing = $root.proto.LimitSharing.fromObject(d.limitSharing); + } + if (d.limitSharingV2 != null) { + if (typeof d.limitSharingV2 !== "object") + throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected"); + m.limitSharingV2 = $root.proto.LimitSharing.fromObject(d.limitSharingV2); + } + return m; + }; + + MessageContextInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.deviceListMetadata != null && m.hasOwnProperty("deviceListMetadata")) { + d.deviceListMetadata = $root.proto.DeviceListMetadata.toObject(m.deviceListMetadata, o); + if (o.oneofs) + d._deviceListMetadata = "deviceListMetadata"; + } + if (m.deviceListMetadataVersion != null && m.hasOwnProperty("deviceListMetadataVersion")) { + d.deviceListMetadataVersion = m.deviceListMetadataVersion; + if (o.oneofs) + d._deviceListMetadataVersion = "deviceListMetadataVersion"; + } + if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) { + d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret; + if (o.oneofs) + d._messageSecret = "messageSecret"; + } + if (m.paddingBytes != null && m.hasOwnProperty("paddingBytes")) { + d.paddingBytes = o.bytes === String ? $util.base64.encode(m.paddingBytes, 0, m.paddingBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.paddingBytes) : m.paddingBytes; + if (o.oneofs) + d._paddingBytes = "paddingBytes"; + } + if (m.messageAddOnDurationInSecs != null && m.hasOwnProperty("messageAddOnDurationInSecs")) { + d.messageAddOnDurationInSecs = m.messageAddOnDurationInSecs; + if (o.oneofs) + d._messageAddOnDurationInSecs = "messageAddOnDurationInSecs"; + } + if (m.botMessageSecret != null && m.hasOwnProperty("botMessageSecret")) { + d.botMessageSecret = o.bytes === String ? $util.base64.encode(m.botMessageSecret, 0, m.botMessageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.botMessageSecret) : m.botMessageSecret; + if (o.oneofs) + d._botMessageSecret = "botMessageSecret"; + } + if (m.botMetadata != null && m.hasOwnProperty("botMetadata")) { + d.botMetadata = $root.proto.BotMetadata.toObject(m.botMetadata, o); + if (o.oneofs) + d._botMetadata = "botMetadata"; + } + if (m.reportingTokenVersion != null && m.hasOwnProperty("reportingTokenVersion")) { + d.reportingTokenVersion = m.reportingTokenVersion; + if (o.oneofs) + d._reportingTokenVersion = "reportingTokenVersion"; + } + if (m.messageAddOnExpiryType != null && m.hasOwnProperty("messageAddOnExpiryType")) { + d.messageAddOnExpiryType = o.enums === String ? $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] === undefined ? m.messageAddOnExpiryType : $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] : m.messageAddOnExpiryType; + if (o.oneofs) + d._messageAddOnExpiryType = "messageAddOnExpiryType"; + } + if (m.messageAssociation != null && m.hasOwnProperty("messageAssociation")) { + d.messageAssociation = $root.proto.MessageAssociation.toObject(m.messageAssociation, o); + if (o.oneofs) + d._messageAssociation = "messageAssociation"; + } + if (m.capiCreatedGroup != null && m.hasOwnProperty("capiCreatedGroup")) { + d.capiCreatedGroup = m.capiCreatedGroup; + if (o.oneofs) + d._capiCreatedGroup = "capiCreatedGroup"; + } + if (m.supportPayload != null && m.hasOwnProperty("supportPayload")) { + d.supportPayload = m.supportPayload; + if (o.oneofs) + d._supportPayload = "supportPayload"; + } + if (m.limitSharing != null && m.hasOwnProperty("limitSharing")) { + d.limitSharing = $root.proto.LimitSharing.toObject(m.limitSharing, o); + if (o.oneofs) + d._limitSharing = "limitSharing"; + } + if (m.limitSharingV2 != null && m.hasOwnProperty("limitSharingV2")) { + d.limitSharingV2 = $root.proto.LimitSharing.toObject(m.limitSharingV2, o); + if (o.oneofs) + d._limitSharingV2 = "limitSharingV2"; + } + return d; + }; + + MessageContextInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25540,10 +57702,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageKey.prototype.remoteJid = ""; - MessageKey.prototype.fromMe = false; - MessageKey.prototype.id = ""; - MessageKey.prototype.participant = ""; + MessageKey.prototype.remoteJid = null; + MessageKey.prototype.fromMe = null; + MessageKey.prototype.id = null; + MessageKey.prototype.participant = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_remoteJid", { + get: $util.oneOfGetter($oneOfFields = ["remoteJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_fromMe", { + get: $util.oneOfGetter($oneOfFields = ["fromMe"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_participant", { + get: $util.oneOfGetter($oneOfFields = ["participant"]), + set: $util.oneOfSetter($oneOfFields) + }); MessageKey.create = function create(properties) { return new MessageKey(properties); @@ -25596,6 +57784,56 @@ export const proto = $root.proto = (() => { return m; }; + MessageKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MessageKey) + return d; + var m = new $root.proto.MessageKey(); + if (d.remoteJid != null) { + m.remoteJid = String(d.remoteJid); + } + if (d.fromMe != null) { + m.fromMe = Boolean(d.fromMe); + } + if (d.id != null) { + m.id = String(d.id); + } + if (d.participant != null) { + m.participant = String(d.participant); + } + return m; + }; + + MessageKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.remoteJid != null && m.hasOwnProperty("remoteJid")) { + d.remoteJid = m.remoteJid; + if (o.oneofs) + d._remoteJid = "remoteJid"; + } + if (m.fromMe != null && m.hasOwnProperty("fromMe")) { + d.fromMe = m.fromMe; + if (o.oneofs) + d._fromMe = "fromMe"; + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.participant != null && m.hasOwnProperty("participant")) { + d.participant = m.participant; + if (o.oneofs) + d._participant = "participant"; + } + return d; + }; + + MessageKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25615,9 +57853,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageSecretMessage.prototype.version = 0; - MessageSecretMessage.prototype.encIv = $util.newBuffer([]); - MessageSecretMessage.prototype.encPayload = $util.newBuffer([]); + MessageSecretMessage.prototype.version = null; + MessageSecretMessage.prototype.encIv = null; + MessageSecretMessage.prototype.encPayload = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageSecretMessage.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageSecretMessage.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageSecretMessage.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); MessageSecretMessage.create = function create(properties) { return new MessageSecretMessage(properties); @@ -25664,6 +57922,54 @@ export const proto = $root.proto = (() => { return m; }; + MessageSecretMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MessageSecretMessage) + return d; + var m = new $root.proto.MessageSecretMessage(); + if (d.version != null) { + m.version = d.version | 0; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + return m; + }; + + MessageSecretMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.version != null && m.hasOwnProperty("version")) { + d.version = m.version; + if (o.oneofs) + d._version = "version"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + return d; + }; + + MessageSecretMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageSecretMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25683,9 +57989,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Money.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - Money.prototype.offset = 0; - Money.prototype.currencyCode = ""; + Money.prototype.value = null; + Money.prototype.offset = null; + Money.prototype.currencyCode = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Money.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Money.prototype, "_offset", { + get: $util.oneOfGetter($oneOfFields = ["offset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Money.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); Money.create = function create(properties) { return new Money(properties); @@ -25732,6 +58058,58 @@ export const proto = $root.proto = (() => { return m; }; + Money.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Money) + return d; + var m = new $root.proto.Money(); + if (d.value != null) { + if ($util.Long) + (m.value = $util.Long.fromValue(d.value)).unsigned = false; + else if (typeof d.value === "string") + m.value = parseInt(d.value, 10); + else if (typeof d.value === "number") + m.value = d.value; + else if (typeof d.value === "object") + m.value = new $util.LongBits(d.value.low >>> 0, d.value.high >>> 0).toNumber(); + } + if (d.offset != null) { + m.offset = d.offset >>> 0; + } + if (d.currencyCode != null) { + m.currencyCode = String(d.currencyCode); + } + return m; + }; + + Money.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.value != null && m.hasOwnProperty("value")) { + if (typeof m.value === "number") + d.value = o.longs === String ? String(m.value) : m.value; + else + d.value = o.longs === String ? $util.Long.prototype.toString.call(m.value) : o.longs === Number ? new $util.LongBits(m.value.low >>> 0, m.value.high >>> 0).toNumber() : m.value; + if (o.oneofs) + d._value = "value"; + } + if (m.offset != null && m.hasOwnProperty("offset")) { + d.offset = m.offset; + if (o.oneofs) + d._offset = "offset"; + } + if (m.currencyCode != null && m.hasOwnProperty("currencyCode")) { + d.currencyCode = m.currencyCode; + if (o.oneofs) + d._currencyCode = "currencyCode"; + } + return d; + }; + + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -25752,45 +58130,275 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MsgOpaqueData.prototype.body = ""; - MsgOpaqueData.prototype.caption = ""; - MsgOpaqueData.prototype.lng = 0; - MsgOpaqueData.prototype.isLive = false; - MsgOpaqueData.prototype.lat = 0; - MsgOpaqueData.prototype.paymentAmount1000 = 0; - MsgOpaqueData.prototype.paymentNoteMsgBody = ""; - MsgOpaqueData.prototype.matchedText = ""; - MsgOpaqueData.prototype.title = ""; - MsgOpaqueData.prototype.description = ""; - MsgOpaqueData.prototype.futureproofBuffer = $util.newBuffer([]); - MsgOpaqueData.prototype.clientUrl = ""; - MsgOpaqueData.prototype.loc = ""; - MsgOpaqueData.prototype.pollName = ""; + MsgOpaqueData.prototype.body = null; + MsgOpaqueData.prototype.caption = null; + MsgOpaqueData.prototype.lng = null; + MsgOpaqueData.prototype.isLive = null; + MsgOpaqueData.prototype.lat = null; + MsgOpaqueData.prototype.paymentAmount1000 = null; + MsgOpaqueData.prototype.paymentNoteMsgBody = null; + MsgOpaqueData.prototype.matchedText = null; + MsgOpaqueData.prototype.title = null; + MsgOpaqueData.prototype.description = null; + MsgOpaqueData.prototype.futureproofBuffer = null; + MsgOpaqueData.prototype.clientUrl = null; + MsgOpaqueData.prototype.loc = null; + MsgOpaqueData.prototype.pollName = null; MsgOpaqueData.prototype.pollOptions = $util.emptyArray; - MsgOpaqueData.prototype.pollSelectableOptionsCount = 0; - MsgOpaqueData.prototype.messageSecret = $util.newBuffer([]); - MsgOpaqueData.prototype.originalSelfAuthor = ""; - MsgOpaqueData.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MsgOpaqueData.prototype.pollUpdateParentKey = ""; + MsgOpaqueData.prototype.pollSelectableOptionsCount = null; + MsgOpaqueData.prototype.messageSecret = null; + MsgOpaqueData.prototype.originalSelfAuthor = null; + MsgOpaqueData.prototype.senderTimestampMs = null; + MsgOpaqueData.prototype.pollUpdateParentKey = null; MsgOpaqueData.prototype.encPollVote = null; - MsgOpaqueData.prototype.isSentCagPollCreation = false; - MsgOpaqueData.prototype.pollContentType = 0; + MsgOpaqueData.prototype.isSentCagPollCreation = null; + MsgOpaqueData.prototype.pollContentType = null; MsgOpaqueData.prototype.pollVotesSnapshot = null; - MsgOpaqueData.prototype.encReactionTargetMessageKey = ""; - MsgOpaqueData.prototype.encReactionEncPayload = $util.newBuffer([]); - MsgOpaqueData.prototype.encReactionEncIv = $util.newBuffer([]); - MsgOpaqueData.prototype.botMessageSecret = $util.newBuffer([]); - MsgOpaqueData.prototype.targetMessageKey = ""; - MsgOpaqueData.prototype.encPayload = $util.newBuffer([]); - MsgOpaqueData.prototype.encIv = $util.newBuffer([]); - MsgOpaqueData.prototype.eventName = ""; - MsgOpaqueData.prototype.isEventCanceled = false; - MsgOpaqueData.prototype.eventDescription = ""; - MsgOpaqueData.prototype.eventJoinLink = ""; - MsgOpaqueData.prototype.eventStartTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MsgOpaqueData.prototype.encReactionTargetMessageKey = null; + MsgOpaqueData.prototype.encReactionEncPayload = null; + MsgOpaqueData.prototype.encReactionEncIv = null; + MsgOpaqueData.prototype.botMessageSecret = null; + MsgOpaqueData.prototype.targetMessageKey = null; + MsgOpaqueData.prototype.encPayload = null; + MsgOpaqueData.prototype.encIv = null; + MsgOpaqueData.prototype.eventName = null; + MsgOpaqueData.prototype.isEventCanceled = null; + MsgOpaqueData.prototype.eventDescription = null; + MsgOpaqueData.prototype.eventJoinLink = null; + MsgOpaqueData.prototype.eventStartTime = null; MsgOpaqueData.prototype.eventLocation = null; - MsgOpaqueData.prototype.eventEndTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MsgOpaqueData.prototype.plainProtobufBytes = $util.newBuffer([]); + MsgOpaqueData.prototype.eventEndTime = null; + MsgOpaqueData.prototype.plainProtobufBytes = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_body", { + get: $util.oneOfGetter($oneOfFields = ["body"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_caption", { + get: $util.oneOfGetter($oneOfFields = ["caption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_lng", { + get: $util.oneOfGetter($oneOfFields = ["lng"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_isLive", { + get: $util.oneOfGetter($oneOfFields = ["isLive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_lat", { + get: $util.oneOfGetter($oneOfFields = ["lat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_paymentAmount1000", { + get: $util.oneOfGetter($oneOfFields = ["paymentAmount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_paymentNoteMsgBody", { + get: $util.oneOfGetter($oneOfFields = ["paymentNoteMsgBody"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_matchedText", { + get: $util.oneOfGetter($oneOfFields = ["matchedText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_futureproofBuffer", { + get: $util.oneOfGetter($oneOfFields = ["futureproofBuffer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_clientUrl", { + get: $util.oneOfGetter($oneOfFields = ["clientUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_loc", { + get: $util.oneOfGetter($oneOfFields = ["loc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_pollName", { + get: $util.oneOfGetter($oneOfFields = ["pollName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_pollSelectableOptionsCount", { + get: $util.oneOfGetter($oneOfFields = ["pollSelectableOptionsCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_messageSecret", { + get: $util.oneOfGetter($oneOfFields = ["messageSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_originalSelfAuthor", { + get: $util.oneOfGetter($oneOfFields = ["originalSelfAuthor"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_pollUpdateParentKey", { + get: $util.oneOfGetter($oneOfFields = ["pollUpdateParentKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_encPollVote", { + get: $util.oneOfGetter($oneOfFields = ["encPollVote"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_isSentCagPollCreation", { + get: $util.oneOfGetter($oneOfFields = ["isSentCagPollCreation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_pollContentType", { + get: $util.oneOfGetter($oneOfFields = ["pollContentType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_pollVotesSnapshot", { + get: $util.oneOfGetter($oneOfFields = ["pollVotesSnapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_encReactionTargetMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["encReactionTargetMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_encReactionEncPayload", { + get: $util.oneOfGetter($oneOfFields = ["encReactionEncPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_encReactionEncIv", { + get: $util.oneOfGetter($oneOfFields = ["encReactionEncIv"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_botMessageSecret", { + get: $util.oneOfGetter($oneOfFields = ["botMessageSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_targetMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["targetMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_eventName", { + get: $util.oneOfGetter($oneOfFields = ["eventName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_isEventCanceled", { + get: $util.oneOfGetter($oneOfFields = ["isEventCanceled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_eventDescription", { + get: $util.oneOfGetter($oneOfFields = ["eventDescription"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_eventJoinLink", { + get: $util.oneOfGetter($oneOfFields = ["eventJoinLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_eventStartTime", { + get: $util.oneOfGetter($oneOfFields = ["eventStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_eventLocation", { + get: $util.oneOfGetter($oneOfFields = ["eventLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_eventEndTime", { + get: $util.oneOfGetter($oneOfFields = ["eventEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgOpaqueData.prototype, "_plainProtobufBytes", { + get: $util.oneOfGetter($oneOfFields = ["plainProtobufBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); MsgOpaqueData.create = function create(properties) { return new MsgOpaqueData(properties); @@ -26057,6 +58665,424 @@ export const proto = $root.proto = (() => { return m; }; + MsgOpaqueData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MsgOpaqueData) + return d; + var m = new $root.proto.MsgOpaqueData(); + if (d.body != null) { + m.body = String(d.body); + } + if (d.caption != null) { + m.caption = String(d.caption); + } + if (d.lng != null) { + m.lng = Number(d.lng); + } + if (d.isLive != null) { + m.isLive = Boolean(d.isLive); + } + if (d.lat != null) { + m.lat = Number(d.lat); + } + if (d.paymentAmount1000 != null) { + m.paymentAmount1000 = d.paymentAmount1000 | 0; + } + if (d.paymentNoteMsgBody != null) { + m.paymentNoteMsgBody = String(d.paymentNoteMsgBody); + } + if (d.matchedText != null) { + m.matchedText = String(d.matchedText); + } + if (d.title != null) { + m.title = String(d.title); + } + if (d.description != null) { + m.description = String(d.description); + } + if (d.futureproofBuffer != null) { + if (typeof d.futureproofBuffer === "string") + $util.base64.decode(d.futureproofBuffer, m.futureproofBuffer = $util.newBuffer($util.base64.length(d.futureproofBuffer)), 0); + else if (d.futureproofBuffer.length >= 0) + m.futureproofBuffer = d.futureproofBuffer; + } + if (d.clientUrl != null) { + m.clientUrl = String(d.clientUrl); + } + if (d.loc != null) { + m.loc = String(d.loc); + } + if (d.pollName != null) { + m.pollName = String(d.pollName); + } + if (d.pollOptions) { + if (!Array.isArray(d.pollOptions)) + throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected"); + m.pollOptions = []; + for (var i = 0; i < d.pollOptions.length; ++i) { + if (typeof d.pollOptions[i] !== "object") + throw TypeError(".proto.MsgOpaqueData.pollOptions: object expected"); + m.pollOptions[i] = $root.proto.MsgOpaqueData.PollOption.fromObject(d.pollOptions[i]); + } + } + if (d.pollSelectableOptionsCount != null) { + m.pollSelectableOptionsCount = d.pollSelectableOptionsCount >>> 0; + } + if (d.messageSecret != null) { + if (typeof d.messageSecret === "string") + $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0); + else if (d.messageSecret.length >= 0) + m.messageSecret = d.messageSecret; + } + if (d.originalSelfAuthor != null) { + m.originalSelfAuthor = String(d.originalSelfAuthor); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + if (d.pollUpdateParentKey != null) { + m.pollUpdateParentKey = String(d.pollUpdateParentKey); + } + if (d.encPollVote != null) { + if (typeof d.encPollVote !== "object") + throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected"); + m.encPollVote = $root.proto.PollEncValue.fromObject(d.encPollVote); + } + if (d.isSentCagPollCreation != null) { + m.isSentCagPollCreation = Boolean(d.isSentCagPollCreation); + } + switch (d.pollContentType) { + default: + if (typeof d.pollContentType === "number") { + m.pollContentType = d.pollContentType; + break; + } + break; + case "UNKNOWN": + case 0: + m.pollContentType = 0; + break; + case "TEXT": + case 1: + m.pollContentType = 1; + break; + case "IMAGE": + case 2: + m.pollContentType = 2; + break; + } + if (d.pollVotesSnapshot != null) { + if (typeof d.pollVotesSnapshot !== "object") + throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected"); + m.pollVotesSnapshot = $root.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(d.pollVotesSnapshot); + } + if (d.encReactionTargetMessageKey != null) { + m.encReactionTargetMessageKey = String(d.encReactionTargetMessageKey); + } + if (d.encReactionEncPayload != null) { + if (typeof d.encReactionEncPayload === "string") + $util.base64.decode(d.encReactionEncPayload, m.encReactionEncPayload = $util.newBuffer($util.base64.length(d.encReactionEncPayload)), 0); + else if (d.encReactionEncPayload.length >= 0) + m.encReactionEncPayload = d.encReactionEncPayload; + } + if (d.encReactionEncIv != null) { + if (typeof d.encReactionEncIv === "string") + $util.base64.decode(d.encReactionEncIv, m.encReactionEncIv = $util.newBuffer($util.base64.length(d.encReactionEncIv)), 0); + else if (d.encReactionEncIv.length >= 0) + m.encReactionEncIv = d.encReactionEncIv; + } + if (d.botMessageSecret != null) { + if (typeof d.botMessageSecret === "string") + $util.base64.decode(d.botMessageSecret, m.botMessageSecret = $util.newBuffer($util.base64.length(d.botMessageSecret)), 0); + else if (d.botMessageSecret.length >= 0) + m.botMessageSecret = d.botMessageSecret; + } + if (d.targetMessageKey != null) { + m.targetMessageKey = String(d.targetMessageKey); + } + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + if (d.eventName != null) { + m.eventName = String(d.eventName); + } + if (d.isEventCanceled != null) { + m.isEventCanceled = Boolean(d.isEventCanceled); + } + if (d.eventDescription != null) { + m.eventDescription = String(d.eventDescription); + } + if (d.eventJoinLink != null) { + m.eventJoinLink = String(d.eventJoinLink); + } + if (d.eventStartTime != null) { + if ($util.Long) + (m.eventStartTime = $util.Long.fromValue(d.eventStartTime)).unsigned = false; + else if (typeof d.eventStartTime === "string") + m.eventStartTime = parseInt(d.eventStartTime, 10); + else if (typeof d.eventStartTime === "number") + m.eventStartTime = d.eventStartTime; + else if (typeof d.eventStartTime === "object") + m.eventStartTime = new $util.LongBits(d.eventStartTime.low >>> 0, d.eventStartTime.high >>> 0).toNumber(); + } + if (d.eventLocation != null) { + if (typeof d.eventLocation !== "object") + throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected"); + m.eventLocation = $root.proto.MsgOpaqueData.EventLocation.fromObject(d.eventLocation); + } + if (d.eventEndTime != null) { + if ($util.Long) + (m.eventEndTime = $util.Long.fromValue(d.eventEndTime)).unsigned = false; + else if (typeof d.eventEndTime === "string") + m.eventEndTime = parseInt(d.eventEndTime, 10); + else if (typeof d.eventEndTime === "number") + m.eventEndTime = d.eventEndTime; + else if (typeof d.eventEndTime === "object") + m.eventEndTime = new $util.LongBits(d.eventEndTime.low >>> 0, d.eventEndTime.high >>> 0).toNumber(); + } + if (d.plainProtobufBytes != null) { + if (typeof d.plainProtobufBytes === "string") + $util.base64.decode(d.plainProtobufBytes, m.plainProtobufBytes = $util.newBuffer($util.base64.length(d.plainProtobufBytes)), 0); + else if (d.plainProtobufBytes.length >= 0) + m.plainProtobufBytes = d.plainProtobufBytes; + } + return m; + }; + + MsgOpaqueData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.pollOptions = []; + } + if (m.body != null && m.hasOwnProperty("body")) { + d.body = m.body; + if (o.oneofs) + d._body = "body"; + } + if (m.caption != null && m.hasOwnProperty("caption")) { + d.caption = m.caption; + if (o.oneofs) + d._caption = "caption"; + } + if (m.lng != null && m.hasOwnProperty("lng")) { + d.lng = o.json && !isFinite(m.lng) ? String(m.lng) : m.lng; + if (o.oneofs) + d._lng = "lng"; + } + if (m.isLive != null && m.hasOwnProperty("isLive")) { + d.isLive = m.isLive; + if (o.oneofs) + d._isLive = "isLive"; + } + if (m.lat != null && m.hasOwnProperty("lat")) { + d.lat = o.json && !isFinite(m.lat) ? String(m.lat) : m.lat; + if (o.oneofs) + d._lat = "lat"; + } + if (m.paymentAmount1000 != null && m.hasOwnProperty("paymentAmount1000")) { + d.paymentAmount1000 = m.paymentAmount1000; + if (o.oneofs) + d._paymentAmount1000 = "paymentAmount1000"; + } + if (m.paymentNoteMsgBody != null && m.hasOwnProperty("paymentNoteMsgBody")) { + d.paymentNoteMsgBody = m.paymentNoteMsgBody; + if (o.oneofs) + d._paymentNoteMsgBody = "paymentNoteMsgBody"; + } + if (m.matchedText != null && m.hasOwnProperty("matchedText")) { + d.matchedText = m.matchedText; + if (o.oneofs) + d._matchedText = "matchedText"; + } + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.description != null && m.hasOwnProperty("description")) { + d.description = m.description; + if (o.oneofs) + d._description = "description"; + } + if (m.futureproofBuffer != null && m.hasOwnProperty("futureproofBuffer")) { + d.futureproofBuffer = o.bytes === String ? $util.base64.encode(m.futureproofBuffer, 0, m.futureproofBuffer.length) : o.bytes === Array ? Array.prototype.slice.call(m.futureproofBuffer) : m.futureproofBuffer; + if (o.oneofs) + d._futureproofBuffer = "futureproofBuffer"; + } + if (m.clientUrl != null && m.hasOwnProperty("clientUrl")) { + d.clientUrl = m.clientUrl; + if (o.oneofs) + d._clientUrl = "clientUrl"; + } + if (m.loc != null && m.hasOwnProperty("loc")) { + d.loc = m.loc; + if (o.oneofs) + d._loc = "loc"; + } + if (m.pollName != null && m.hasOwnProperty("pollName")) { + d.pollName = m.pollName; + if (o.oneofs) + d._pollName = "pollName"; + } + if (m.pollOptions && m.pollOptions.length) { + d.pollOptions = []; + for (var j = 0; j < m.pollOptions.length; ++j) { + d.pollOptions[j] = $root.proto.MsgOpaqueData.PollOption.toObject(m.pollOptions[j], o); + } + } + if (m.pollSelectableOptionsCount != null && m.hasOwnProperty("pollSelectableOptionsCount")) { + d.pollSelectableOptionsCount = m.pollSelectableOptionsCount; + if (o.oneofs) + d._pollSelectableOptionsCount = "pollSelectableOptionsCount"; + } + if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) { + d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret; + if (o.oneofs) + d._messageSecret = "messageSecret"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + if (m.pollUpdateParentKey != null && m.hasOwnProperty("pollUpdateParentKey")) { + d.pollUpdateParentKey = m.pollUpdateParentKey; + if (o.oneofs) + d._pollUpdateParentKey = "pollUpdateParentKey"; + } + if (m.encPollVote != null && m.hasOwnProperty("encPollVote")) { + d.encPollVote = $root.proto.PollEncValue.toObject(m.encPollVote, o); + if (o.oneofs) + d._encPollVote = "encPollVote"; + } + if (m.encReactionTargetMessageKey != null && m.hasOwnProperty("encReactionTargetMessageKey")) { + d.encReactionTargetMessageKey = m.encReactionTargetMessageKey; + if (o.oneofs) + d._encReactionTargetMessageKey = "encReactionTargetMessageKey"; + } + if (m.encReactionEncPayload != null && m.hasOwnProperty("encReactionEncPayload")) { + d.encReactionEncPayload = o.bytes === String ? $util.base64.encode(m.encReactionEncPayload, 0, m.encReactionEncPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encReactionEncPayload) : m.encReactionEncPayload; + if (o.oneofs) + d._encReactionEncPayload = "encReactionEncPayload"; + } + if (m.encReactionEncIv != null && m.hasOwnProperty("encReactionEncIv")) { + d.encReactionEncIv = o.bytes === String ? $util.base64.encode(m.encReactionEncIv, 0, m.encReactionEncIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encReactionEncIv) : m.encReactionEncIv; + if (o.oneofs) + d._encReactionEncIv = "encReactionEncIv"; + } + if (m.isSentCagPollCreation != null && m.hasOwnProperty("isSentCagPollCreation")) { + d.isSentCagPollCreation = m.isSentCagPollCreation; + if (o.oneofs) + d._isSentCagPollCreation = "isSentCagPollCreation"; + } + if (m.botMessageSecret != null && m.hasOwnProperty("botMessageSecret")) { + d.botMessageSecret = o.bytes === String ? $util.base64.encode(m.botMessageSecret, 0, m.botMessageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.botMessageSecret) : m.botMessageSecret; + if (o.oneofs) + d._botMessageSecret = "botMessageSecret"; + } + if (m.targetMessageKey != null && m.hasOwnProperty("targetMessageKey")) { + d.targetMessageKey = m.targetMessageKey; + if (o.oneofs) + d._targetMessageKey = "targetMessageKey"; + } + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + if (m.eventName != null && m.hasOwnProperty("eventName")) { + d.eventName = m.eventName; + if (o.oneofs) + d._eventName = "eventName"; + } + if (m.isEventCanceled != null && m.hasOwnProperty("isEventCanceled")) { + d.isEventCanceled = m.isEventCanceled; + if (o.oneofs) + d._isEventCanceled = "isEventCanceled"; + } + if (m.eventDescription != null && m.hasOwnProperty("eventDescription")) { + d.eventDescription = m.eventDescription; + if (o.oneofs) + d._eventDescription = "eventDescription"; + } + if (m.eventJoinLink != null && m.hasOwnProperty("eventJoinLink")) { + d.eventJoinLink = m.eventJoinLink; + if (o.oneofs) + d._eventJoinLink = "eventJoinLink"; + } + if (m.eventStartTime != null && m.hasOwnProperty("eventStartTime")) { + if (typeof m.eventStartTime === "number") + d.eventStartTime = o.longs === String ? String(m.eventStartTime) : m.eventStartTime; + else + d.eventStartTime = o.longs === String ? $util.Long.prototype.toString.call(m.eventStartTime) : o.longs === Number ? new $util.LongBits(m.eventStartTime.low >>> 0, m.eventStartTime.high >>> 0).toNumber() : m.eventStartTime; + if (o.oneofs) + d._eventStartTime = "eventStartTime"; + } + if (m.eventLocation != null && m.hasOwnProperty("eventLocation")) { + d.eventLocation = $root.proto.MsgOpaqueData.EventLocation.toObject(m.eventLocation, o); + if (o.oneofs) + d._eventLocation = "eventLocation"; + } + if (m.eventEndTime != null && m.hasOwnProperty("eventEndTime")) { + if (typeof m.eventEndTime === "number") + d.eventEndTime = o.longs === String ? String(m.eventEndTime) : m.eventEndTime; + else + d.eventEndTime = o.longs === String ? $util.Long.prototype.toString.call(m.eventEndTime) : o.longs === Number ? new $util.LongBits(m.eventEndTime.low >>> 0, m.eventEndTime.high >>> 0).toNumber() : m.eventEndTime; + if (o.oneofs) + d._eventEndTime = "eventEndTime"; + } + if (m.pollVotesSnapshot != null && m.hasOwnProperty("pollVotesSnapshot")) { + d.pollVotesSnapshot = $root.proto.MsgOpaqueData.PollVotesSnapshot.toObject(m.pollVotesSnapshot, o); + if (o.oneofs) + d._pollVotesSnapshot = "pollVotesSnapshot"; + } + if (m.pollContentType != null && m.hasOwnProperty("pollContentType")) { + d.pollContentType = o.enums === String ? $root.proto.MsgOpaqueData.PollContentType[m.pollContentType] === undefined ? m.pollContentType : $root.proto.MsgOpaqueData.PollContentType[m.pollContentType] : m.pollContentType; + if (o.oneofs) + d._pollContentType = "pollContentType"; + } + if (m.plainProtobufBytes != null && m.hasOwnProperty("plainProtobufBytes")) { + d.plainProtobufBytes = o.bytes === String ? $util.base64.encode(m.plainProtobufBytes, 0, m.plainProtobufBytes.length) : o.bytes === Array ? Array.prototype.slice.call(m.plainProtobufBytes) : m.plainProtobufBytes; + if (o.oneofs) + d._plainProtobufBytes = "plainProtobufBytes"; + } + if (m.originalSelfAuthor != null && m.hasOwnProperty("originalSelfAuthor")) { + d.originalSelfAuthor = m.originalSelfAuthor; + if (o.oneofs) + d._originalSelfAuthor = "originalSelfAuthor"; + } + return d; + }; + + MsgOpaqueData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MsgOpaqueData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26073,12 +59099,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - EventLocation.prototype.degreesLatitude = 0; - EventLocation.prototype.degreesLongitude = 0; - EventLocation.prototype.name = ""; - EventLocation.prototype.address = ""; - EventLocation.prototype.url = ""; - EventLocation.prototype.jpegThumbnail = $util.newBuffer([]); + EventLocation.prototype.degreesLatitude = null; + EventLocation.prototype.degreesLongitude = null; + EventLocation.prototype.name = null; + EventLocation.prototype.address = null; + EventLocation.prototype.url = null; + EventLocation.prototype.jpegThumbnail = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventLocation.prototype, "_degreesLatitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLatitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventLocation.prototype, "_degreesLongitude", { + get: $util.oneOfGetter($oneOfFields = ["degreesLongitude"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventLocation.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventLocation.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventLocation.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EventLocation.prototype, "_jpegThumbnail", { + get: $util.oneOfGetter($oneOfFields = ["jpegThumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); EventLocation.create = function create(properties) { return new EventLocation(properties); @@ -26143,6 +59207,75 @@ export const proto = $root.proto = (() => { return m; }; + EventLocation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MsgOpaqueData.EventLocation) + return d; + var m = new $root.proto.MsgOpaqueData.EventLocation(); + if (d.degreesLatitude != null) { + m.degreesLatitude = Number(d.degreesLatitude); + } + if (d.degreesLongitude != null) { + m.degreesLongitude = Number(d.degreesLongitude); + } + if (d.name != null) { + m.name = String(d.name); + } + if (d.address != null) { + m.address = String(d.address); + } + if (d.url != null) { + m.url = String(d.url); + } + if (d.jpegThumbnail != null) { + if (typeof d.jpegThumbnail === "string") + $util.base64.decode(d.jpegThumbnail, m.jpegThumbnail = $util.newBuffer($util.base64.length(d.jpegThumbnail)), 0); + else if (d.jpegThumbnail.length >= 0) + m.jpegThumbnail = d.jpegThumbnail; + } + return m; + }; + + EventLocation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.degreesLatitude != null && m.hasOwnProperty("degreesLatitude")) { + d.degreesLatitude = o.json && !isFinite(m.degreesLatitude) ? String(m.degreesLatitude) : m.degreesLatitude; + if (o.oneofs) + d._degreesLatitude = "degreesLatitude"; + } + if (m.degreesLongitude != null && m.hasOwnProperty("degreesLongitude")) { + d.degreesLongitude = o.json && !isFinite(m.degreesLongitude) ? String(m.degreesLongitude) : m.degreesLongitude; + if (o.oneofs) + d._degreesLongitude = "degreesLongitude"; + } + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.address != null && m.hasOwnProperty("address")) { + d.address = m.address; + if (o.oneofs) + d._address = "address"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.jpegThumbnail != null && m.hasOwnProperty("jpegThumbnail")) { + d.jpegThumbnail = o.bytes === String ? $util.base64.encode(m.jpegThumbnail, 0, m.jpegThumbnail.length) : o.bytes === Array ? Array.prototype.slice.call(m.jpegThumbnail) : m.jpegThumbnail; + if (o.oneofs) + d._jpegThumbnail = "jpegThumbnail"; + } + return d; + }; + + EventLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EventLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26170,8 +59303,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollOption.prototype.name = ""; - PollOption.prototype.hash = ""; + PollOption.prototype.name = null; + PollOption.prototype.hash = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollOption.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollOption.prototype, "_hash", { + get: $util.oneOfGetter($oneOfFields = ["hash"]), + set: $util.oneOfSetter($oneOfFields) + }); PollOption.create = function create(properties) { return new PollOption(properties); @@ -26212,6 +59359,40 @@ export const proto = $root.proto = (() => { return m; }; + PollOption.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MsgOpaqueData.PollOption) + return d; + var m = new $root.proto.MsgOpaqueData.PollOption(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.hash != null) { + m.hash = String(d.hash); + } + return m; + }; + + PollOption.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.hash != null && m.hasOwnProperty("hash")) { + d.hash = m.hash; + if (o.oneofs) + d._hash = "hash"; + } + return d; + }; + + PollOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26232,7 +59413,21 @@ export const proto = $root.proto = (() => { } PollVoteSnapshot.prototype.option = null; - PollVoteSnapshot.prototype.optionVoteCount = 0; + PollVoteSnapshot.prototype.optionVoteCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollVoteSnapshot.prototype, "_option", { + get: $util.oneOfGetter($oneOfFields = ["option"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollVoteSnapshot.prototype, "_optionVoteCount", { + get: $util.oneOfGetter($oneOfFields = ["optionVoteCount"]), + set: $util.oneOfSetter($oneOfFields) + }); PollVoteSnapshot.create = function create(properties) { return new PollVoteSnapshot(properties); @@ -26273,6 +59468,42 @@ export const proto = $root.proto = (() => { return m; }; + PollVoteSnapshot.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MsgOpaqueData.PollVoteSnapshot) + return d; + var m = new $root.proto.MsgOpaqueData.PollVoteSnapshot(); + if (d.option != null) { + if (typeof d.option !== "object") + throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected"); + m.option = $root.proto.MsgOpaqueData.PollOption.fromObject(d.option); + } + if (d.optionVoteCount != null) { + m.optionVoteCount = d.optionVoteCount | 0; + } + return m; + }; + + PollVoteSnapshot.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.option != null && m.hasOwnProperty("option")) { + d.option = $root.proto.MsgOpaqueData.PollOption.toObject(m.option, o); + if (o.oneofs) + d._option = "option"; + } + if (m.optionVoteCount != null && m.hasOwnProperty("optionVoteCount")) { + d.optionVoteCount = m.optionVoteCount; + if (o.oneofs) + d._optionVoteCount = "optionVoteCount"; + } + return d; + }; + + PollVoteSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollVoteSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26332,6 +59563,43 @@ export const proto = $root.proto = (() => { return m; }; + PollVotesSnapshot.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MsgOpaqueData.PollVotesSnapshot) + return d; + var m = new $root.proto.MsgOpaqueData.PollVotesSnapshot(); + if (d.pollVotes) { + if (!Array.isArray(d.pollVotes)) + throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected"); + m.pollVotes = []; + for (var i = 0; i < d.pollVotes.length; ++i) { + if (typeof d.pollVotes[i] !== "object") + throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: object expected"); + m.pollVotes[i] = $root.proto.MsgOpaqueData.PollVoteSnapshot.fromObject(d.pollVotes[i]); + } + } + return m; + }; + + PollVotesSnapshot.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.pollVotes = []; + } + if (m.pollVotes && m.pollVotes.length) { + d.pollVotes = []; + for (var j = 0; j < m.pollVotes.length; ++j) { + d.pollVotes[j] = $root.proto.MsgOpaqueData.PollVoteSnapshot.toObject(m.pollVotes[j], o); + } + } + return d; + }; + + PollVotesSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollVotesSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26357,6 +59625,20 @@ export const proto = $root.proto = (() => { MsgRowOpaqueData.prototype.currentMsg = null; MsgRowOpaqueData.prototype.quotedMsg = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgRowOpaqueData.prototype, "_currentMsg", { + get: $util.oneOfGetter($oneOfFields = ["currentMsg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MsgRowOpaqueData.prototype, "_quotedMsg", { + get: $util.oneOfGetter($oneOfFields = ["quotedMsg"]), + set: $util.oneOfSetter($oneOfFields) + }); + MsgRowOpaqueData.create = function create(properties) { return new MsgRowOpaqueData(properties); }; @@ -26396,6 +59678,44 @@ export const proto = $root.proto = (() => { return m; }; + MsgRowOpaqueData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.MsgRowOpaqueData) + return d; + var m = new $root.proto.MsgRowOpaqueData(); + if (d.currentMsg != null) { + if (typeof d.currentMsg !== "object") + throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected"); + m.currentMsg = $root.proto.MsgOpaqueData.fromObject(d.currentMsg); + } + if (d.quotedMsg != null) { + if (typeof d.quotedMsg !== "object") + throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected"); + m.quotedMsg = $root.proto.MsgOpaqueData.fromObject(d.quotedMsg); + } + return m; + }; + + MsgRowOpaqueData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.currentMsg != null && m.hasOwnProperty("currentMsg")) { + d.currentMsg = $root.proto.MsgOpaqueData.toObject(m.currentMsg, o); + if (o.oneofs) + d._currentMsg = "currentMsg"; + } + if (m.quotedMsg != null && m.hasOwnProperty("quotedMsg")) { + d.quotedMsg = $root.proto.MsgOpaqueData.toObject(m.quotedMsg, o); + if (o.oneofs) + d._quotedMsg = "quotedMsg"; + } + return d; + }; + + MsgRowOpaqueData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MsgRowOpaqueData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26415,8 +59735,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NoiseCertificate.prototype.details = $util.newBuffer([]); - NoiseCertificate.prototype.signature = $util.newBuffer([]); + NoiseCertificate.prototype.details = null; + NoiseCertificate.prototype.signature = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoiseCertificate.prototype, "_details", { + get: $util.oneOfGetter($oneOfFields = ["details"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoiseCertificate.prototype, "_signature", { + get: $util.oneOfGetter($oneOfFields = ["signature"]), + set: $util.oneOfSetter($oneOfFields) + }); NoiseCertificate.create = function create(properties) { return new NoiseCertificate(properties); @@ -26457,6 +59791,46 @@ export const proto = $root.proto = (() => { return m; }; + NoiseCertificate.fromObject = function fromObject(d) { + if (d instanceof $root.proto.NoiseCertificate) + return d; + var m = new $root.proto.NoiseCertificate(); + if (d.details != null) { + if (typeof d.details === "string") + $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); + else if (d.details.length >= 0) + m.details = d.details; + } + if (d.signature != null) { + if (typeof d.signature === "string") + $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0); + else if (d.signature.length >= 0) + m.signature = d.signature; + } + return m; + }; + + NoiseCertificate.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.details != null && m.hasOwnProperty("details")) { + d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; + if (o.oneofs) + d._details = "details"; + } + if (m.signature != null && m.hasOwnProperty("signature")) { + d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature; + if (o.oneofs) + d._signature = "signature"; + } + return d; + }; + + NoiseCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NoiseCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26473,11 +59847,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Details.prototype.serial = 0; - Details.prototype.issuer = ""; - Details.prototype.expires = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Details.prototype.subject = ""; - Details.prototype.key = $util.newBuffer([]); + Details.prototype.serial = null; + Details.prototype.issuer = null; + Details.prototype.expires = null; + Details.prototype.subject = null; + Details.prototype.key = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_serial", { + get: $util.oneOfGetter($oneOfFields = ["serial"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_issuer", { + get: $util.oneOfGetter($oneOfFields = ["issuer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_expires", { + get: $util.oneOfGetter($oneOfFields = ["expires"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_subject", { + get: $util.oneOfGetter($oneOfFields = ["subject"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); Details.create = function create(properties) { return new Details(properties); @@ -26536,6 +59942,77 @@ export const proto = $root.proto = (() => { return m; }; + Details.fromObject = function fromObject(d) { + if (d instanceof $root.proto.NoiseCertificate.Details) + return d; + var m = new $root.proto.NoiseCertificate.Details(); + if (d.serial != null) { + m.serial = d.serial >>> 0; + } + if (d.issuer != null) { + m.issuer = String(d.issuer); + } + if (d.expires != null) { + if ($util.Long) + (m.expires = $util.Long.fromValue(d.expires)).unsigned = true; + else if (typeof d.expires === "string") + m.expires = parseInt(d.expires, 10); + else if (typeof d.expires === "number") + m.expires = d.expires; + else if (typeof d.expires === "object") + m.expires = new $util.LongBits(d.expires.low >>> 0, d.expires.high >>> 0).toNumber(true); + } + if (d.subject != null) { + m.subject = String(d.subject); + } + if (d.key != null) { + if (typeof d.key === "string") + $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0); + else if (d.key.length >= 0) + m.key = d.key; + } + return m; + }; + + Details.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.serial != null && m.hasOwnProperty("serial")) { + d.serial = m.serial; + if (o.oneofs) + d._serial = "serial"; + } + if (m.issuer != null && m.hasOwnProperty("issuer")) { + d.issuer = m.issuer; + if (o.oneofs) + d._issuer = "issuer"; + } + if (m.expires != null && m.hasOwnProperty("expires")) { + if (typeof m.expires === "number") + d.expires = o.longs === String ? String(m.expires) : m.expires; + else + d.expires = o.longs === String ? $util.Long.prototype.toString.call(m.expires) : o.longs === Number ? new $util.LongBits(m.expires.low >>> 0, m.expires.high >>> 0).toNumber(true) : m.expires; + if (o.oneofs) + d._expires = "expires"; + } + if (m.subject != null && m.hasOwnProperty("subject")) { + d.subject = m.subject; + if (o.oneofs) + d._subject = "subject"; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key; + if (o.oneofs) + d._key = "key"; + } + return d; + }; + + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26560,8 +60037,34 @@ export const proto = $root.proto = (() => { NotificationMessageInfo.prototype.key = null; NotificationMessageInfo.prototype.message = null; - NotificationMessageInfo.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - NotificationMessageInfo.prototype.participant = ""; + NotificationMessageInfo.prototype.messageTimestamp = null; + NotificationMessageInfo.prototype.participant = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationMessageInfo.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationMessageInfo.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationMessageInfo.prototype, "_messageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["messageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationMessageInfo.prototype, "_participant", { + get: $util.oneOfGetter($oneOfFields = ["participant"]), + set: $util.oneOfSetter($oneOfFields) + }); NotificationMessageInfo.create = function create(properties) { return new NotificationMessageInfo(properties); @@ -26614,6 +60117,70 @@ export const proto = $root.proto = (() => { return m; }; + NotificationMessageInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.NotificationMessageInfo) + return d; + var m = new $root.proto.NotificationMessageInfo(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.NotificationMessageInfo.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.NotificationMessageInfo.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + if (d.messageTimestamp != null) { + if ($util.Long) + (m.messageTimestamp = $util.Long.fromValue(d.messageTimestamp)).unsigned = true; + else if (typeof d.messageTimestamp === "string") + m.messageTimestamp = parseInt(d.messageTimestamp, 10); + else if (typeof d.messageTimestamp === "number") + m.messageTimestamp = d.messageTimestamp; + else if (typeof d.messageTimestamp === "object") + m.messageTimestamp = new $util.LongBits(d.messageTimestamp.low >>> 0, d.messageTimestamp.high >>> 0).toNumber(true); + } + if (d.participant != null) { + m.participant = String(d.participant); + } + return m; + }; + + NotificationMessageInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + if (m.messageTimestamp != null && m.hasOwnProperty("messageTimestamp")) { + if (typeof m.messageTimestamp === "number") + d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp; + else + d.messageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageTimestamp) : o.longs === Number ? new $util.LongBits(m.messageTimestamp.low >>> 0, m.messageTimestamp.high >>> 0).toNumber(true) : m.messageTimestamp; + if (o.oneofs) + d._messageTimestamp = "messageTimestamp"; + } + if (m.participant != null && m.hasOwnProperty("participant")) { + d.participant = m.participant; + if (o.oneofs) + d._participant = "participant"; + } + return d; + }; + + NotificationMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NotificationMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26633,12 +60200,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NotificationSettings.prototype.messageVibrate = ""; - NotificationSettings.prototype.messagePopup = ""; - NotificationSettings.prototype.messageLight = ""; - NotificationSettings.prototype.lowPriorityNotifications = false; - NotificationSettings.prototype.reactionsMuted = false; - NotificationSettings.prototype.callVibrate = ""; + NotificationSettings.prototype.messageVibrate = null; + NotificationSettings.prototype.messagePopup = null; + NotificationSettings.prototype.messageLight = null; + NotificationSettings.prototype.lowPriorityNotifications = null; + NotificationSettings.prototype.reactionsMuted = null; + NotificationSettings.prototype.callVibrate = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationSettings.prototype, "_messageVibrate", { + get: $util.oneOfGetter($oneOfFields = ["messageVibrate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationSettings.prototype, "_messagePopup", { + get: $util.oneOfGetter($oneOfFields = ["messagePopup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationSettings.prototype, "_messageLight", { + get: $util.oneOfGetter($oneOfFields = ["messageLight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationSettings.prototype, "_lowPriorityNotifications", { + get: $util.oneOfGetter($oneOfFields = ["lowPriorityNotifications"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationSettings.prototype, "_reactionsMuted", { + get: $util.oneOfGetter($oneOfFields = ["reactionsMuted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationSettings.prototype, "_callVibrate", { + get: $util.oneOfGetter($oneOfFields = ["callVibrate"]), + set: $util.oneOfSetter($oneOfFields) + }); NotificationSettings.create = function create(properties) { return new NotificationSettings(properties); @@ -26703,6 +60308,72 @@ export const proto = $root.proto = (() => { return m; }; + NotificationSettings.fromObject = function fromObject(d) { + if (d instanceof $root.proto.NotificationSettings) + return d; + var m = new $root.proto.NotificationSettings(); + if (d.messageVibrate != null) { + m.messageVibrate = String(d.messageVibrate); + } + if (d.messagePopup != null) { + m.messagePopup = String(d.messagePopup); + } + if (d.messageLight != null) { + m.messageLight = String(d.messageLight); + } + if (d.lowPriorityNotifications != null) { + m.lowPriorityNotifications = Boolean(d.lowPriorityNotifications); + } + if (d.reactionsMuted != null) { + m.reactionsMuted = Boolean(d.reactionsMuted); + } + if (d.callVibrate != null) { + m.callVibrate = String(d.callVibrate); + } + return m; + }; + + NotificationSettings.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageVibrate != null && m.hasOwnProperty("messageVibrate")) { + d.messageVibrate = m.messageVibrate; + if (o.oneofs) + d._messageVibrate = "messageVibrate"; + } + if (m.messagePopup != null && m.hasOwnProperty("messagePopup")) { + d.messagePopup = m.messagePopup; + if (o.oneofs) + d._messagePopup = "messagePopup"; + } + if (m.messageLight != null && m.hasOwnProperty("messageLight")) { + d.messageLight = m.messageLight; + if (o.oneofs) + d._messageLight = "messageLight"; + } + if (m.lowPriorityNotifications != null && m.hasOwnProperty("lowPriorityNotifications")) { + d.lowPriorityNotifications = m.lowPriorityNotifications; + if (o.oneofs) + d._lowPriorityNotifications = "lowPriorityNotifications"; + } + if (m.reactionsMuted != null && m.hasOwnProperty("reactionsMuted")) { + d.reactionsMuted = m.reactionsMuted; + if (o.oneofs) + d._reactionsMuted = "reactionsMuted"; + } + if (m.callVibrate != null && m.hasOwnProperty("callVibrate")) { + d.callVibrate = m.callVibrate; + if (o.oneofs) + d._callVibrate = "callVibrate"; + } + return d; + }; + + NotificationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NotificationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26722,9 +60393,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PairingRequest.prototype.companionPublicKey = $util.newBuffer([]); - PairingRequest.prototype.companionIdentityKey = $util.newBuffer([]); - PairingRequest.prototype.advSecret = $util.newBuffer([]); + PairingRequest.prototype.companionPublicKey = null; + PairingRequest.prototype.companionIdentityKey = null; + PairingRequest.prototype.advSecret = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PairingRequest.prototype, "_companionPublicKey", { + get: $util.oneOfGetter($oneOfFields = ["companionPublicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PairingRequest.prototype, "_companionIdentityKey", { + get: $util.oneOfGetter($oneOfFields = ["companionIdentityKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PairingRequest.prototype, "_advSecret", { + get: $util.oneOfGetter($oneOfFields = ["advSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); PairingRequest.create = function create(properties) { return new PairingRequest(properties); @@ -26771,6 +60462,57 @@ export const proto = $root.proto = (() => { return m; }; + PairingRequest.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PairingRequest) + return d; + var m = new $root.proto.PairingRequest(); + if (d.companionPublicKey != null) { + if (typeof d.companionPublicKey === "string") + $util.base64.decode(d.companionPublicKey, m.companionPublicKey = $util.newBuffer($util.base64.length(d.companionPublicKey)), 0); + else if (d.companionPublicKey.length >= 0) + m.companionPublicKey = d.companionPublicKey; + } + if (d.companionIdentityKey != null) { + if (typeof d.companionIdentityKey === "string") + $util.base64.decode(d.companionIdentityKey, m.companionIdentityKey = $util.newBuffer($util.base64.length(d.companionIdentityKey)), 0); + else if (d.companionIdentityKey.length >= 0) + m.companionIdentityKey = d.companionIdentityKey; + } + if (d.advSecret != null) { + if (typeof d.advSecret === "string") + $util.base64.decode(d.advSecret, m.advSecret = $util.newBuffer($util.base64.length(d.advSecret)), 0); + else if (d.advSecret.length >= 0) + m.advSecret = d.advSecret; + } + return m; + }; + + PairingRequest.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.companionPublicKey != null && m.hasOwnProperty("companionPublicKey")) { + d.companionPublicKey = o.bytes === String ? $util.base64.encode(m.companionPublicKey, 0, m.companionPublicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.companionPublicKey) : m.companionPublicKey; + if (o.oneofs) + d._companionPublicKey = "companionPublicKey"; + } + if (m.companionIdentityKey != null && m.hasOwnProperty("companionIdentityKey")) { + d.companionIdentityKey = o.bytes === String ? $util.base64.encode(m.companionIdentityKey, 0, m.companionIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.companionIdentityKey) : m.companionIdentityKey; + if (o.oneofs) + d._companionIdentityKey = "companionIdentityKey"; + } + if (m.advSecret != null && m.hasOwnProperty("advSecret")) { + d.advSecret = o.bytes === String ? $util.base64.encode(m.advSecret, 0, m.advSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.advSecret) : m.advSecret; + if (o.oneofs) + d._advSecret = "advSecret"; + } + return d; + }; + + PairingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PairingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26790,9 +60532,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PastParticipant.prototype.userJid = ""; - PastParticipant.prototype.leaveReason = 0; - PastParticipant.prototype.leaveTs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + PastParticipant.prototype.userJid = null; + PastParticipant.prototype.leaveReason = null; + PastParticipant.prototype.leaveTs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PastParticipant.prototype, "_userJid", { + get: $util.oneOfGetter($oneOfFields = ["userJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PastParticipant.prototype, "_leaveReason", { + get: $util.oneOfGetter($oneOfFields = ["leaveReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PastParticipant.prototype, "_leaveTs", { + get: $util.oneOfGetter($oneOfFields = ["leaveTs"]), + set: $util.oneOfSetter($oneOfFields) + }); PastParticipant.create = function create(properties) { return new PastParticipant(properties); @@ -26839,6 +60601,71 @@ export const proto = $root.proto = (() => { return m; }; + PastParticipant.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PastParticipant) + return d; + var m = new $root.proto.PastParticipant(); + if (d.userJid != null) { + m.userJid = String(d.userJid); + } + switch (d.leaveReason) { + default: + if (typeof d.leaveReason === "number") { + m.leaveReason = d.leaveReason; + break; + } + break; + case "LEFT": + case 0: + m.leaveReason = 0; + break; + case "REMOVED": + case 1: + m.leaveReason = 1; + break; + } + if (d.leaveTs != null) { + if ($util.Long) + (m.leaveTs = $util.Long.fromValue(d.leaveTs)).unsigned = true; + else if (typeof d.leaveTs === "string") + m.leaveTs = parseInt(d.leaveTs, 10); + else if (typeof d.leaveTs === "number") + m.leaveTs = d.leaveTs; + else if (typeof d.leaveTs === "object") + m.leaveTs = new $util.LongBits(d.leaveTs.low >>> 0, d.leaveTs.high >>> 0).toNumber(true); + } + return m; + }; + + PastParticipant.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.userJid != null && m.hasOwnProperty("userJid")) { + d.userJid = m.userJid; + if (o.oneofs) + d._userJid = "userJid"; + } + if (m.leaveReason != null && m.hasOwnProperty("leaveReason")) { + d.leaveReason = o.enums === String ? $root.proto.PastParticipant.LeaveReason[m.leaveReason] === undefined ? m.leaveReason : $root.proto.PastParticipant.LeaveReason[m.leaveReason] : m.leaveReason; + if (o.oneofs) + d._leaveReason = "leaveReason"; + } + if (m.leaveTs != null && m.hasOwnProperty("leaveTs")) { + if (typeof m.leaveTs === "number") + d.leaveTs = o.longs === String ? String(m.leaveTs) : m.leaveTs; + else + d.leaveTs = o.longs === String ? $util.Long.prototype.toString.call(m.leaveTs) : o.longs === Number ? new $util.LongBits(m.leaveTs.low >>> 0, m.leaveTs.high >>> 0).toNumber(true) : m.leaveTs; + if (o.oneofs) + d._leaveTs = "leaveTs"; + } + return d; + }; + + PastParticipant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PastParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26866,9 +60693,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PastParticipants.prototype.groupJid = ""; + PastParticipants.prototype.groupJid = null; PastParticipants.prototype.pastParticipants = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PastParticipants.prototype, "_groupJid", { + get: $util.oneOfGetter($oneOfFields = ["groupJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + PastParticipants.create = function create(properties) { return new PastParticipants(properties); }; @@ -26912,6 +60747,51 @@ export const proto = $root.proto = (() => { return m; }; + PastParticipants.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PastParticipants) + return d; + var m = new $root.proto.PastParticipants(); + if (d.groupJid != null) { + m.groupJid = String(d.groupJid); + } + if (d.pastParticipants) { + if (!Array.isArray(d.pastParticipants)) + throw TypeError(".proto.PastParticipants.pastParticipants: array expected"); + m.pastParticipants = []; + for (var i = 0; i < d.pastParticipants.length; ++i) { + if (typeof d.pastParticipants[i] !== "object") + throw TypeError(".proto.PastParticipants.pastParticipants: object expected"); + m.pastParticipants[i] = $root.proto.PastParticipant.fromObject(d.pastParticipants[i]); + } + } + return m; + }; + + PastParticipants.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.pastParticipants = []; + } + if (m.groupJid != null && m.hasOwnProperty("groupJid")) { + d.groupJid = m.groupJid; + if (o.oneofs) + d._groupJid = "groupJid"; + } + if (m.pastParticipants && m.pastParticipants.length) { + d.pastParticipants = []; + for (var j = 0; j < m.pastParticipants.length; ++j) { + d.pastParticipants[j] = $root.proto.PastParticipant.toObject(m.pastParticipants[j], o); + } + } + return d; + }; + + PastParticipants.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PastParticipants.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -26931,17 +60811,85 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PatchDebugData.prototype.currentLthash = $util.newBuffer([]); - PatchDebugData.prototype.newLthash = $util.newBuffer([]); - PatchDebugData.prototype.patchVersion = $util.newBuffer([]); - PatchDebugData.prototype.collectionName = $util.newBuffer([]); - PatchDebugData.prototype.firstFourBytesFromAHashOfSnapshotMacKey = $util.newBuffer([]); - PatchDebugData.prototype.newLthashSubtract = $util.newBuffer([]); - PatchDebugData.prototype.numberAdd = 0; - PatchDebugData.prototype.numberRemove = 0; - PatchDebugData.prototype.numberOverride = 0; - PatchDebugData.prototype.senderPlatform = 0; - PatchDebugData.prototype.isSenderPrimary = false; + PatchDebugData.prototype.currentLthash = null; + PatchDebugData.prototype.newLthash = null; + PatchDebugData.prototype.patchVersion = null; + PatchDebugData.prototype.collectionName = null; + PatchDebugData.prototype.firstFourBytesFromAHashOfSnapshotMacKey = null; + PatchDebugData.prototype.newLthashSubtract = null; + PatchDebugData.prototype.numberAdd = null; + PatchDebugData.prototype.numberRemove = null; + PatchDebugData.prototype.numberOverride = null; + PatchDebugData.prototype.senderPlatform = null; + PatchDebugData.prototype.isSenderPrimary = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_currentLthash", { + get: $util.oneOfGetter($oneOfFields = ["currentLthash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_newLthash", { + get: $util.oneOfGetter($oneOfFields = ["newLthash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_patchVersion", { + get: $util.oneOfGetter($oneOfFields = ["patchVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_collectionName", { + get: $util.oneOfGetter($oneOfFields = ["collectionName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_firstFourBytesFromAHashOfSnapshotMacKey", { + get: $util.oneOfGetter($oneOfFields = ["firstFourBytesFromAHashOfSnapshotMacKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_newLthashSubtract", { + get: $util.oneOfGetter($oneOfFields = ["newLthashSubtract"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_numberAdd", { + get: $util.oneOfGetter($oneOfFields = ["numberAdd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_numberRemove", { + get: $util.oneOfGetter($oneOfFields = ["numberRemove"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_numberOverride", { + get: $util.oneOfGetter($oneOfFields = ["numberOverride"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_senderPlatform", { + get: $util.oneOfGetter($oneOfFields = ["senderPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PatchDebugData.prototype, "_isSenderPrimary", { + get: $util.oneOfGetter($oneOfFields = ["isSenderPrimary"]), + set: $util.oneOfSetter($oneOfFields) + }); PatchDebugData.create = function create(properties) { return new PatchDebugData(properties); @@ -27036,6 +60984,171 @@ export const proto = $root.proto = (() => { return m; }; + PatchDebugData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PatchDebugData) + return d; + var m = new $root.proto.PatchDebugData(); + if (d.currentLthash != null) { + if (typeof d.currentLthash === "string") + $util.base64.decode(d.currentLthash, m.currentLthash = $util.newBuffer($util.base64.length(d.currentLthash)), 0); + else if (d.currentLthash.length >= 0) + m.currentLthash = d.currentLthash; + } + if (d.newLthash != null) { + if (typeof d.newLthash === "string") + $util.base64.decode(d.newLthash, m.newLthash = $util.newBuffer($util.base64.length(d.newLthash)), 0); + else if (d.newLthash.length >= 0) + m.newLthash = d.newLthash; + } + if (d.patchVersion != null) { + if (typeof d.patchVersion === "string") + $util.base64.decode(d.patchVersion, m.patchVersion = $util.newBuffer($util.base64.length(d.patchVersion)), 0); + else if (d.patchVersion.length >= 0) + m.patchVersion = d.patchVersion; + } + if (d.collectionName != null) { + if (typeof d.collectionName === "string") + $util.base64.decode(d.collectionName, m.collectionName = $util.newBuffer($util.base64.length(d.collectionName)), 0); + else if (d.collectionName.length >= 0) + m.collectionName = d.collectionName; + } + if (d.firstFourBytesFromAHashOfSnapshotMacKey != null) { + if (typeof d.firstFourBytesFromAHashOfSnapshotMacKey === "string") + $util.base64.decode(d.firstFourBytesFromAHashOfSnapshotMacKey, m.firstFourBytesFromAHashOfSnapshotMacKey = $util.newBuffer($util.base64.length(d.firstFourBytesFromAHashOfSnapshotMacKey)), 0); + else if (d.firstFourBytesFromAHashOfSnapshotMacKey.length >= 0) + m.firstFourBytesFromAHashOfSnapshotMacKey = d.firstFourBytesFromAHashOfSnapshotMacKey; + } + if (d.newLthashSubtract != null) { + if (typeof d.newLthashSubtract === "string") + $util.base64.decode(d.newLthashSubtract, m.newLthashSubtract = $util.newBuffer($util.base64.length(d.newLthashSubtract)), 0); + else if (d.newLthashSubtract.length >= 0) + m.newLthashSubtract = d.newLthashSubtract; + } + if (d.numberAdd != null) { + m.numberAdd = d.numberAdd | 0; + } + if (d.numberRemove != null) { + m.numberRemove = d.numberRemove | 0; + } + if (d.numberOverride != null) { + m.numberOverride = d.numberOverride | 0; + } + switch (d.senderPlatform) { + default: + if (typeof d.senderPlatform === "number") { + m.senderPlatform = d.senderPlatform; + break; + } + break; + case "ANDROID": + case 0: + m.senderPlatform = 0; + break; + case "SMBA": + case 1: + m.senderPlatform = 1; + break; + case "IPHONE": + case 2: + m.senderPlatform = 2; + break; + case "SMBI": + case 3: + m.senderPlatform = 3; + break; + case "WEB": + case 4: + m.senderPlatform = 4; + break; + case "UWP": + case 5: + m.senderPlatform = 5; + break; + case "DARWIN": + case 6: + m.senderPlatform = 6; + break; + case "IPAD": + case 7: + m.senderPlatform = 7; + break; + case "WEAROS": + case 8: + m.senderPlatform = 8; + break; + } + if (d.isSenderPrimary != null) { + m.isSenderPrimary = Boolean(d.isSenderPrimary); + } + return m; + }; + + PatchDebugData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.currentLthash != null && m.hasOwnProperty("currentLthash")) { + d.currentLthash = o.bytes === String ? $util.base64.encode(m.currentLthash, 0, m.currentLthash.length) : o.bytes === Array ? Array.prototype.slice.call(m.currentLthash) : m.currentLthash; + if (o.oneofs) + d._currentLthash = "currentLthash"; + } + if (m.newLthash != null && m.hasOwnProperty("newLthash")) { + d.newLthash = o.bytes === String ? $util.base64.encode(m.newLthash, 0, m.newLthash.length) : o.bytes === Array ? Array.prototype.slice.call(m.newLthash) : m.newLthash; + if (o.oneofs) + d._newLthash = "newLthash"; + } + if (m.patchVersion != null && m.hasOwnProperty("patchVersion")) { + d.patchVersion = o.bytes === String ? $util.base64.encode(m.patchVersion, 0, m.patchVersion.length) : o.bytes === Array ? Array.prototype.slice.call(m.patchVersion) : m.patchVersion; + if (o.oneofs) + d._patchVersion = "patchVersion"; + } + if (m.collectionName != null && m.hasOwnProperty("collectionName")) { + d.collectionName = o.bytes === String ? $util.base64.encode(m.collectionName, 0, m.collectionName.length) : o.bytes === Array ? Array.prototype.slice.call(m.collectionName) : m.collectionName; + if (o.oneofs) + d._collectionName = "collectionName"; + } + if (m.firstFourBytesFromAHashOfSnapshotMacKey != null && m.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")) { + d.firstFourBytesFromAHashOfSnapshotMacKey = o.bytes === String ? $util.base64.encode(m.firstFourBytesFromAHashOfSnapshotMacKey, 0, m.firstFourBytesFromAHashOfSnapshotMacKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.firstFourBytesFromAHashOfSnapshotMacKey) : m.firstFourBytesFromAHashOfSnapshotMacKey; + if (o.oneofs) + d._firstFourBytesFromAHashOfSnapshotMacKey = "firstFourBytesFromAHashOfSnapshotMacKey"; + } + if (m.newLthashSubtract != null && m.hasOwnProperty("newLthashSubtract")) { + d.newLthashSubtract = o.bytes === String ? $util.base64.encode(m.newLthashSubtract, 0, m.newLthashSubtract.length) : o.bytes === Array ? Array.prototype.slice.call(m.newLthashSubtract) : m.newLthashSubtract; + if (o.oneofs) + d._newLthashSubtract = "newLthashSubtract"; + } + if (m.numberAdd != null && m.hasOwnProperty("numberAdd")) { + d.numberAdd = m.numberAdd; + if (o.oneofs) + d._numberAdd = "numberAdd"; + } + if (m.numberRemove != null && m.hasOwnProperty("numberRemove")) { + d.numberRemove = m.numberRemove; + if (o.oneofs) + d._numberRemove = "numberRemove"; + } + if (m.numberOverride != null && m.hasOwnProperty("numberOverride")) { + d.numberOverride = m.numberOverride; + if (o.oneofs) + d._numberOverride = "numberOverride"; + } + if (m.senderPlatform != null && m.hasOwnProperty("senderPlatform")) { + d.senderPlatform = o.enums === String ? $root.proto.PatchDebugData.Platform[m.senderPlatform] === undefined ? m.senderPlatform : $root.proto.PatchDebugData.Platform[m.senderPlatform] : m.senderPlatform; + if (o.oneofs) + d._senderPlatform = "senderPlatform"; + } + if (m.isSenderPrimary != null && m.hasOwnProperty("isSenderPrimary")) { + d.isSenderPrimary = m.isSenderPrimary; + if (o.oneofs) + d._isSenderPrimary = "isSenderPrimary"; + } + return d; + }; + + PatchDebugData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PatchDebugData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27069,16 +61182,78 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PaymentBackground.prototype.id = ""; - PaymentBackground.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - PaymentBackground.prototype.width = 0; - PaymentBackground.prototype.height = 0; - PaymentBackground.prototype.mimetype = ""; - PaymentBackground.prototype.placeholderArgb = 0; - PaymentBackground.prototype.textArgb = 0; - PaymentBackground.prototype.subtextArgb = 0; + PaymentBackground.prototype.id = null; + PaymentBackground.prototype.fileLength = null; + PaymentBackground.prototype.width = null; + PaymentBackground.prototype.height = null; + PaymentBackground.prototype.mimetype = null; + PaymentBackground.prototype.placeholderArgb = null; + PaymentBackground.prototype.textArgb = null; + PaymentBackground.prototype.subtextArgb = null; PaymentBackground.prototype.mediaData = null; - PaymentBackground.prototype.type = 0; + PaymentBackground.prototype.type = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_placeholderArgb", { + get: $util.oneOfGetter($oneOfFields = ["placeholderArgb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_textArgb", { + get: $util.oneOfGetter($oneOfFields = ["textArgb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_subtextArgb", { + get: $util.oneOfGetter($oneOfFields = ["subtextArgb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_mediaData", { + get: $util.oneOfGetter($oneOfFields = ["mediaData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentBackground.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); PaymentBackground.create = function create(properties) { return new PaymentBackground(properties); @@ -27167,6 +61342,129 @@ export const proto = $root.proto = (() => { return m; }; + PaymentBackground.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PaymentBackground) + return d; + var m = new $root.proto.PaymentBackground(); + if (d.id != null) { + m.id = String(d.id); + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.placeholderArgb != null) { + m.placeholderArgb = d.placeholderArgb >>> 0; + } + if (d.textArgb != null) { + m.textArgb = d.textArgb >>> 0; + } + if (d.subtextArgb != null) { + m.subtextArgb = d.subtextArgb >>> 0; + } + if (d.mediaData != null) { + if (typeof d.mediaData !== "object") + throw TypeError(".proto.PaymentBackground.mediaData: object expected"); + m.mediaData = $root.proto.PaymentBackground.MediaData.fromObject(d.mediaData); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNKNOWN": + case 0: + m.type = 0; + break; + case "DEFAULT": + case 1: + m.type = 1; + break; + } + return m; + }; + + PaymentBackground.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.placeholderArgb != null && m.hasOwnProperty("placeholderArgb")) { + d.placeholderArgb = m.placeholderArgb; + if (o.oneofs) + d._placeholderArgb = "placeholderArgb"; + } + if (m.textArgb != null && m.hasOwnProperty("textArgb")) { + d.textArgb = m.textArgb; + if (o.oneofs) + d._textArgb = "textArgb"; + } + if (m.subtextArgb != null && m.hasOwnProperty("subtextArgb")) { + d.subtextArgb = m.subtextArgb; + if (o.oneofs) + d._subtextArgb = "subtextArgb"; + } + if (m.mediaData != null && m.hasOwnProperty("mediaData")) { + d.mediaData = $root.proto.PaymentBackground.MediaData.toObject(m.mediaData, o); + if (o.oneofs) + d._mediaData = "mediaData"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.PaymentBackground.Type[m.type] === undefined ? m.type : $root.proto.PaymentBackground.Type[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + return d; + }; + + PaymentBackground.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentBackground.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27183,11 +61481,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MediaData.prototype.mediaKey = $util.newBuffer([]); - MediaData.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MediaData.prototype.fileSha256 = $util.newBuffer([]); - MediaData.prototype.fileEncSha256 = $util.newBuffer([]); - MediaData.prototype.directPath = ""; + MediaData.prototype.mediaKey = null; + MediaData.prototype.mediaKeyTimestamp = null; + MediaData.prototype.fileSha256 = null; + MediaData.prototype.fileEncSha256 = null; + MediaData.prototype.directPath = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaData.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaData.prototype, "_mediaKeyTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaData.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaData.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MediaData.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); MediaData.create = function create(properties) { return new MediaData(properties); @@ -27246,6 +61576,83 @@ export const proto = $root.proto = (() => { return m; }; + MediaData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PaymentBackground.MediaData) + return d; + var m = new $root.proto.PaymentBackground.MediaData(); + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mediaKeyTimestamp != null) { + if ($util.Long) + (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false; + else if (typeof d.mediaKeyTimestamp === "string") + m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10); + else if (typeof d.mediaKeyTimestamp === "number") + m.mediaKeyTimestamp = d.mediaKeyTimestamp; + else if (typeof d.mediaKeyTimestamp === "object") + m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber(); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + return m; + }; + + MediaData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) { + if (typeof m.mediaKeyTimestamp === "number") + d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; + else + d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + if (o.oneofs) + d._mediaKeyTimestamp = "mediaKeyTimestamp"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + return d; + }; + + MediaData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MediaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27275,20 +61682,100 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PaymentInfo.prototype.currencyDeprecated = 0; - PaymentInfo.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - PaymentInfo.prototype.receiverJid = ""; - PaymentInfo.prototype.status = 0; - PaymentInfo.prototype.transactionTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + PaymentInfo.prototype.currencyDeprecated = null; + PaymentInfo.prototype.amount1000 = null; + PaymentInfo.prototype.receiverJid = null; + PaymentInfo.prototype.status = null; + PaymentInfo.prototype.transactionTimestamp = null; PaymentInfo.prototype.requestMessageKey = null; - PaymentInfo.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - PaymentInfo.prototype.futureproofed = false; - PaymentInfo.prototype.currency = ""; - PaymentInfo.prototype.txnStatus = 0; - PaymentInfo.prototype.useNoviFiatFormat = false; + PaymentInfo.prototype.expiryTimestamp = null; + PaymentInfo.prototype.futureproofed = null; + PaymentInfo.prototype.currency = null; + PaymentInfo.prototype.txnStatus = null; + PaymentInfo.prototype.useNoviFiatFormat = null; PaymentInfo.prototype.primaryAmount = null; PaymentInfo.prototype.exchangeAmount = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_currencyDeprecated", { + get: $util.oneOfGetter($oneOfFields = ["currencyDeprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_amount1000", { + get: $util.oneOfGetter($oneOfFields = ["amount1000"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_receiverJid", { + get: $util.oneOfGetter($oneOfFields = ["receiverJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_transactionTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["transactionTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_requestMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["requestMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_expiryTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["expiryTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_futureproofed", { + get: $util.oneOfGetter($oneOfFields = ["futureproofed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_currency", { + get: $util.oneOfGetter($oneOfFields = ["currency"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_txnStatus", { + get: $util.oneOfGetter($oneOfFields = ["txnStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_useNoviFiatFormat", { + get: $util.oneOfGetter($oneOfFields = ["useNoviFiatFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_primaryAmount", { + get: $util.oneOfGetter($oneOfFields = ["primaryAmount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfo.prototype, "_exchangeAmount", { + get: $util.oneOfGetter($oneOfFields = ["exchangeAmount"]), + set: $util.oneOfSetter($oneOfFields) + }); + PaymentInfo.create = function create(properties) { return new PaymentInfo(properties); }; @@ -27394,6 +61881,363 @@ export const proto = $root.proto = (() => { return m; }; + PaymentInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PaymentInfo) + return d; + var m = new $root.proto.PaymentInfo(); + switch (d.currencyDeprecated) { + default: + if (typeof d.currencyDeprecated === "number") { + m.currencyDeprecated = d.currencyDeprecated; + break; + } + break; + case "UNKNOWN_CURRENCY": + case 0: + m.currencyDeprecated = 0; + break; + case "INR": + case 1: + m.currencyDeprecated = 1; + break; + } + if (d.amount1000 != null) { + if ($util.Long) + (m.amount1000 = $util.Long.fromValue(d.amount1000)).unsigned = true; + else if (typeof d.amount1000 === "string") + m.amount1000 = parseInt(d.amount1000, 10); + else if (typeof d.amount1000 === "number") + m.amount1000 = d.amount1000; + else if (typeof d.amount1000 === "object") + m.amount1000 = new $util.LongBits(d.amount1000.low >>> 0, d.amount1000.high >>> 0).toNumber(true); + } + if (d.receiverJid != null) { + m.receiverJid = String(d.receiverJid); + } + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "UNKNOWN_STATUS": + case 0: + m.status = 0; + break; + case "PROCESSING": + case 1: + m.status = 1; + break; + case "SENT": + case 2: + m.status = 2; + break; + case "NEED_TO_ACCEPT": + case 3: + m.status = 3; + break; + case "COMPLETE": + case 4: + m.status = 4; + break; + case "COULD_NOT_COMPLETE": + case 5: + m.status = 5; + break; + case "REFUNDED": + case 6: + m.status = 6; + break; + case "EXPIRED": + case 7: + m.status = 7; + break; + case "REJECTED": + case 8: + m.status = 8; + break; + case "CANCELLED": + case 9: + m.status = 9; + break; + case "WAITING_FOR_PAYER": + case 10: + m.status = 10; + break; + case "WAITING": + case 11: + m.status = 11; + break; + } + if (d.transactionTimestamp != null) { + if ($util.Long) + (m.transactionTimestamp = $util.Long.fromValue(d.transactionTimestamp)).unsigned = true; + else if (typeof d.transactionTimestamp === "string") + m.transactionTimestamp = parseInt(d.transactionTimestamp, 10); + else if (typeof d.transactionTimestamp === "number") + m.transactionTimestamp = d.transactionTimestamp; + else if (typeof d.transactionTimestamp === "object") + m.transactionTimestamp = new $util.LongBits(d.transactionTimestamp.low >>> 0, d.transactionTimestamp.high >>> 0).toNumber(true); + } + if (d.requestMessageKey != null) { + if (typeof d.requestMessageKey !== "object") + throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected"); + m.requestMessageKey = $root.proto.MessageKey.fromObject(d.requestMessageKey); + } + if (d.expiryTimestamp != null) { + if ($util.Long) + (m.expiryTimestamp = $util.Long.fromValue(d.expiryTimestamp)).unsigned = true; + else if (typeof d.expiryTimestamp === "string") + m.expiryTimestamp = parseInt(d.expiryTimestamp, 10); + else if (typeof d.expiryTimestamp === "number") + m.expiryTimestamp = d.expiryTimestamp; + else if (typeof d.expiryTimestamp === "object") + m.expiryTimestamp = new $util.LongBits(d.expiryTimestamp.low >>> 0, d.expiryTimestamp.high >>> 0).toNumber(true); + } + if (d.futureproofed != null) { + m.futureproofed = Boolean(d.futureproofed); + } + if (d.currency != null) { + m.currency = String(d.currency); + } + switch (d.txnStatus) { + default: + if (typeof d.txnStatus === "number") { + m.txnStatus = d.txnStatus; + break; + } + break; + case "UNKNOWN": + case 0: + m.txnStatus = 0; + break; + case "PENDING_SETUP": + case 1: + m.txnStatus = 1; + break; + case "PENDING_RECEIVER_SETUP": + case 2: + m.txnStatus = 2; + break; + case "INIT": + case 3: + m.txnStatus = 3; + break; + case "SUCCESS": + case 4: + m.txnStatus = 4; + break; + case "COMPLETED": + case 5: + m.txnStatus = 5; + break; + case "FAILED": + case 6: + m.txnStatus = 6; + break; + case "FAILED_RISK": + case 7: + m.txnStatus = 7; + break; + case "FAILED_PROCESSING": + case 8: + m.txnStatus = 8; + break; + case "FAILED_RECEIVER_PROCESSING": + case 9: + m.txnStatus = 9; + break; + case "FAILED_DA": + case 10: + m.txnStatus = 10; + break; + case "FAILED_DA_FINAL": + case 11: + m.txnStatus = 11; + break; + case "REFUNDED_TXN": + case 12: + m.txnStatus = 12; + break; + case "REFUND_FAILED": + case 13: + m.txnStatus = 13; + break; + case "REFUND_FAILED_PROCESSING": + case 14: + m.txnStatus = 14; + break; + case "REFUND_FAILED_DA": + case 15: + m.txnStatus = 15; + break; + case "EXPIRED_TXN": + case 16: + m.txnStatus = 16; + break; + case "AUTH_CANCELED": + case 17: + m.txnStatus = 17; + break; + case "AUTH_CANCEL_FAILED_PROCESSING": + case 18: + m.txnStatus = 18; + break; + case "AUTH_CANCEL_FAILED": + case 19: + m.txnStatus = 19; + break; + case "COLLECT_INIT": + case 20: + m.txnStatus = 20; + break; + case "COLLECT_SUCCESS": + case 21: + m.txnStatus = 21; + break; + case "COLLECT_FAILED": + case 22: + m.txnStatus = 22; + break; + case "COLLECT_FAILED_RISK": + case 23: + m.txnStatus = 23; + break; + case "COLLECT_REJECTED": + case 24: + m.txnStatus = 24; + break; + case "COLLECT_EXPIRED": + case 25: + m.txnStatus = 25; + break; + case "COLLECT_CANCELED": + case 26: + m.txnStatus = 26; + break; + case "COLLECT_CANCELLING": + case 27: + m.txnStatus = 27; + break; + case "IN_REVIEW": + case 28: + m.txnStatus = 28; + break; + case "REVERSAL_SUCCESS": + case 29: + m.txnStatus = 29; + break; + case "REVERSAL_PENDING": + case 30: + m.txnStatus = 30; + break; + case "REFUND_PENDING": + case 31: + m.txnStatus = 31; + break; + } + if (d.useNoviFiatFormat != null) { + m.useNoviFiatFormat = Boolean(d.useNoviFiatFormat); + } + if (d.primaryAmount != null) { + if (typeof d.primaryAmount !== "object") + throw TypeError(".proto.PaymentInfo.primaryAmount: object expected"); + m.primaryAmount = $root.proto.Money.fromObject(d.primaryAmount); + } + if (d.exchangeAmount != null) { + if (typeof d.exchangeAmount !== "object") + throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected"); + m.exchangeAmount = $root.proto.Money.fromObject(d.exchangeAmount); + } + return m; + }; + + PaymentInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.currencyDeprecated != null && m.hasOwnProperty("currencyDeprecated")) { + d.currencyDeprecated = o.enums === String ? $root.proto.PaymentInfo.Currency[m.currencyDeprecated] === undefined ? m.currencyDeprecated : $root.proto.PaymentInfo.Currency[m.currencyDeprecated] : m.currencyDeprecated; + if (o.oneofs) + d._currencyDeprecated = "currencyDeprecated"; + } + if (m.amount1000 != null && m.hasOwnProperty("amount1000")) { + if (typeof m.amount1000 === "number") + d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000; + else + d.amount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.amount1000) : o.longs === Number ? new $util.LongBits(m.amount1000.low >>> 0, m.amount1000.high >>> 0).toNumber(true) : m.amount1000; + if (o.oneofs) + d._amount1000 = "amount1000"; + } + if (m.receiverJid != null && m.hasOwnProperty("receiverJid")) { + d.receiverJid = m.receiverJid; + if (o.oneofs) + d._receiverJid = "receiverJid"; + } + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.PaymentInfo.Status[m.status] === undefined ? m.status : $root.proto.PaymentInfo.Status[m.status] : m.status; + if (o.oneofs) + d._status = "status"; + } + if (m.transactionTimestamp != null && m.hasOwnProperty("transactionTimestamp")) { + if (typeof m.transactionTimestamp === "number") + d.transactionTimestamp = o.longs === String ? String(m.transactionTimestamp) : m.transactionTimestamp; + else + d.transactionTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.transactionTimestamp) : o.longs === Number ? new $util.LongBits(m.transactionTimestamp.low >>> 0, m.transactionTimestamp.high >>> 0).toNumber(true) : m.transactionTimestamp; + if (o.oneofs) + d._transactionTimestamp = "transactionTimestamp"; + } + if (m.requestMessageKey != null && m.hasOwnProperty("requestMessageKey")) { + d.requestMessageKey = $root.proto.MessageKey.toObject(m.requestMessageKey, o); + if (o.oneofs) + d._requestMessageKey = "requestMessageKey"; + } + if (m.expiryTimestamp != null && m.hasOwnProperty("expiryTimestamp")) { + if (typeof m.expiryTimestamp === "number") + d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp; + else + d.expiryTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expiryTimestamp) : o.longs === Number ? new $util.LongBits(m.expiryTimestamp.low >>> 0, m.expiryTimestamp.high >>> 0).toNumber(true) : m.expiryTimestamp; + if (o.oneofs) + d._expiryTimestamp = "expiryTimestamp"; + } + if (m.futureproofed != null && m.hasOwnProperty("futureproofed")) { + d.futureproofed = m.futureproofed; + if (o.oneofs) + d._futureproofed = "futureproofed"; + } + if (m.currency != null && m.hasOwnProperty("currency")) { + d.currency = m.currency; + if (o.oneofs) + d._currency = "currency"; + } + if (m.txnStatus != null && m.hasOwnProperty("txnStatus")) { + d.txnStatus = o.enums === String ? $root.proto.PaymentInfo.TxnStatus[m.txnStatus] === undefined ? m.txnStatus : $root.proto.PaymentInfo.TxnStatus[m.txnStatus] : m.txnStatus; + if (o.oneofs) + d._txnStatus = "txnStatus"; + } + if (m.useNoviFiatFormat != null && m.hasOwnProperty("useNoviFiatFormat")) { + d.useNoviFiatFormat = m.useNoviFiatFormat; + if (o.oneofs) + d._useNoviFiatFormat = "useNoviFiatFormat"; + } + if (m.primaryAmount != null && m.hasOwnProperty("primaryAmount")) { + d.primaryAmount = $root.proto.Money.toObject(m.primaryAmount, o); + if (o.oneofs) + d._primaryAmount = "primaryAmount"; + } + if (m.exchangeAmount != null && m.hasOwnProperty("exchangeAmount")) { + d.exchangeAmount = $root.proto.Money.toObject(m.exchangeAmount, o); + if (o.oneofs) + d._exchangeAmount = "exchangeAmount"; + } + return d; + }; + + PaymentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27474,8 +62318,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PhoneNumberToLIDMapping.prototype.pnJid = ""; - PhoneNumberToLIDMapping.prototype.lidJid = ""; + PhoneNumberToLIDMapping.prototype.pnJid = null; + PhoneNumberToLIDMapping.prototype.lidJid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PhoneNumberToLIDMapping.prototype, "_pnJid", { + get: $util.oneOfGetter($oneOfFields = ["pnJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PhoneNumberToLIDMapping.prototype, "_lidJid", { + get: $util.oneOfGetter($oneOfFields = ["lidJid"]), + set: $util.oneOfSetter($oneOfFields) + }); PhoneNumberToLIDMapping.create = function create(properties) { return new PhoneNumberToLIDMapping(properties); @@ -27516,6 +62374,40 @@ export const proto = $root.proto = (() => { return m; }; + PhoneNumberToLIDMapping.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PhoneNumberToLIDMapping) + return d; + var m = new $root.proto.PhoneNumberToLIDMapping(); + if (d.pnJid != null) { + m.pnJid = String(d.pnJid); + } + if (d.lidJid != null) { + m.lidJid = String(d.lidJid); + } + return m; + }; + + PhoneNumberToLIDMapping.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.pnJid != null && m.hasOwnProperty("pnJid")) { + d.pnJid = m.pnJid; + if (o.oneofs) + d._pnJid = "pnJid"; + } + if (m.lidJid != null && m.hasOwnProperty("lidJid")) { + d.lidJid = m.lidJid; + if (o.oneofs) + d._lidJid = "lidJid"; + } + return d; + }; + + PhoneNumberToLIDMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PhoneNumberToLIDMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27535,9 +62427,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PhotoChange.prototype.oldPhoto = $util.newBuffer([]); - PhotoChange.prototype.newPhoto = $util.newBuffer([]); - PhotoChange.prototype.newPhotoId = 0; + PhotoChange.prototype.oldPhoto = null; + PhotoChange.prototype.newPhoto = null; + PhotoChange.prototype.newPhotoId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PhotoChange.prototype, "_oldPhoto", { + get: $util.oneOfGetter($oneOfFields = ["oldPhoto"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PhotoChange.prototype, "_newPhoto", { + get: $util.oneOfGetter($oneOfFields = ["newPhoto"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PhotoChange.prototype, "_newPhotoId", { + get: $util.oneOfGetter($oneOfFields = ["newPhotoId"]), + set: $util.oneOfSetter($oneOfFields) + }); PhotoChange.create = function create(properties) { return new PhotoChange(properties); @@ -27584,6 +62496,54 @@ export const proto = $root.proto = (() => { return m; }; + PhotoChange.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PhotoChange) + return d; + var m = new $root.proto.PhotoChange(); + if (d.oldPhoto != null) { + if (typeof d.oldPhoto === "string") + $util.base64.decode(d.oldPhoto, m.oldPhoto = $util.newBuffer($util.base64.length(d.oldPhoto)), 0); + else if (d.oldPhoto.length >= 0) + m.oldPhoto = d.oldPhoto; + } + if (d.newPhoto != null) { + if (typeof d.newPhoto === "string") + $util.base64.decode(d.newPhoto, m.newPhoto = $util.newBuffer($util.base64.length(d.newPhoto)), 0); + else if (d.newPhoto.length >= 0) + m.newPhoto = d.newPhoto; + } + if (d.newPhotoId != null) { + m.newPhotoId = d.newPhotoId >>> 0; + } + return m; + }; + + PhotoChange.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.oldPhoto != null && m.hasOwnProperty("oldPhoto")) { + d.oldPhoto = o.bytes === String ? $util.base64.encode(m.oldPhoto, 0, m.oldPhoto.length) : o.bytes === Array ? Array.prototype.slice.call(m.oldPhoto) : m.oldPhoto; + if (o.oneofs) + d._oldPhoto = "oldPhoto"; + } + if (m.newPhoto != null && m.hasOwnProperty("newPhoto")) { + d.newPhoto = o.bytes === String ? $util.base64.encode(m.newPhoto, 0, m.newPhoto.length) : o.bytes === Array ? Array.prototype.slice.call(m.newPhoto) : m.newPhoto; + if (o.oneofs) + d._newPhoto = "newPhoto"; + } + if (m.newPhotoId != null && m.hasOwnProperty("newPhotoId")) { + d.newPhotoId = m.newPhotoId; + if (o.oneofs) + d._newPhotoId = "newPhotoId"; + } + return d; + }; + + PhotoChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PhotoChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27603,12 +62563,44 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PinInChat.prototype.type = 0; + PinInChat.prototype.type = null; PinInChat.prototype.key = null; - PinInChat.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - PinInChat.prototype.serverTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PinInChat.prototype.senderTimestampMs = null; + PinInChat.prototype.serverTimestampMs = null; PinInChat.prototype.messageAddOnContextInfo = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChat.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChat.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChat.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChat.prototype, "_serverTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinInChat.prototype, "_messageAddOnContextInfo", { + get: $util.oneOfGetter($oneOfFields = ["messageAddOnContextInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + PinInChat.create = function create(properties) { return new PinInChat(properties); }; @@ -27666,6 +62658,105 @@ export const proto = $root.proto = (() => { return m; }; + PinInChat.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PinInChat) + return d; + var m = new $root.proto.PinInChat(); + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNKNOWN_TYPE": + case 0: + m.type = 0; + break; + case "PIN_FOR_ALL": + case 1: + m.type = 1; + break; + case "UNPIN_FOR_ALL": + case 2: + m.type = 2; + break; + } + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.PinInChat.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + if (d.serverTimestampMs != null) { + if ($util.Long) + (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false; + else if (typeof d.serverTimestampMs === "string") + m.serverTimestampMs = parseInt(d.serverTimestampMs, 10); + else if (typeof d.serverTimestampMs === "number") + m.serverTimestampMs = d.serverTimestampMs; + else if (typeof d.serverTimestampMs === "object") + m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber(); + } + if (d.messageAddOnContextInfo != null) { + if (typeof d.messageAddOnContextInfo !== "object") + throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected"); + m.messageAddOnContextInfo = $root.proto.MessageAddOnContextInfo.fromObject(d.messageAddOnContextInfo); + } + return m; + }; + + PinInChat.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.PinInChat.Type[m.type] === undefined ? m.type : $root.proto.PinInChat.Type[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) { + if (typeof m.serverTimestampMs === "number") + d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; + else + d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + if (o.oneofs) + d._serverTimestampMs = "serverTimestampMs"; + } + if (m.messageAddOnContextInfo != null && m.hasOwnProperty("messageAddOnContextInfo")) { + d.messageAddOnContextInfo = $root.proto.MessageAddOnContextInfo.toObject(m.messageAddOnContextInfo, o); + if (o.oneofs) + d._messageAddOnContextInfo = "messageAddOnContextInfo"; + } + return d; + }; + + PinInChat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PinInChat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27693,10 +62784,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Point.prototype.xDeprecated = 0; - Point.prototype.yDeprecated = 0; - Point.prototype.x = 0; - Point.prototype.y = 0; + Point.prototype.xDeprecated = null; + Point.prototype.yDeprecated = null; + Point.prototype.x = null; + Point.prototype.y = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Point.prototype, "_xDeprecated", { + get: $util.oneOfGetter($oneOfFields = ["xDeprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Point.prototype, "_yDeprecated", { + get: $util.oneOfGetter($oneOfFields = ["yDeprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Point.prototype, "_x", { + get: $util.oneOfGetter($oneOfFields = ["x"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Point.prototype, "_y", { + get: $util.oneOfGetter($oneOfFields = ["y"]), + set: $util.oneOfSetter($oneOfFields) + }); Point.create = function create(properties) { return new Point(properties); @@ -27749,6 +62866,56 @@ export const proto = $root.proto = (() => { return m; }; + Point.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Point) + return d; + var m = new $root.proto.Point(); + if (d.xDeprecated != null) { + m.xDeprecated = d.xDeprecated | 0; + } + if (d.yDeprecated != null) { + m.yDeprecated = d.yDeprecated | 0; + } + if (d.x != null) { + m.x = Number(d.x); + } + if (d.y != null) { + m.y = Number(d.y); + } + return m; + }; + + Point.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.xDeprecated != null && m.hasOwnProperty("xDeprecated")) { + d.xDeprecated = m.xDeprecated; + if (o.oneofs) + d._xDeprecated = "xDeprecated"; + } + if (m.yDeprecated != null && m.hasOwnProperty("yDeprecated")) { + d.yDeprecated = m.yDeprecated; + if (o.oneofs) + d._yDeprecated = "yDeprecated"; + } + if (m.x != null && m.hasOwnProperty("x")) { + d.x = o.json && !isFinite(m.x) ? String(m.x) : m.x; + if (o.oneofs) + d._x = "x"; + } + if (m.y != null && m.hasOwnProperty("y")) { + d.y = o.json && !isFinite(m.y) ? String(m.y) : m.y; + if (o.oneofs) + d._y = "y"; + } + return d; + }; + + Point.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Point.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27768,7 +62935,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollAdditionalMetadata.prototype.pollInvalidated = false; + PollAdditionalMetadata.prototype.pollInvalidated = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollAdditionalMetadata.prototype, "_pollInvalidated", { + get: $util.oneOfGetter($oneOfFields = ["pollInvalidated"]), + set: $util.oneOfSetter($oneOfFields) + }); PollAdditionalMetadata.create = function create(properties) { return new PollAdditionalMetadata(properties); @@ -27803,6 +62978,32 @@ export const proto = $root.proto = (() => { return m; }; + PollAdditionalMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PollAdditionalMetadata) + return d; + var m = new $root.proto.PollAdditionalMetadata(); + if (d.pollInvalidated != null) { + m.pollInvalidated = Boolean(d.pollInvalidated); + } + return m; + }; + + PollAdditionalMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.pollInvalidated != null && m.hasOwnProperty("pollInvalidated")) { + d.pollInvalidated = m.pollInvalidated; + if (o.oneofs) + d._pollInvalidated = "pollInvalidated"; + } + return d; + }; + + PollAdditionalMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollAdditionalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27822,8 +63023,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PollEncValue.prototype.encPayload = $util.newBuffer([]); - PollEncValue.prototype.encIv = $util.newBuffer([]); + PollEncValue.prototype.encPayload = null; + PollEncValue.prototype.encIv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollEncValue.prototype, "_encPayload", { + get: $util.oneOfGetter($oneOfFields = ["encPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollEncValue.prototype, "_encIv", { + get: $util.oneOfGetter($oneOfFields = ["encIv"]), + set: $util.oneOfSetter($oneOfFields) + }); PollEncValue.create = function create(properties) { return new PollEncValue(properties); @@ -27864,6 +63079,46 @@ export const proto = $root.proto = (() => { return m; }; + PollEncValue.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PollEncValue) + return d; + var m = new $root.proto.PollEncValue(); + if (d.encPayload != null) { + if (typeof d.encPayload === "string") + $util.base64.decode(d.encPayload, m.encPayload = $util.newBuffer($util.base64.length(d.encPayload)), 0); + else if (d.encPayload.length >= 0) + m.encPayload = d.encPayload; + } + if (d.encIv != null) { + if (typeof d.encIv === "string") + $util.base64.decode(d.encIv, m.encIv = $util.newBuffer($util.base64.length(d.encIv)), 0); + else if (d.encIv.length >= 0) + m.encIv = d.encIv; + } + return m; + }; + + PollEncValue.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.encPayload != null && m.hasOwnProperty("encPayload")) { + d.encPayload = o.bytes === String ? $util.base64.encode(m.encPayload, 0, m.encPayload.length) : o.bytes === Array ? Array.prototype.slice.call(m.encPayload) : m.encPayload; + if (o.oneofs) + d._encPayload = "encPayload"; + } + if (m.encIv != null && m.hasOwnProperty("encIv")) { + d.encIv = o.bytes === String ? $util.base64.encode(m.encIv, 0, m.encIv.length) : o.bytes === Array ? Array.prototype.slice.call(m.encIv) : m.encIv; + if (o.oneofs) + d._encIv = "encIv"; + } + return d; + }; + + PollEncValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollEncValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27885,9 +63140,41 @@ export const proto = $root.proto = (() => { PollUpdate.prototype.pollUpdateMessageKey = null; PollUpdate.prototype.vote = null; - PollUpdate.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - PollUpdate.prototype.serverTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - PollUpdate.prototype.unread = false; + PollUpdate.prototype.senderTimestampMs = null; + PollUpdate.prototype.serverTimestampMs = null; + PollUpdate.prototype.unread = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdate.prototype, "_pollUpdateMessageKey", { + get: $util.oneOfGetter($oneOfFields = ["pollUpdateMessageKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdate.prototype, "_vote", { + get: $util.oneOfGetter($oneOfFields = ["vote"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdate.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdate.prototype, "_serverTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PollUpdate.prototype, "_unread", { + get: $util.oneOfGetter($oneOfFields = ["unread"]), + set: $util.oneOfSetter($oneOfFields) + }); PollUpdate.create = function create(properties) { return new PollUpdate(properties); @@ -27946,6 +63233,88 @@ export const proto = $root.proto = (() => { return m; }; + PollUpdate.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PollUpdate) + return d; + var m = new $root.proto.PollUpdate(); + if (d.pollUpdateMessageKey != null) { + if (typeof d.pollUpdateMessageKey !== "object") + throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected"); + m.pollUpdateMessageKey = $root.proto.MessageKey.fromObject(d.pollUpdateMessageKey); + } + if (d.vote != null) { + if (typeof d.vote !== "object") + throw TypeError(".proto.PollUpdate.vote: object expected"); + m.vote = $root.proto.Message.PollVoteMessage.fromObject(d.vote); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + if (d.serverTimestampMs != null) { + if ($util.Long) + (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false; + else if (typeof d.serverTimestampMs === "string") + m.serverTimestampMs = parseInt(d.serverTimestampMs, 10); + else if (typeof d.serverTimestampMs === "number") + m.serverTimestampMs = d.serverTimestampMs; + else if (typeof d.serverTimestampMs === "object") + m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber(); + } + if (d.unread != null) { + m.unread = Boolean(d.unread); + } + return m; + }; + + PollUpdate.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.pollUpdateMessageKey != null && m.hasOwnProperty("pollUpdateMessageKey")) { + d.pollUpdateMessageKey = $root.proto.MessageKey.toObject(m.pollUpdateMessageKey, o); + if (o.oneofs) + d._pollUpdateMessageKey = "pollUpdateMessageKey"; + } + if (m.vote != null && m.hasOwnProperty("vote")) { + d.vote = $root.proto.Message.PollVoteMessage.toObject(m.vote, o); + if (o.oneofs) + d._vote = "vote"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) { + if (typeof m.serverTimestampMs === "number") + d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; + else + d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + if (o.oneofs) + d._serverTimestampMs = "serverTimestampMs"; + } + if (m.unread != null && m.hasOwnProperty("unread")) { + d.unread = m.unread; + if (o.oneofs) + d._unread = "unread"; + } + return d; + }; + + PollUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PollUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -27965,9 +63334,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PreKeyRecordStructure.prototype.id = 0; - PreKeyRecordStructure.prototype.publicKey = $util.newBuffer([]); - PreKeyRecordStructure.prototype.privateKey = $util.newBuffer([]); + PreKeyRecordStructure.prototype.id = null; + PreKeyRecordStructure.prototype.publicKey = null; + PreKeyRecordStructure.prototype.privateKey = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeyRecordStructure.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeyRecordStructure.prototype, "_publicKey", { + get: $util.oneOfGetter($oneOfFields = ["publicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeyRecordStructure.prototype, "_privateKey", { + get: $util.oneOfGetter($oneOfFields = ["privateKey"]), + set: $util.oneOfSetter($oneOfFields) + }); PreKeyRecordStructure.create = function create(properties) { return new PreKeyRecordStructure(properties); @@ -28014,6 +63403,54 @@ export const proto = $root.proto = (() => { return m; }; + PreKeyRecordStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PreKeyRecordStructure) + return d; + var m = new $root.proto.PreKeyRecordStructure(); + if (d.id != null) { + m.id = d.id >>> 0; + } + if (d.publicKey != null) { + if (typeof d.publicKey === "string") + $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0); + else if (d.publicKey.length >= 0) + m.publicKey = d.publicKey; + } + if (d.privateKey != null) { + if (typeof d.privateKey === "string") + $util.base64.decode(d.privateKey, m.privateKey = $util.newBuffer($util.base64.length(d.privateKey)), 0); + else if (d.privateKey.length >= 0) + m.privateKey = d.privateKey; + } + return m; + }; + + PreKeyRecordStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.publicKey != null && m.hasOwnProperty("publicKey")) { + d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey; + if (o.oneofs) + d._publicKey = "publicKey"; + } + if (m.privateKey != null && m.hasOwnProperty("privateKey")) { + d.privateKey = o.bytes === String ? $util.base64.encode(m.privateKey, 0, m.privateKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privateKey) : m.privateKey; + if (o.oneofs) + d._privateKey = "privateKey"; + } + return d; + }; + + PreKeyRecordStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PreKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28033,12 +63470,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PreKeySignalMessage.prototype.registrationId = 0; - PreKeySignalMessage.prototype.preKeyId = 0; - PreKeySignalMessage.prototype.signedPreKeyId = 0; - PreKeySignalMessage.prototype.baseKey = $util.newBuffer([]); - PreKeySignalMessage.prototype.identityKey = $util.newBuffer([]); - PreKeySignalMessage.prototype.message = $util.newBuffer([]); + PreKeySignalMessage.prototype.registrationId = null; + PreKeySignalMessage.prototype.preKeyId = null; + PreKeySignalMessage.prototype.signedPreKeyId = null; + PreKeySignalMessage.prototype.baseKey = null; + PreKeySignalMessage.prototype.identityKey = null; + PreKeySignalMessage.prototype.message = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeySignalMessage.prototype, "_registrationId", { + get: $util.oneOfGetter($oneOfFields = ["registrationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeySignalMessage.prototype, "_preKeyId", { + get: $util.oneOfGetter($oneOfFields = ["preKeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeySignalMessage.prototype, "_signedPreKeyId", { + get: $util.oneOfGetter($oneOfFields = ["signedPreKeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeySignalMessage.prototype, "_baseKey", { + get: $util.oneOfGetter($oneOfFields = ["baseKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeySignalMessage.prototype, "_identityKey", { + get: $util.oneOfGetter($oneOfFields = ["identityKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PreKeySignalMessage.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); PreKeySignalMessage.create = function create(properties) { return new PreKeySignalMessage(properties); @@ -28103,6 +63578,81 @@ export const proto = $root.proto = (() => { return m; }; + PreKeySignalMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PreKeySignalMessage) + return d; + var m = new $root.proto.PreKeySignalMessage(); + if (d.registrationId != null) { + m.registrationId = d.registrationId >>> 0; + } + if (d.preKeyId != null) { + m.preKeyId = d.preKeyId >>> 0; + } + if (d.signedPreKeyId != null) { + m.signedPreKeyId = d.signedPreKeyId >>> 0; + } + if (d.baseKey != null) { + if (typeof d.baseKey === "string") + $util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0); + else if (d.baseKey.length >= 0) + m.baseKey = d.baseKey; + } + if (d.identityKey != null) { + if (typeof d.identityKey === "string") + $util.base64.decode(d.identityKey, m.identityKey = $util.newBuffer($util.base64.length(d.identityKey)), 0); + else if (d.identityKey.length >= 0) + m.identityKey = d.identityKey; + } + if (d.message != null) { + if (typeof d.message === "string") + $util.base64.decode(d.message, m.message = $util.newBuffer($util.base64.length(d.message)), 0); + else if (d.message.length >= 0) + m.message = d.message; + } + return m; + }; + + PreKeySignalMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.preKeyId != null && m.hasOwnProperty("preKeyId")) { + d.preKeyId = m.preKeyId; + if (o.oneofs) + d._preKeyId = "preKeyId"; + } + if (m.baseKey != null && m.hasOwnProperty("baseKey")) { + d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey; + if (o.oneofs) + d._baseKey = "baseKey"; + } + if (m.identityKey != null && m.hasOwnProperty("identityKey")) { + d.identityKey = o.bytes === String ? $util.base64.encode(m.identityKey, 0, m.identityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.identityKey) : m.identityKey; + if (o.oneofs) + d._identityKey = "identityKey"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = o.bytes === String ? $util.base64.encode(m.message, 0, m.message.length) : o.bytes === Array ? Array.prototype.slice.call(m.message) : m.message; + if (o.oneofs) + d._message = "message"; + } + if (m.registrationId != null && m.hasOwnProperty("registrationId")) { + d.registrationId = m.registrationId; + if (o.oneofs) + d._registrationId = "registrationId"; + } + if (m.signedPreKeyId != null && m.hasOwnProperty("signedPreKeyId")) { + d.signedPreKeyId = m.signedPreKeyId; + if (o.oneofs) + d._signedPreKeyId = "signedPreKeyId"; + } + return d; + }; + + PreKeySignalMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PreKeySignalMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28122,7 +63672,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PremiumMessageInfo.prototype.serverCampaignId = ""; + PremiumMessageInfo.prototype.serverCampaignId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PremiumMessageInfo.prototype, "_serverCampaignId", { + get: $util.oneOfGetter($oneOfFields = ["serverCampaignId"]), + set: $util.oneOfSetter($oneOfFields) + }); PremiumMessageInfo.create = function create(properties) { return new PremiumMessageInfo(properties); @@ -28157,6 +63715,32 @@ export const proto = $root.proto = (() => { return m; }; + PremiumMessageInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PremiumMessageInfo) + return d; + var m = new $root.proto.PremiumMessageInfo(); + if (d.serverCampaignId != null) { + m.serverCampaignId = String(d.serverCampaignId); + } + return m; + }; + + PremiumMessageInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.serverCampaignId != null && m.hasOwnProperty("serverCampaignId")) { + d.serverCampaignId = m.serverCampaignId; + if (o.oneofs) + d._serverCampaignId = "serverCampaignId"; + } + return d; + }; + + PremiumMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PremiumMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28176,8 +63760,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PrimaryEphemeralIdentity.prototype.publicKey = $util.newBuffer([]); - PrimaryEphemeralIdentity.prototype.nonce = $util.newBuffer([]); + PrimaryEphemeralIdentity.prototype.publicKey = null; + PrimaryEphemeralIdentity.prototype.nonce = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PrimaryEphemeralIdentity.prototype, "_publicKey", { + get: $util.oneOfGetter($oneOfFields = ["publicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PrimaryEphemeralIdentity.prototype, "_nonce", { + get: $util.oneOfGetter($oneOfFields = ["nonce"]), + set: $util.oneOfSetter($oneOfFields) + }); PrimaryEphemeralIdentity.create = function create(properties) { return new PrimaryEphemeralIdentity(properties); @@ -28218,6 +63816,46 @@ export const proto = $root.proto = (() => { return m; }; + PrimaryEphemeralIdentity.fromObject = function fromObject(d) { + if (d instanceof $root.proto.PrimaryEphemeralIdentity) + return d; + var m = new $root.proto.PrimaryEphemeralIdentity(); + if (d.publicKey != null) { + if (typeof d.publicKey === "string") + $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0); + else if (d.publicKey.length >= 0) + m.publicKey = d.publicKey; + } + if (d.nonce != null) { + if (typeof d.nonce === "string") + $util.base64.decode(d.nonce, m.nonce = $util.newBuffer($util.base64.length(d.nonce)), 0); + else if (d.nonce.length >= 0) + m.nonce = d.nonce; + } + return m; + }; + + PrimaryEphemeralIdentity.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.publicKey != null && m.hasOwnProperty("publicKey")) { + d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey; + if (o.oneofs) + d._publicKey = "publicKey"; + } + if (m.nonce != null && m.hasOwnProperty("nonce")) { + d.nonce = o.bytes === String ? $util.base64.encode(m.nonce, 0, m.nonce.length) : o.bytes === Array ? Array.prototype.slice.call(m.nonce) : m.nonce; + if (o.oneofs) + d._nonce = "nonce"; + } + return d; + }; + + PrimaryEphemeralIdentity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PrimaryEphemeralIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28246,15 +63884,59 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ProcessedVideo.prototype.directPath = ""; - ProcessedVideo.prototype.fileSha256 = $util.newBuffer([]); - ProcessedVideo.prototype.height = 0; - ProcessedVideo.prototype.width = 0; - ProcessedVideo.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - ProcessedVideo.prototype.bitrate = 0; - ProcessedVideo.prototype.quality = 0; + ProcessedVideo.prototype.directPath = null; + ProcessedVideo.prototype.fileSha256 = null; + ProcessedVideo.prototype.height = null; + ProcessedVideo.prototype.width = null; + ProcessedVideo.prototype.fileLength = null; + ProcessedVideo.prototype.bitrate = null; + ProcessedVideo.prototype.quality = null; ProcessedVideo.prototype.capabilities = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_bitrate", { + get: $util.oneOfGetter($oneOfFields = ["bitrate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProcessedVideo.prototype, "_quality", { + get: $util.oneOfGetter($oneOfFields = ["quality"]), + set: $util.oneOfSetter($oneOfFields) + }); + ProcessedVideo.create = function create(properties) { return new ProcessedVideo(properties); }; @@ -28334,6 +64016,131 @@ export const proto = $root.proto = (() => { return m; }; + ProcessedVideo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ProcessedVideo) + return d; + var m = new $root.proto.ProcessedVideo(); + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.bitrate != null) { + m.bitrate = d.bitrate >>> 0; + } + switch (d.quality) { + default: + if (typeof d.quality === "number") { + m.quality = d.quality; + break; + } + break; + case "UNDEFINED": + case 0: + m.quality = 0; + break; + case "LOW": + case 1: + m.quality = 1; + break; + case "MID": + case 2: + m.quality = 2; + break; + case "HIGH": + case 3: + m.quality = 3; + break; + } + if (d.capabilities) { + if (!Array.isArray(d.capabilities)) + throw TypeError(".proto.ProcessedVideo.capabilities: array expected"); + m.capabilities = []; + for (var i = 0; i < d.capabilities.length; ++i) { + m.capabilities[i] = String(d.capabilities[i]); + } + } + return m; + }; + + ProcessedVideo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.capabilities = []; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.bitrate != null && m.hasOwnProperty("bitrate")) { + d.bitrate = m.bitrate; + if (o.oneofs) + d._bitrate = "bitrate"; + } + if (m.quality != null && m.hasOwnProperty("quality")) { + d.quality = o.enums === String ? $root.proto.ProcessedVideo.VideoQuality[m.quality] === undefined ? m.quality : $root.proto.ProcessedVideo.VideoQuality[m.quality] : m.quality; + if (o.oneofs) + d._quality = "quality"; + } + if (m.capabilities && m.capabilities.length) { + d.capabilities = []; + for (var j = 0; j < m.capabilities.length; ++j) { + d.capabilities[j] = m.capabilities[j]; + } + } + return d; + }; + + ProcessedVideo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProcessedVideo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28362,9 +64169,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ProloguePayload.prototype.companionEphemeralIdentity = $util.newBuffer([]); + ProloguePayload.prototype.companionEphemeralIdentity = null; ProloguePayload.prototype.commitment = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProloguePayload.prototype, "_companionEphemeralIdentity", { + get: $util.oneOfGetter($oneOfFields = ["companionEphemeralIdentity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProloguePayload.prototype, "_commitment", { + get: $util.oneOfGetter($oneOfFields = ["commitment"]), + set: $util.oneOfSetter($oneOfFields) + }); + ProloguePayload.create = function create(properties) { return new ProloguePayload(properties); }; @@ -28404,6 +64225,45 @@ export const proto = $root.proto = (() => { return m; }; + ProloguePayload.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ProloguePayload) + return d; + var m = new $root.proto.ProloguePayload(); + if (d.companionEphemeralIdentity != null) { + if (typeof d.companionEphemeralIdentity === "string") + $util.base64.decode(d.companionEphemeralIdentity, m.companionEphemeralIdentity = $util.newBuffer($util.base64.length(d.companionEphemeralIdentity)), 0); + else if (d.companionEphemeralIdentity.length >= 0) + m.companionEphemeralIdentity = d.companionEphemeralIdentity; + } + if (d.commitment != null) { + if (typeof d.commitment !== "object") + throw TypeError(".proto.ProloguePayload.commitment: object expected"); + m.commitment = $root.proto.CompanionCommitment.fromObject(d.commitment); + } + return m; + }; + + ProloguePayload.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.companionEphemeralIdentity != null && m.hasOwnProperty("companionEphemeralIdentity")) { + d.companionEphemeralIdentity = o.bytes === String ? $util.base64.encode(m.companionEphemeralIdentity, 0, m.companionEphemeralIdentity.length) : o.bytes === Array ? Array.prototype.slice.call(m.companionEphemeralIdentity) : m.companionEphemeralIdentity; + if (o.oneofs) + d._companionEphemeralIdentity = "companionEphemeralIdentity"; + } + if (m.commitment != null && m.hasOwnProperty("commitment")) { + d.commitment = $root.proto.CompanionCommitment.toObject(m.commitment, o); + if (o.oneofs) + d._commitment = "commitment"; + } + return d; + }; + + ProloguePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ProloguePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28423,8 +64283,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Pushname.prototype.id = ""; - Pushname.prototype.pushname = ""; + Pushname.prototype.id = null; + Pushname.prototype.pushname = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Pushname.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Pushname.prototype, "_pushname", { + get: $util.oneOfGetter($oneOfFields = ["pushname"]), + set: $util.oneOfSetter($oneOfFields) + }); Pushname.create = function create(properties) { return new Pushname(properties); @@ -28465,6 +64339,40 @@ export const proto = $root.proto = (() => { return m; }; + Pushname.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Pushname) + return d; + var m = new $root.proto.Pushname(); + if (d.id != null) { + m.id = String(d.id); + } + if (d.pushname != null) { + m.pushname = String(d.pushname); + } + return m; + }; + + Pushname.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.pushname != null && m.hasOwnProperty("pushname")) { + d.pushname = m.pushname; + if (o.oneofs) + d._pushname = "pushname"; + } + return d; + }; + + Pushname.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Pushname.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28485,10 +64393,42 @@ export const proto = $root.proto = (() => { } Reaction.prototype.key = null; - Reaction.prototype.text = ""; - Reaction.prototype.groupingKey = ""; - Reaction.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - Reaction.prototype.unread = false; + Reaction.prototype.text = null; + Reaction.prototype.groupingKey = null; + Reaction.prototype.senderTimestampMs = null; + Reaction.prototype.unread = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reaction.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reaction.prototype, "_text", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reaction.prototype, "_groupingKey", { + get: $util.oneOfGetter($oneOfFields = ["groupingKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reaction.prototype, "_senderTimestampMs", { + get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reaction.prototype, "_unread", { + get: $util.oneOfGetter($oneOfFields = ["unread"]), + set: $util.oneOfSetter($oneOfFields) + }); Reaction.create = function create(properties) { return new Reaction(properties); @@ -28547,6 +64487,76 @@ export const proto = $root.proto = (() => { return m; }; + Reaction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Reaction) + return d; + var m = new $root.proto.Reaction(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.Reaction.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.text != null) { + m.text = String(d.text); + } + if (d.groupingKey != null) { + m.groupingKey = String(d.groupingKey); + } + if (d.senderTimestampMs != null) { + if ($util.Long) + (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false; + else if (typeof d.senderTimestampMs === "string") + m.senderTimestampMs = parseInt(d.senderTimestampMs, 10); + else if (typeof d.senderTimestampMs === "number") + m.senderTimestampMs = d.senderTimestampMs; + else if (typeof d.senderTimestampMs === "object") + m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber(); + } + if (d.unread != null) { + m.unread = Boolean(d.unread); + } + return m; + }; + + Reaction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.text != null && m.hasOwnProperty("text")) { + d.text = m.text; + if (o.oneofs) + d._text = "text"; + } + if (m.groupingKey != null && m.hasOwnProperty("groupingKey")) { + d.groupingKey = m.groupingKey; + if (o.oneofs) + d._groupingKey = "groupingKey"; + } + if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) { + if (typeof m.senderTimestampMs === "number") + d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; + else + d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + if (o.oneofs) + d._senderTimestampMs = "senderTimestampMs"; + } + if (m.unread != null && m.hasOwnProperty("unread")) { + d.unread = m.unread; + if (o.oneofs) + d._unread = "unread"; + } + return d; + }; + + Reaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Reaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28566,8 +64576,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - RecentEmojiWeight.prototype.emoji = ""; - RecentEmojiWeight.prototype.weight = 0; + RecentEmojiWeight.prototype.emoji = null; + RecentEmojiWeight.prototype.weight = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RecentEmojiWeight.prototype, "_emoji", { + get: $util.oneOfGetter($oneOfFields = ["emoji"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RecentEmojiWeight.prototype, "_weight", { + get: $util.oneOfGetter($oneOfFields = ["weight"]), + set: $util.oneOfSetter($oneOfFields) + }); RecentEmojiWeight.create = function create(properties) { return new RecentEmojiWeight(properties); @@ -28608,6 +64632,40 @@ export const proto = $root.proto = (() => { return m; }; + RecentEmojiWeight.fromObject = function fromObject(d) { + if (d instanceof $root.proto.RecentEmojiWeight) + return d; + var m = new $root.proto.RecentEmojiWeight(); + if (d.emoji != null) { + m.emoji = String(d.emoji); + } + if (d.weight != null) { + m.weight = Number(d.weight); + } + return m; + }; + + RecentEmojiWeight.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.emoji != null && m.hasOwnProperty("emoji")) { + d.emoji = m.emoji; + if (o.oneofs) + d._emoji = "emoji"; + } + if (m.weight != null && m.hasOwnProperty("weight")) { + d.weight = o.json && !isFinite(m.weight) ? String(m.weight) : m.weight; + if (o.oneofs) + d._weight = "weight"; + } + return d; + }; + + RecentEmojiWeight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RecentEmojiWeight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28631,6 +64689,14 @@ export const proto = $root.proto = (() => { RecordStructure.prototype.currentSession = null; RecordStructure.prototype.previousSessions = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RecordStructure.prototype, "_currentSession", { + get: $util.oneOfGetter($oneOfFields = ["currentSession"]), + set: $util.oneOfSetter($oneOfFields) + }); + RecordStructure.create = function create(properties) { return new RecordStructure(properties); }; @@ -28674,6 +64740,53 @@ export const proto = $root.proto = (() => { return m; }; + RecordStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.RecordStructure) + return d; + var m = new $root.proto.RecordStructure(); + if (d.currentSession != null) { + if (typeof d.currentSession !== "object") + throw TypeError(".proto.RecordStructure.currentSession: object expected"); + m.currentSession = $root.proto.SessionStructure.fromObject(d.currentSession); + } + if (d.previousSessions) { + if (!Array.isArray(d.previousSessions)) + throw TypeError(".proto.RecordStructure.previousSessions: array expected"); + m.previousSessions = []; + for (var i = 0; i < d.previousSessions.length; ++i) { + if (typeof d.previousSessions[i] !== "object") + throw TypeError(".proto.RecordStructure.previousSessions: object expected"); + m.previousSessions[i] = $root.proto.SessionStructure.fromObject(d.previousSessions[i]); + } + } + return m; + }; + + RecordStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.previousSessions = []; + } + if (m.currentSession != null && m.hasOwnProperty("currentSession")) { + d.currentSession = $root.proto.SessionStructure.toObject(m.currentSession, o); + if (o.oneofs) + d._currentSession = "currentSession"; + } + if (m.previousSessions && m.previousSessions.length) { + d.previousSessions = []; + for (var j = 0; j < m.previousSessions.length; ++j) { + d.previousSessions[j] = $root.proto.SessionStructure.toObject(m.previousSessions[j], o); + } + } + return d; + }; + + RecordStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28693,10 +64806,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Reportable.prototype.minVersion = 0; - Reportable.prototype.maxVersion = 0; - Reportable.prototype.notReportableMinVersion = 0; - Reportable.prototype.never = false; + Reportable.prototype.minVersion = null; + Reportable.prototype.maxVersion = null; + Reportable.prototype.notReportableMinVersion = null; + Reportable.prototype.never = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reportable.prototype, "_minVersion", { + get: $util.oneOfGetter($oneOfFields = ["minVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reportable.prototype, "_maxVersion", { + get: $util.oneOfGetter($oneOfFields = ["maxVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reportable.prototype, "_notReportableMinVersion", { + get: $util.oneOfGetter($oneOfFields = ["notReportableMinVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Reportable.prototype, "_never", { + get: $util.oneOfGetter($oneOfFields = ["never"]), + set: $util.oneOfSetter($oneOfFields) + }); Reportable.create = function create(properties) { return new Reportable(properties); @@ -28749,6 +64888,56 @@ export const proto = $root.proto = (() => { return m; }; + Reportable.fromObject = function fromObject(d) { + if (d instanceof $root.proto.Reportable) + return d; + var m = new $root.proto.Reportable(); + if (d.minVersion != null) { + m.minVersion = d.minVersion >>> 0; + } + if (d.maxVersion != null) { + m.maxVersion = d.maxVersion >>> 0; + } + if (d.notReportableMinVersion != null) { + m.notReportableMinVersion = d.notReportableMinVersion >>> 0; + } + if (d.never != null) { + m.never = Boolean(d.never); + } + return m; + }; + + Reportable.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.minVersion != null && m.hasOwnProperty("minVersion")) { + d.minVersion = m.minVersion; + if (o.oneofs) + d._minVersion = "minVersion"; + } + if (m.maxVersion != null && m.hasOwnProperty("maxVersion")) { + d.maxVersion = m.maxVersion; + if (o.oneofs) + d._maxVersion = "maxVersion"; + } + if (m.notReportableMinVersion != null && m.hasOwnProperty("notReportableMinVersion")) { + d.notReportableMinVersion = m.notReportableMinVersion; + if (o.oneofs) + d._notReportableMinVersion = "notReportableMinVersion"; + } + if (m.never != null && m.hasOwnProperty("never")) { + d.never = m.never; + if (o.oneofs) + d._never = "never"; + } + return d; + }; + + Reportable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Reportable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28768,7 +64957,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ReportingTokenInfo.prototype.reportingTag = $util.newBuffer([]); + ReportingTokenInfo.prototype.reportingTag = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReportingTokenInfo.prototype, "_reportingTag", { + get: $util.oneOfGetter($oneOfFields = ["reportingTag"]), + set: $util.oneOfSetter($oneOfFields) + }); ReportingTokenInfo.create = function create(properties) { return new ReportingTokenInfo(properties); @@ -28803,6 +65000,35 @@ export const proto = $root.proto = (() => { return m; }; + ReportingTokenInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ReportingTokenInfo) + return d; + var m = new $root.proto.ReportingTokenInfo(); + if (d.reportingTag != null) { + if (typeof d.reportingTag === "string") + $util.base64.decode(d.reportingTag, m.reportingTag = $util.newBuffer($util.base64.length(d.reportingTag)), 0); + else if (d.reportingTag.length >= 0) + m.reportingTag = d.reportingTag; + } + return m; + }; + + ReportingTokenInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.reportingTag != null && m.hasOwnProperty("reportingTag")) { + d.reportingTag = o.bytes === String ? $util.base64.encode(m.reportingTag, 0, m.reportingTag.length) : o.bytes === Array ? Array.prototype.slice.call(m.reportingTag) : m.reportingTag; + if (o.oneofs) + d._reportingTag = "reportingTag"; + } + return d; + }; + + ReportingTokenInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ReportingTokenInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28822,10 +65048,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderKeyDistributionMessage.prototype.id = 0; - SenderKeyDistributionMessage.prototype.iteration = 0; - SenderKeyDistributionMessage.prototype.chainKey = $util.newBuffer([]); - SenderKeyDistributionMessage.prototype.signingKey = $util.newBuffer([]); + SenderKeyDistributionMessage.prototype.id = null; + SenderKeyDistributionMessage.prototype.iteration = null; + SenderKeyDistributionMessage.prototype.chainKey = null; + SenderKeyDistributionMessage.prototype.signingKey = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyDistributionMessage.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyDistributionMessage.prototype, "_iteration", { + get: $util.oneOfGetter($oneOfFields = ["iteration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyDistributionMessage.prototype, "_chainKey", { + get: $util.oneOfGetter($oneOfFields = ["chainKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyDistributionMessage.prototype, "_signingKey", { + get: $util.oneOfGetter($oneOfFields = ["signingKey"]), + set: $util.oneOfSetter($oneOfFields) + }); SenderKeyDistributionMessage.create = function create(properties) { return new SenderKeyDistributionMessage(properties); @@ -28878,6 +65130,62 @@ export const proto = $root.proto = (() => { return m; }; + SenderKeyDistributionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyDistributionMessage) + return d; + var m = new $root.proto.SenderKeyDistributionMessage(); + if (d.id != null) { + m.id = d.id >>> 0; + } + if (d.iteration != null) { + m.iteration = d.iteration >>> 0; + } + if (d.chainKey != null) { + if (typeof d.chainKey === "string") + $util.base64.decode(d.chainKey, m.chainKey = $util.newBuffer($util.base64.length(d.chainKey)), 0); + else if (d.chainKey.length >= 0) + m.chainKey = d.chainKey; + } + if (d.signingKey != null) { + if (typeof d.signingKey === "string") + $util.base64.decode(d.signingKey, m.signingKey = $util.newBuffer($util.base64.length(d.signingKey)), 0); + else if (d.signingKey.length >= 0) + m.signingKey = d.signingKey; + } + return m; + }; + + SenderKeyDistributionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.iteration != null && m.hasOwnProperty("iteration")) { + d.iteration = m.iteration; + if (o.oneofs) + d._iteration = "iteration"; + } + if (m.chainKey != null && m.hasOwnProperty("chainKey")) { + d.chainKey = o.bytes === String ? $util.base64.encode(m.chainKey, 0, m.chainKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.chainKey) : m.chainKey; + if (o.oneofs) + d._chainKey = "chainKey"; + } + if (m.signingKey != null && m.hasOwnProperty("signingKey")) { + d.signingKey = o.bytes === String ? $util.base64.encode(m.signingKey, 0, m.signingKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.signingKey) : m.signingKey; + if (o.oneofs) + d._signingKey = "signingKey"; + } + return d; + }; + + SenderKeyDistributionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderKeyDistributionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -28897,9 +65205,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderKeyMessage.prototype.id = 0; - SenderKeyMessage.prototype.iteration = 0; - SenderKeyMessage.prototype.ciphertext = $util.newBuffer([]); + SenderKeyMessage.prototype.id = null; + SenderKeyMessage.prototype.iteration = null; + SenderKeyMessage.prototype.ciphertext = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyMessage.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyMessage.prototype, "_iteration", { + get: $util.oneOfGetter($oneOfFields = ["iteration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyMessage.prototype, "_ciphertext", { + get: $util.oneOfGetter($oneOfFields = ["ciphertext"]), + set: $util.oneOfSetter($oneOfFields) + }); SenderKeyMessage.create = function create(properties) { return new SenderKeyMessage(properties); @@ -28946,6 +65274,51 @@ export const proto = $root.proto = (() => { return m; }; + SenderKeyMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyMessage) + return d; + var m = new $root.proto.SenderKeyMessage(); + if (d.id != null) { + m.id = d.id >>> 0; + } + if (d.iteration != null) { + m.iteration = d.iteration >>> 0; + } + if (d.ciphertext != null) { + if (typeof d.ciphertext === "string") + $util.base64.decode(d.ciphertext, m.ciphertext = $util.newBuffer($util.base64.length(d.ciphertext)), 0); + else if (d.ciphertext.length >= 0) + m.ciphertext = d.ciphertext; + } + return m; + }; + + SenderKeyMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.iteration != null && m.hasOwnProperty("iteration")) { + d.iteration = m.iteration; + if (o.oneofs) + d._iteration = "iteration"; + } + if (m.ciphertext != null && m.hasOwnProperty("ciphertext")) { + d.ciphertext = o.bytes === String ? $util.base64.encode(m.ciphertext, 0, m.ciphertext.length) : o.bytes === Array ? Array.prototype.slice.call(m.ciphertext) : m.ciphertext; + if (o.oneofs) + d._ciphertext = "ciphertext"; + } + return d; + }; + + SenderKeyMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderKeyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29005,6 +65378,43 @@ export const proto = $root.proto = (() => { return m; }; + SenderKeyRecordStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyRecordStructure) + return d; + var m = new $root.proto.SenderKeyRecordStructure(); + if (d.senderKeyStates) { + if (!Array.isArray(d.senderKeyStates)) + throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected"); + m.senderKeyStates = []; + for (var i = 0; i < d.senderKeyStates.length; ++i) { + if (typeof d.senderKeyStates[i] !== "object") + throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: object expected"); + m.senderKeyStates[i] = $root.proto.SenderKeyStateStructure.fromObject(d.senderKeyStates[i]); + } + } + return m; + }; + + SenderKeyRecordStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.senderKeyStates = []; + } + if (m.senderKeyStates && m.senderKeyStates.length) { + d.senderKeyStates = []; + for (var j = 0; j < m.senderKeyStates.length; ++j) { + d.senderKeyStates[j] = $root.proto.SenderKeyStateStructure.toObject(m.senderKeyStates[j], o); + } + } + return d; + }; + + SenderKeyRecordStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29025,11 +65435,31 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderKeyStateStructure.prototype.senderKeyId = 0; + SenderKeyStateStructure.prototype.senderKeyId = null; SenderKeyStateStructure.prototype.senderChainKey = null; SenderKeyStateStructure.prototype.senderSigningKey = null; SenderKeyStateStructure.prototype.senderMessageKeys = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyStateStructure.prototype, "_senderKeyId", { + get: $util.oneOfGetter($oneOfFields = ["senderKeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyStateStructure.prototype, "_senderChainKey", { + get: $util.oneOfGetter($oneOfFields = ["senderChainKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderKeyStateStructure.prototype, "_senderSigningKey", { + get: $util.oneOfGetter($oneOfFields = ["senderSigningKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + SenderKeyStateStructure.create = function create(properties) { return new SenderKeyStateStructure(properties); }; @@ -29085,6 +65515,71 @@ export const proto = $root.proto = (() => { return m; }; + SenderKeyStateStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyStateStructure) + return d; + var m = new $root.proto.SenderKeyStateStructure(); + if (d.senderKeyId != null) { + m.senderKeyId = d.senderKeyId >>> 0; + } + if (d.senderChainKey != null) { + if (typeof d.senderChainKey !== "object") + throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected"); + m.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.fromObject(d.senderChainKey); + } + if (d.senderSigningKey != null) { + if (typeof d.senderSigningKey !== "object") + throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected"); + m.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(d.senderSigningKey); + } + if (d.senderMessageKeys) { + if (!Array.isArray(d.senderMessageKeys)) + throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected"); + m.senderMessageKeys = []; + for (var i = 0; i < d.senderMessageKeys.length; ++i) { + if (typeof d.senderMessageKeys[i] !== "object") + throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: object expected"); + m.senderMessageKeys[i] = $root.proto.SenderKeyStateStructure.SenderMessageKey.fromObject(d.senderMessageKeys[i]); + } + } + return m; + }; + + SenderKeyStateStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.senderMessageKeys = []; + } + if (m.senderKeyId != null && m.hasOwnProperty("senderKeyId")) { + d.senderKeyId = m.senderKeyId; + if (o.oneofs) + d._senderKeyId = "senderKeyId"; + } + if (m.senderChainKey != null && m.hasOwnProperty("senderChainKey")) { + d.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.toObject(m.senderChainKey, o); + if (o.oneofs) + d._senderChainKey = "senderChainKey"; + } + if (m.senderSigningKey != null && m.hasOwnProperty("senderSigningKey")) { + d.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.toObject(m.senderSigningKey, o); + if (o.oneofs) + d._senderSigningKey = "senderSigningKey"; + } + if (m.senderMessageKeys && m.senderMessageKeys.length) { + d.senderMessageKeys = []; + for (var j = 0; j < m.senderMessageKeys.length; ++j) { + d.senderMessageKeys[j] = $root.proto.SenderKeyStateStructure.SenderMessageKey.toObject(m.senderMessageKeys[j], o); + } + } + return d; + }; + + SenderKeyStateStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderKeyStateStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29101,8 +65596,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderChainKey.prototype.iteration = 0; - SenderChainKey.prototype.seed = $util.newBuffer([]); + SenderChainKey.prototype.iteration = null; + SenderChainKey.prototype.seed = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderChainKey.prototype, "_iteration", { + get: $util.oneOfGetter($oneOfFields = ["iteration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderChainKey.prototype, "_seed", { + get: $util.oneOfGetter($oneOfFields = ["seed"]), + set: $util.oneOfSetter($oneOfFields) + }); SenderChainKey.create = function create(properties) { return new SenderChainKey(properties); @@ -29143,6 +65652,43 @@ export const proto = $root.proto = (() => { return m; }; + SenderChainKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyStateStructure.SenderChainKey) + return d; + var m = new $root.proto.SenderKeyStateStructure.SenderChainKey(); + if (d.iteration != null) { + m.iteration = d.iteration >>> 0; + } + if (d.seed != null) { + if (typeof d.seed === "string") + $util.base64.decode(d.seed, m.seed = $util.newBuffer($util.base64.length(d.seed)), 0); + else if (d.seed.length >= 0) + m.seed = d.seed; + } + return m; + }; + + SenderChainKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.iteration != null && m.hasOwnProperty("iteration")) { + d.iteration = m.iteration; + if (o.oneofs) + d._iteration = "iteration"; + } + if (m.seed != null && m.hasOwnProperty("seed")) { + d.seed = o.bytes === String ? $util.base64.encode(m.seed, 0, m.seed.length) : o.bytes === Array ? Array.prototype.slice.call(m.seed) : m.seed; + if (o.oneofs) + d._seed = "seed"; + } + return d; + }; + + SenderChainKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29162,8 +65708,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderMessageKey.prototype.iteration = 0; - SenderMessageKey.prototype.seed = $util.newBuffer([]); + SenderMessageKey.prototype.iteration = null; + SenderMessageKey.prototype.seed = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderMessageKey.prototype, "_iteration", { + get: $util.oneOfGetter($oneOfFields = ["iteration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderMessageKey.prototype, "_seed", { + get: $util.oneOfGetter($oneOfFields = ["seed"]), + set: $util.oneOfSetter($oneOfFields) + }); SenderMessageKey.create = function create(properties) { return new SenderMessageKey(properties); @@ -29204,6 +65764,43 @@ export const proto = $root.proto = (() => { return m; }; + SenderMessageKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyStateStructure.SenderMessageKey) + return d; + var m = new $root.proto.SenderKeyStateStructure.SenderMessageKey(); + if (d.iteration != null) { + m.iteration = d.iteration >>> 0; + } + if (d.seed != null) { + if (typeof d.seed === "string") + $util.base64.decode(d.seed, m.seed = $util.newBuffer($util.base64.length(d.seed)), 0); + else if (d.seed.length >= 0) + m.seed = d.seed; + } + return m; + }; + + SenderMessageKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.iteration != null && m.hasOwnProperty("iteration")) { + d.iteration = m.iteration; + if (o.oneofs) + d._iteration = "iteration"; + } + if (m.seed != null && m.hasOwnProperty("seed")) { + d.seed = o.bytes === String ? $util.base64.encode(m.seed, 0, m.seed.length) : o.bytes === Array ? Array.prototype.slice.call(m.seed) : m.seed; + if (o.oneofs) + d._seed = "seed"; + } + return d; + }; + + SenderMessageKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderMessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29223,8 +65820,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SenderSigningKey.prototype["public"] = $util.newBuffer([]); - SenderSigningKey.prototype["private"] = $util.newBuffer([]); + SenderSigningKey.prototype["public"] = null; + SenderSigningKey.prototype["private"] = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderSigningKey.prototype, "_public", { + get: $util.oneOfGetter($oneOfFields = ["public"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SenderSigningKey.prototype, "_private", { + get: $util.oneOfGetter($oneOfFields = ["private"]), + set: $util.oneOfSetter($oneOfFields) + }); SenderSigningKey.create = function create(properties) { return new SenderSigningKey(properties); @@ -29265,6 +65876,46 @@ export const proto = $root.proto = (() => { return m; }; + SenderSigningKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SenderKeyStateStructure.SenderSigningKey) + return d; + var m = new $root.proto.SenderKeyStateStructure.SenderSigningKey(); + if (d["public"] != null) { + if (typeof d["public"] === "string") + $util.base64.decode(d["public"], m["public"] = $util.newBuffer($util.base64.length(d["public"])), 0); + else if (d["public"].length >= 0) + m["public"] = d["public"]; + } + if (d["private"] != null) { + if (typeof d["private"] === "string") + $util.base64.decode(d["private"], m["private"] = $util.newBuffer($util.base64.length(d["private"])), 0); + else if (d["private"].length >= 0) + m["private"] = d["private"]; + } + return m; + }; + + SenderSigningKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m["public"] != null && m.hasOwnProperty("public")) { + d["public"] = o.bytes === String ? $util.base64.encode(m["public"], 0, m["public"].length) : o.bytes === Array ? Array.prototype.slice.call(m["public"]) : m["public"]; + if (o.oneofs) + d._public = "public"; + } + if (m["private"] != null && m.hasOwnProperty("private")) { + d["private"] = o.bytes === String ? $util.base64.encode(m["private"], 0, m["private"].length) : o.bytes === Array ? Array.prototype.slice.call(m["private"]) : m["private"]; + if (o.oneofs) + d._private = "private"; + } + return d; + }; + + SenderSigningKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SenderSigningKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29287,7 +65938,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ServerErrorReceipt.prototype.stanzaId = ""; + ServerErrorReceipt.prototype.stanzaId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ServerErrorReceipt.prototype, "_stanzaId", { + get: $util.oneOfGetter($oneOfFields = ["stanzaId"]), + set: $util.oneOfSetter($oneOfFields) + }); ServerErrorReceipt.create = function create(properties) { return new ServerErrorReceipt(properties); @@ -29322,6 +65981,32 @@ export const proto = $root.proto = (() => { return m; }; + ServerErrorReceipt.fromObject = function fromObject(d) { + if (d instanceof $root.proto.ServerErrorReceipt) + return d; + var m = new $root.proto.ServerErrorReceipt(); + if (d.stanzaId != null) { + m.stanzaId = String(d.stanzaId); + } + return m; + }; + + ServerErrorReceipt.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.stanzaId != null && m.hasOwnProperty("stanzaId")) { + d.stanzaId = m.stanzaId; + if (o.oneofs) + d._stanzaId = "stanzaId"; + } + return d; + }; + + ServerErrorReceipt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ServerErrorReceipt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29342,19 +66027,93 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SessionStructure.prototype.sessionVersion = 0; - SessionStructure.prototype.localIdentityPublic = $util.newBuffer([]); - SessionStructure.prototype.remoteIdentityPublic = $util.newBuffer([]); - SessionStructure.prototype.rootKey = $util.newBuffer([]); - SessionStructure.prototype.previousCounter = 0; + SessionStructure.prototype.sessionVersion = null; + SessionStructure.prototype.localIdentityPublic = null; + SessionStructure.prototype.remoteIdentityPublic = null; + SessionStructure.prototype.rootKey = null; + SessionStructure.prototype.previousCounter = null; SessionStructure.prototype.senderChain = null; SessionStructure.prototype.receiverChains = $util.emptyArray; SessionStructure.prototype.pendingKeyExchange = null; SessionStructure.prototype.pendingPreKey = null; - SessionStructure.prototype.remoteRegistrationId = 0; - SessionStructure.prototype.localRegistrationId = 0; - SessionStructure.prototype.needsRefresh = false; - SessionStructure.prototype.aliceBaseKey = $util.newBuffer([]); + SessionStructure.prototype.remoteRegistrationId = null; + SessionStructure.prototype.localRegistrationId = null; + SessionStructure.prototype.needsRefresh = null; + SessionStructure.prototype.aliceBaseKey = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_sessionVersion", { + get: $util.oneOfGetter($oneOfFields = ["sessionVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_localIdentityPublic", { + get: $util.oneOfGetter($oneOfFields = ["localIdentityPublic"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_remoteIdentityPublic", { + get: $util.oneOfGetter($oneOfFields = ["remoteIdentityPublic"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_rootKey", { + get: $util.oneOfGetter($oneOfFields = ["rootKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_previousCounter", { + get: $util.oneOfGetter($oneOfFields = ["previousCounter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_senderChain", { + get: $util.oneOfGetter($oneOfFields = ["senderChain"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_pendingKeyExchange", { + get: $util.oneOfGetter($oneOfFields = ["pendingKeyExchange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_pendingPreKey", { + get: $util.oneOfGetter($oneOfFields = ["pendingPreKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_remoteRegistrationId", { + get: $util.oneOfGetter($oneOfFields = ["remoteRegistrationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_localRegistrationId", { + get: $util.oneOfGetter($oneOfFields = ["localRegistrationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_needsRefresh", { + get: $util.oneOfGetter($oneOfFields = ["needsRefresh"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SessionStructure.prototype, "_aliceBaseKey", { + get: $util.oneOfGetter($oneOfFields = ["aliceBaseKey"]), + set: $util.oneOfSetter($oneOfFields) + }); SessionStructure.create = function create(properties) { return new SessionStructure(properties); @@ -29465,6 +66224,157 @@ export const proto = $root.proto = (() => { return m; }; + SessionStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SessionStructure) + return d; + var m = new $root.proto.SessionStructure(); + if (d.sessionVersion != null) { + m.sessionVersion = d.sessionVersion >>> 0; + } + if (d.localIdentityPublic != null) { + if (typeof d.localIdentityPublic === "string") + $util.base64.decode(d.localIdentityPublic, m.localIdentityPublic = $util.newBuffer($util.base64.length(d.localIdentityPublic)), 0); + else if (d.localIdentityPublic.length >= 0) + m.localIdentityPublic = d.localIdentityPublic; + } + if (d.remoteIdentityPublic != null) { + if (typeof d.remoteIdentityPublic === "string") + $util.base64.decode(d.remoteIdentityPublic, m.remoteIdentityPublic = $util.newBuffer($util.base64.length(d.remoteIdentityPublic)), 0); + else if (d.remoteIdentityPublic.length >= 0) + m.remoteIdentityPublic = d.remoteIdentityPublic; + } + if (d.rootKey != null) { + if (typeof d.rootKey === "string") + $util.base64.decode(d.rootKey, m.rootKey = $util.newBuffer($util.base64.length(d.rootKey)), 0); + else if (d.rootKey.length >= 0) + m.rootKey = d.rootKey; + } + if (d.previousCounter != null) { + m.previousCounter = d.previousCounter >>> 0; + } + if (d.senderChain != null) { + if (typeof d.senderChain !== "object") + throw TypeError(".proto.SessionStructure.senderChain: object expected"); + m.senderChain = $root.proto.SessionStructure.Chain.fromObject(d.senderChain); + } + if (d.receiverChains) { + if (!Array.isArray(d.receiverChains)) + throw TypeError(".proto.SessionStructure.receiverChains: array expected"); + m.receiverChains = []; + for (var i = 0; i < d.receiverChains.length; ++i) { + if (typeof d.receiverChains[i] !== "object") + throw TypeError(".proto.SessionStructure.receiverChains: object expected"); + m.receiverChains[i] = $root.proto.SessionStructure.Chain.fromObject(d.receiverChains[i]); + } + } + if (d.pendingKeyExchange != null) { + if (typeof d.pendingKeyExchange !== "object") + throw TypeError(".proto.SessionStructure.pendingKeyExchange: object expected"); + m.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.fromObject(d.pendingKeyExchange); + } + if (d.pendingPreKey != null) { + if (typeof d.pendingPreKey !== "object") + throw TypeError(".proto.SessionStructure.pendingPreKey: object expected"); + m.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.fromObject(d.pendingPreKey); + } + if (d.remoteRegistrationId != null) { + m.remoteRegistrationId = d.remoteRegistrationId >>> 0; + } + if (d.localRegistrationId != null) { + m.localRegistrationId = d.localRegistrationId >>> 0; + } + if (d.needsRefresh != null) { + m.needsRefresh = Boolean(d.needsRefresh); + } + if (d.aliceBaseKey != null) { + if (typeof d.aliceBaseKey === "string") + $util.base64.decode(d.aliceBaseKey, m.aliceBaseKey = $util.newBuffer($util.base64.length(d.aliceBaseKey)), 0); + else if (d.aliceBaseKey.length >= 0) + m.aliceBaseKey = d.aliceBaseKey; + } + return m; + }; + + SessionStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.receiverChains = []; + } + if (m.sessionVersion != null && m.hasOwnProperty("sessionVersion")) { + d.sessionVersion = m.sessionVersion; + if (o.oneofs) + d._sessionVersion = "sessionVersion"; + } + if (m.localIdentityPublic != null && m.hasOwnProperty("localIdentityPublic")) { + d.localIdentityPublic = o.bytes === String ? $util.base64.encode(m.localIdentityPublic, 0, m.localIdentityPublic.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityPublic) : m.localIdentityPublic; + if (o.oneofs) + d._localIdentityPublic = "localIdentityPublic"; + } + if (m.remoteIdentityPublic != null && m.hasOwnProperty("remoteIdentityPublic")) { + d.remoteIdentityPublic = o.bytes === String ? $util.base64.encode(m.remoteIdentityPublic, 0, m.remoteIdentityPublic.length) : o.bytes === Array ? Array.prototype.slice.call(m.remoteIdentityPublic) : m.remoteIdentityPublic; + if (o.oneofs) + d._remoteIdentityPublic = "remoteIdentityPublic"; + } + if (m.rootKey != null && m.hasOwnProperty("rootKey")) { + d.rootKey = o.bytes === String ? $util.base64.encode(m.rootKey, 0, m.rootKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.rootKey) : m.rootKey; + if (o.oneofs) + d._rootKey = "rootKey"; + } + if (m.previousCounter != null && m.hasOwnProperty("previousCounter")) { + d.previousCounter = m.previousCounter; + if (o.oneofs) + d._previousCounter = "previousCounter"; + } + if (m.senderChain != null && m.hasOwnProperty("senderChain")) { + d.senderChain = $root.proto.SessionStructure.Chain.toObject(m.senderChain, o); + if (o.oneofs) + d._senderChain = "senderChain"; + } + if (m.receiverChains && m.receiverChains.length) { + d.receiverChains = []; + for (var j = 0; j < m.receiverChains.length; ++j) { + d.receiverChains[j] = $root.proto.SessionStructure.Chain.toObject(m.receiverChains[j], o); + } + } + if (m.pendingKeyExchange != null && m.hasOwnProperty("pendingKeyExchange")) { + d.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.toObject(m.pendingKeyExchange, o); + if (o.oneofs) + d._pendingKeyExchange = "pendingKeyExchange"; + } + if (m.pendingPreKey != null && m.hasOwnProperty("pendingPreKey")) { + d.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.toObject(m.pendingPreKey, o); + if (o.oneofs) + d._pendingPreKey = "pendingPreKey"; + } + if (m.remoteRegistrationId != null && m.hasOwnProperty("remoteRegistrationId")) { + d.remoteRegistrationId = m.remoteRegistrationId; + if (o.oneofs) + d._remoteRegistrationId = "remoteRegistrationId"; + } + if (m.localRegistrationId != null && m.hasOwnProperty("localRegistrationId")) { + d.localRegistrationId = m.localRegistrationId; + if (o.oneofs) + d._localRegistrationId = "localRegistrationId"; + } + if (m.needsRefresh != null && m.hasOwnProperty("needsRefresh")) { + d.needsRefresh = m.needsRefresh; + if (o.oneofs) + d._needsRefresh = "needsRefresh"; + } + if (m.aliceBaseKey != null && m.hasOwnProperty("aliceBaseKey")) { + d.aliceBaseKey = o.bytes === String ? $util.base64.encode(m.aliceBaseKey, 0, m.aliceBaseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.aliceBaseKey) : m.aliceBaseKey; + if (o.oneofs) + d._aliceBaseKey = "aliceBaseKey"; + } + return d; + }; + + SessionStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SessionStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29482,11 +66392,31 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Chain.prototype.senderRatchetKey = $util.newBuffer([]); - Chain.prototype.senderRatchetKeyPrivate = $util.newBuffer([]); + Chain.prototype.senderRatchetKey = null; + Chain.prototype.senderRatchetKeyPrivate = null; Chain.prototype.chainKey = null; Chain.prototype.messageKeys = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Chain.prototype, "_senderRatchetKey", { + get: $util.oneOfGetter($oneOfFields = ["senderRatchetKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Chain.prototype, "_senderRatchetKeyPrivate", { + get: $util.oneOfGetter($oneOfFields = ["senderRatchetKeyPrivate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Chain.prototype, "_chainKey", { + get: $util.oneOfGetter($oneOfFields = ["chainKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + Chain.create = function create(properties) { return new Chain(properties); }; @@ -29542,6 +66472,75 @@ export const proto = $root.proto = (() => { return m; }; + Chain.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SessionStructure.Chain) + return d; + var m = new $root.proto.SessionStructure.Chain(); + if (d.senderRatchetKey != null) { + if (typeof d.senderRatchetKey === "string") + $util.base64.decode(d.senderRatchetKey, m.senderRatchetKey = $util.newBuffer($util.base64.length(d.senderRatchetKey)), 0); + else if (d.senderRatchetKey.length >= 0) + m.senderRatchetKey = d.senderRatchetKey; + } + if (d.senderRatchetKeyPrivate != null) { + if (typeof d.senderRatchetKeyPrivate === "string") + $util.base64.decode(d.senderRatchetKeyPrivate, m.senderRatchetKeyPrivate = $util.newBuffer($util.base64.length(d.senderRatchetKeyPrivate)), 0); + else if (d.senderRatchetKeyPrivate.length >= 0) + m.senderRatchetKeyPrivate = d.senderRatchetKeyPrivate; + } + if (d.chainKey != null) { + if (typeof d.chainKey !== "object") + throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected"); + m.chainKey = $root.proto.SessionStructure.Chain.ChainKey.fromObject(d.chainKey); + } + if (d.messageKeys) { + if (!Array.isArray(d.messageKeys)) + throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected"); + m.messageKeys = []; + for (var i = 0; i < d.messageKeys.length; ++i) { + if (typeof d.messageKeys[i] !== "object") + throw TypeError(".proto.SessionStructure.Chain.messageKeys: object expected"); + m.messageKeys[i] = $root.proto.SessionStructure.Chain.MessageKey.fromObject(d.messageKeys[i]); + } + } + return m; + }; + + Chain.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.messageKeys = []; + } + if (m.senderRatchetKey != null && m.hasOwnProperty("senderRatchetKey")) { + d.senderRatchetKey = o.bytes === String ? $util.base64.encode(m.senderRatchetKey, 0, m.senderRatchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderRatchetKey) : m.senderRatchetKey; + if (o.oneofs) + d._senderRatchetKey = "senderRatchetKey"; + } + if (m.senderRatchetKeyPrivate != null && m.hasOwnProperty("senderRatchetKeyPrivate")) { + d.senderRatchetKeyPrivate = o.bytes === String ? $util.base64.encode(m.senderRatchetKeyPrivate, 0, m.senderRatchetKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderRatchetKeyPrivate) : m.senderRatchetKeyPrivate; + if (o.oneofs) + d._senderRatchetKeyPrivate = "senderRatchetKeyPrivate"; + } + if (m.chainKey != null && m.hasOwnProperty("chainKey")) { + d.chainKey = $root.proto.SessionStructure.Chain.ChainKey.toObject(m.chainKey, o); + if (o.oneofs) + d._chainKey = "chainKey"; + } + if (m.messageKeys && m.messageKeys.length) { + d.messageKeys = []; + for (var j = 0; j < m.messageKeys.length; ++j) { + d.messageKeys[j] = $root.proto.SessionStructure.Chain.MessageKey.toObject(m.messageKeys[j], o); + } + } + return d; + }; + + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29558,8 +66557,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ChainKey.prototype.index = 0; - ChainKey.prototype.key = $util.newBuffer([]); + ChainKey.prototype.index = null; + ChainKey.prototype.key = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChainKey.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChainKey.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); ChainKey.create = function create(properties) { return new ChainKey(properties); @@ -29600,6 +66613,43 @@ export const proto = $root.proto = (() => { return m; }; + ChainKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SessionStructure.Chain.ChainKey) + return d; + var m = new $root.proto.SessionStructure.Chain.ChainKey(); + if (d.index != null) { + m.index = d.index >>> 0; + } + if (d.key != null) { + if (typeof d.key === "string") + $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0); + else if (d.key.length >= 0) + m.key = d.key; + } + return m; + }; + + ChainKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.index != null && m.hasOwnProperty("index")) { + d.index = m.index; + if (o.oneofs) + d._index = "index"; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key; + if (o.oneofs) + d._key = "key"; + } + return d; + }; + + ChainKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29619,10 +66669,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MessageKey.prototype.index = 0; - MessageKey.prototype.cipherKey = $util.newBuffer([]); - MessageKey.prototype.macKey = $util.newBuffer([]); - MessageKey.prototype.iv = $util.newBuffer([]); + MessageKey.prototype.index = null; + MessageKey.prototype.cipherKey = null; + MessageKey.prototype.macKey = null; + MessageKey.prototype.iv = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_cipherKey", { + get: $util.oneOfGetter($oneOfFields = ["cipherKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_macKey", { + get: $util.oneOfGetter($oneOfFields = ["macKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MessageKey.prototype, "_iv", { + get: $util.oneOfGetter($oneOfFields = ["iv"]), + set: $util.oneOfSetter($oneOfFields) + }); MessageKey.create = function create(properties) { return new MessageKey(properties); @@ -29675,6 +66751,65 @@ export const proto = $root.proto = (() => { return m; }; + MessageKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SessionStructure.Chain.MessageKey) + return d; + var m = new $root.proto.SessionStructure.Chain.MessageKey(); + if (d.index != null) { + m.index = d.index >>> 0; + } + if (d.cipherKey != null) { + if (typeof d.cipherKey === "string") + $util.base64.decode(d.cipherKey, m.cipherKey = $util.newBuffer($util.base64.length(d.cipherKey)), 0); + else if (d.cipherKey.length >= 0) + m.cipherKey = d.cipherKey; + } + if (d.macKey != null) { + if (typeof d.macKey === "string") + $util.base64.decode(d.macKey, m.macKey = $util.newBuffer($util.base64.length(d.macKey)), 0); + else if (d.macKey.length >= 0) + m.macKey = d.macKey; + } + if (d.iv != null) { + if (typeof d.iv === "string") + $util.base64.decode(d.iv, m.iv = $util.newBuffer($util.base64.length(d.iv)), 0); + else if (d.iv.length >= 0) + m.iv = d.iv; + } + return m; + }; + + MessageKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.index != null && m.hasOwnProperty("index")) { + d.index = m.index; + if (o.oneofs) + d._index = "index"; + } + if (m.cipherKey != null && m.hasOwnProperty("cipherKey")) { + d.cipherKey = o.bytes === String ? $util.base64.encode(m.cipherKey, 0, m.cipherKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.cipherKey) : m.cipherKey; + if (o.oneofs) + d._cipherKey = "cipherKey"; + } + if (m.macKey != null && m.hasOwnProperty("macKey")) { + d.macKey = o.bytes === String ? $util.base64.encode(m.macKey, 0, m.macKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.macKey) : m.macKey; + if (o.oneofs) + d._macKey = "macKey"; + } + if (m.iv != null && m.hasOwnProperty("iv")) { + d.iv = o.bytes === String ? $util.base64.encode(m.iv, 0, m.iv.length) : o.bytes === Array ? Array.prototype.slice.call(m.iv) : m.iv; + if (o.oneofs) + d._iv = "iv"; + } + return d; + }; + + MessageKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29697,13 +66832,57 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PendingKeyExchange.prototype.sequence = 0; - PendingKeyExchange.prototype.localBaseKey = $util.newBuffer([]); - PendingKeyExchange.prototype.localBaseKeyPrivate = $util.newBuffer([]); - PendingKeyExchange.prototype.localRatchetKey = $util.newBuffer([]); - PendingKeyExchange.prototype.localRatchetKeyPrivate = $util.newBuffer([]); - PendingKeyExchange.prototype.localIdentityKey = $util.newBuffer([]); - PendingKeyExchange.prototype.localIdentityKeyPrivate = $util.newBuffer([]); + PendingKeyExchange.prototype.sequence = null; + PendingKeyExchange.prototype.localBaseKey = null; + PendingKeyExchange.prototype.localBaseKeyPrivate = null; + PendingKeyExchange.prototype.localRatchetKey = null; + PendingKeyExchange.prototype.localRatchetKeyPrivate = null; + PendingKeyExchange.prototype.localIdentityKey = null; + PendingKeyExchange.prototype.localIdentityKeyPrivate = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_sequence", { + get: $util.oneOfGetter($oneOfFields = ["sequence"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKey", { + get: $util.oneOfGetter($oneOfFields = ["localBaseKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKeyPrivate", { + get: $util.oneOfGetter($oneOfFields = ["localBaseKeyPrivate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKey", { + get: $util.oneOfGetter($oneOfFields = ["localRatchetKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKeyPrivate", { + get: $util.oneOfGetter($oneOfFields = ["localRatchetKeyPrivate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKey", { + get: $util.oneOfGetter($oneOfFields = ["localIdentityKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKeyPrivate", { + get: $util.oneOfGetter($oneOfFields = ["localIdentityKeyPrivate"]), + set: $util.oneOfSetter($oneOfFields) + }); PendingKeyExchange.create = function create(properties) { return new PendingKeyExchange(properties); @@ -29774,6 +66953,98 @@ export const proto = $root.proto = (() => { return m; }; + PendingKeyExchange.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SessionStructure.PendingKeyExchange) + return d; + var m = new $root.proto.SessionStructure.PendingKeyExchange(); + if (d.sequence != null) { + m.sequence = d.sequence >>> 0; + } + if (d.localBaseKey != null) { + if (typeof d.localBaseKey === "string") + $util.base64.decode(d.localBaseKey, m.localBaseKey = $util.newBuffer($util.base64.length(d.localBaseKey)), 0); + else if (d.localBaseKey.length >= 0) + m.localBaseKey = d.localBaseKey; + } + if (d.localBaseKeyPrivate != null) { + if (typeof d.localBaseKeyPrivate === "string") + $util.base64.decode(d.localBaseKeyPrivate, m.localBaseKeyPrivate = $util.newBuffer($util.base64.length(d.localBaseKeyPrivate)), 0); + else if (d.localBaseKeyPrivate.length >= 0) + m.localBaseKeyPrivate = d.localBaseKeyPrivate; + } + if (d.localRatchetKey != null) { + if (typeof d.localRatchetKey === "string") + $util.base64.decode(d.localRatchetKey, m.localRatchetKey = $util.newBuffer($util.base64.length(d.localRatchetKey)), 0); + else if (d.localRatchetKey.length >= 0) + m.localRatchetKey = d.localRatchetKey; + } + if (d.localRatchetKeyPrivate != null) { + if (typeof d.localRatchetKeyPrivate === "string") + $util.base64.decode(d.localRatchetKeyPrivate, m.localRatchetKeyPrivate = $util.newBuffer($util.base64.length(d.localRatchetKeyPrivate)), 0); + else if (d.localRatchetKeyPrivate.length >= 0) + m.localRatchetKeyPrivate = d.localRatchetKeyPrivate; + } + if (d.localIdentityKey != null) { + if (typeof d.localIdentityKey === "string") + $util.base64.decode(d.localIdentityKey, m.localIdentityKey = $util.newBuffer($util.base64.length(d.localIdentityKey)), 0); + else if (d.localIdentityKey.length >= 0) + m.localIdentityKey = d.localIdentityKey; + } + if (d.localIdentityKeyPrivate != null) { + if (typeof d.localIdentityKeyPrivate === "string") + $util.base64.decode(d.localIdentityKeyPrivate, m.localIdentityKeyPrivate = $util.newBuffer($util.base64.length(d.localIdentityKeyPrivate)), 0); + else if (d.localIdentityKeyPrivate.length >= 0) + m.localIdentityKeyPrivate = d.localIdentityKeyPrivate; + } + return m; + }; + + PendingKeyExchange.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.sequence != null && m.hasOwnProperty("sequence")) { + d.sequence = m.sequence; + if (o.oneofs) + d._sequence = "sequence"; + } + if (m.localBaseKey != null && m.hasOwnProperty("localBaseKey")) { + d.localBaseKey = o.bytes === String ? $util.base64.encode(m.localBaseKey, 0, m.localBaseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localBaseKey) : m.localBaseKey; + if (o.oneofs) + d._localBaseKey = "localBaseKey"; + } + if (m.localBaseKeyPrivate != null && m.hasOwnProperty("localBaseKeyPrivate")) { + d.localBaseKeyPrivate = o.bytes === String ? $util.base64.encode(m.localBaseKeyPrivate, 0, m.localBaseKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localBaseKeyPrivate) : m.localBaseKeyPrivate; + if (o.oneofs) + d._localBaseKeyPrivate = "localBaseKeyPrivate"; + } + if (m.localRatchetKey != null && m.hasOwnProperty("localRatchetKey")) { + d.localRatchetKey = o.bytes === String ? $util.base64.encode(m.localRatchetKey, 0, m.localRatchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localRatchetKey) : m.localRatchetKey; + if (o.oneofs) + d._localRatchetKey = "localRatchetKey"; + } + if (m.localRatchetKeyPrivate != null && m.hasOwnProperty("localRatchetKeyPrivate")) { + d.localRatchetKeyPrivate = o.bytes === String ? $util.base64.encode(m.localRatchetKeyPrivate, 0, m.localRatchetKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localRatchetKeyPrivate) : m.localRatchetKeyPrivate; + if (o.oneofs) + d._localRatchetKeyPrivate = "localRatchetKeyPrivate"; + } + if (m.localIdentityKey != null && m.hasOwnProperty("localIdentityKey")) { + d.localIdentityKey = o.bytes === String ? $util.base64.encode(m.localIdentityKey, 0, m.localIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityKey) : m.localIdentityKey; + if (o.oneofs) + d._localIdentityKey = "localIdentityKey"; + } + if (m.localIdentityKeyPrivate != null && m.hasOwnProperty("localIdentityKeyPrivate")) { + d.localIdentityKeyPrivate = o.bytes === String ? $util.base64.encode(m.localIdentityKeyPrivate, 0, m.localIdentityKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityKeyPrivate) : m.localIdentityKeyPrivate; + if (o.oneofs) + d._localIdentityKeyPrivate = "localIdentityKeyPrivate"; + } + return d; + }; + + PendingKeyExchange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PendingKeyExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29793,9 +67064,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PendingPreKey.prototype.preKeyId = 0; - PendingPreKey.prototype.signedPreKeyId = 0; - PendingPreKey.prototype.baseKey = $util.newBuffer([]); + PendingPreKey.prototype.preKeyId = null; + PendingPreKey.prototype.signedPreKeyId = null; + PendingPreKey.prototype.baseKey = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingPreKey.prototype, "_preKeyId", { + get: $util.oneOfGetter($oneOfFields = ["preKeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingPreKey.prototype, "_signedPreKeyId", { + get: $util.oneOfGetter($oneOfFields = ["signedPreKeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingPreKey.prototype, "_baseKey", { + get: $util.oneOfGetter($oneOfFields = ["baseKey"]), + set: $util.oneOfSetter($oneOfFields) + }); PendingPreKey.create = function create(properties) { return new PendingPreKey(properties); @@ -29842,6 +67133,51 @@ export const proto = $root.proto = (() => { return m; }; + PendingPreKey.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SessionStructure.PendingPreKey) + return d; + var m = new $root.proto.SessionStructure.PendingPreKey(); + if (d.preKeyId != null) { + m.preKeyId = d.preKeyId >>> 0; + } + if (d.signedPreKeyId != null) { + m.signedPreKeyId = d.signedPreKeyId | 0; + } + if (d.baseKey != null) { + if (typeof d.baseKey === "string") + $util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0); + else if (d.baseKey.length >= 0) + m.baseKey = d.baseKey; + } + return m; + }; + + PendingPreKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.preKeyId != null && m.hasOwnProperty("preKeyId")) { + d.preKeyId = m.preKeyId; + if (o.oneofs) + d._preKeyId = "preKeyId"; + } + if (m.baseKey != null && m.hasOwnProperty("baseKey")) { + d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey; + if (o.oneofs) + d._baseKey = "baseKey"; + } + if (m.signedPreKeyId != null && m.hasOwnProperty("signedPreKeyId")) { + d.signedPreKeyId = m.signedPreKeyId; + if (o.oneofs) + d._signedPreKeyId = "signedPreKeyId"; + } + return d; + }; + + PendingPreKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PendingPreKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29864,10 +67200,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SignalMessage.prototype.ratchetKey = $util.newBuffer([]); - SignalMessage.prototype.counter = 0; - SignalMessage.prototype.previousCounter = 0; - SignalMessage.prototype.ciphertext = $util.newBuffer([]); + SignalMessage.prototype.ratchetKey = null; + SignalMessage.prototype.counter = null; + SignalMessage.prototype.previousCounter = null; + SignalMessage.prototype.ciphertext = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignalMessage.prototype, "_ratchetKey", { + get: $util.oneOfGetter($oneOfFields = ["ratchetKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignalMessage.prototype, "_counter", { + get: $util.oneOfGetter($oneOfFields = ["counter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignalMessage.prototype, "_previousCounter", { + get: $util.oneOfGetter($oneOfFields = ["previousCounter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignalMessage.prototype, "_ciphertext", { + get: $util.oneOfGetter($oneOfFields = ["ciphertext"]), + set: $util.oneOfSetter($oneOfFields) + }); SignalMessage.create = function create(properties) { return new SignalMessage(properties); @@ -29920,6 +67282,62 @@ export const proto = $root.proto = (() => { return m; }; + SignalMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SignalMessage) + return d; + var m = new $root.proto.SignalMessage(); + if (d.ratchetKey != null) { + if (typeof d.ratchetKey === "string") + $util.base64.decode(d.ratchetKey, m.ratchetKey = $util.newBuffer($util.base64.length(d.ratchetKey)), 0); + else if (d.ratchetKey.length >= 0) + m.ratchetKey = d.ratchetKey; + } + if (d.counter != null) { + m.counter = d.counter >>> 0; + } + if (d.previousCounter != null) { + m.previousCounter = d.previousCounter >>> 0; + } + if (d.ciphertext != null) { + if (typeof d.ciphertext === "string") + $util.base64.decode(d.ciphertext, m.ciphertext = $util.newBuffer($util.base64.length(d.ciphertext)), 0); + else if (d.ciphertext.length >= 0) + m.ciphertext = d.ciphertext; + } + return m; + }; + + SignalMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.ratchetKey != null && m.hasOwnProperty("ratchetKey")) { + d.ratchetKey = o.bytes === String ? $util.base64.encode(m.ratchetKey, 0, m.ratchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.ratchetKey) : m.ratchetKey; + if (o.oneofs) + d._ratchetKey = "ratchetKey"; + } + if (m.counter != null && m.hasOwnProperty("counter")) { + d.counter = m.counter; + if (o.oneofs) + d._counter = "counter"; + } + if (m.previousCounter != null && m.hasOwnProperty("previousCounter")) { + d.previousCounter = m.previousCounter; + if (o.oneofs) + d._previousCounter = "previousCounter"; + } + if (m.ciphertext != null && m.hasOwnProperty("ciphertext")) { + d.ciphertext = o.bytes === String ? $util.base64.encode(m.ciphertext, 0, m.ciphertext.length) : o.bytes === Array ? Array.prototype.slice.call(m.ciphertext) : m.ciphertext; + if (o.oneofs) + d._ciphertext = "ciphertext"; + } + return d; + }; + + SignalMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SignalMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -29939,11 +67357,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SignedPreKeyRecordStructure.prototype.id = 0; - SignedPreKeyRecordStructure.prototype.publicKey = $util.newBuffer([]); - SignedPreKeyRecordStructure.prototype.privateKey = $util.newBuffer([]); - SignedPreKeyRecordStructure.prototype.signature = $util.newBuffer([]); - SignedPreKeyRecordStructure.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SignedPreKeyRecordStructure.prototype.id = null; + SignedPreKeyRecordStructure.prototype.publicKey = null; + SignedPreKeyRecordStructure.prototype.privateKey = null; + SignedPreKeyRecordStructure.prototype.signature = null; + SignedPreKeyRecordStructure.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_publicKey", { + get: $util.oneOfGetter($oneOfFields = ["publicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_privateKey", { + get: $util.oneOfGetter($oneOfFields = ["privateKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_signature", { + get: $util.oneOfGetter($oneOfFields = ["signature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); SignedPreKeyRecordStructure.create = function create(properties) { return new SignedPreKeyRecordStructure(properties); @@ -30002,6 +67452,83 @@ export const proto = $root.proto = (() => { return m; }; + SignedPreKeyRecordStructure.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SignedPreKeyRecordStructure) + return d; + var m = new $root.proto.SignedPreKeyRecordStructure(); + if (d.id != null) { + m.id = d.id >>> 0; + } + if (d.publicKey != null) { + if (typeof d.publicKey === "string") + $util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0); + else if (d.publicKey.length >= 0) + m.publicKey = d.publicKey; + } + if (d.privateKey != null) { + if (typeof d.privateKey === "string") + $util.base64.decode(d.privateKey, m.privateKey = $util.newBuffer($util.base64.length(d.privateKey)), 0); + else if (d.privateKey.length >= 0) + m.privateKey = d.privateKey; + } + if (d.signature != null) { + if (typeof d.signature === "string") + $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0); + else if (d.signature.length >= 0) + m.signature = d.signature; + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + SignedPreKeyRecordStructure.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + if (m.publicKey != null && m.hasOwnProperty("publicKey")) { + d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey; + if (o.oneofs) + d._publicKey = "publicKey"; + } + if (m.privateKey != null && m.hasOwnProperty("privateKey")) { + d.privateKey = o.bytes === String ? $util.base64.encode(m.privateKey, 0, m.privateKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privateKey) : m.privateKey; + if (o.oneofs) + d._privateKey = "privateKey"; + } + if (m.signature != null && m.hasOwnProperty("signature")) { + d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature; + if (o.oneofs) + d._signature = "signature"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + SignedPreKeyRecordStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SignedPreKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30023,6 +67550,14 @@ export const proto = $root.proto = (() => { StatusMentionMessage.prototype.quotedStatus = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StatusMentionMessage.prototype, "_quotedStatus", { + get: $util.oneOfGetter($oneOfFields = ["quotedStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + StatusMentionMessage.create = function create(properties) { return new StatusMentionMessage(properties); }; @@ -30056,6 +67591,34 @@ export const proto = $root.proto = (() => { return m; }; + StatusMentionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.StatusMentionMessage) + return d; + var m = new $root.proto.StatusMentionMessage(); + if (d.quotedStatus != null) { + if (typeof d.quotedStatus !== "object") + throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected"); + m.quotedStatus = $root.proto.Message.fromObject(d.quotedStatus); + } + return m; + }; + + StatusMentionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.quotedStatus != null && m.hasOwnProperty("quotedStatus")) { + d.quotedStatus = $root.proto.Message.toObject(m.quotedStatus, o); + if (o.oneofs) + d._quotedStatus = "quotedStatus"; + } + return d; + }; + + StatusMentionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StatusMentionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30076,7 +67639,15 @@ export const proto = $root.proto = (() => { } StatusPSA.prototype.campaignId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - StatusPSA.prototype.campaignExpirationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + StatusPSA.prototype.campaignExpirationTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StatusPSA.prototype, "_campaignExpirationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["campaignExpirationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); StatusPSA.create = function create(properties) { return new StatusPSA(properties); @@ -30085,7 +67656,8 @@ export const proto = $root.proto = (() => { StatusPSA.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(352).uint64(m.campaignId); + if (m.campaignId != null && Object.hasOwnProperty.call(m, "campaignId")) + w.uint32(352).uint64(m.campaignId); if (m.campaignExpirationTimestamp != null && Object.hasOwnProperty.call(m, "campaignExpirationTimestamp")) w.uint32(360).uint64(m.campaignExpirationTimestamp); return w; @@ -30113,11 +67685,68 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("campaignId")) - throw $util.ProtocolError("missing required 'campaignId'", { instance: m }); return m; }; + StatusPSA.fromObject = function fromObject(d) { + if (d instanceof $root.proto.StatusPSA) + return d; + var m = new $root.proto.StatusPSA(); + if (d.campaignId != null) { + if ($util.Long) + (m.campaignId = $util.Long.fromValue(d.campaignId)).unsigned = true; + else if (typeof d.campaignId === "string") + m.campaignId = parseInt(d.campaignId, 10); + else if (typeof d.campaignId === "number") + m.campaignId = d.campaignId; + else if (typeof d.campaignId === "object") + m.campaignId = new $util.LongBits(d.campaignId.low >>> 0, d.campaignId.high >>> 0).toNumber(true); + } + if (d.campaignExpirationTimestamp != null) { + if ($util.Long) + (m.campaignExpirationTimestamp = $util.Long.fromValue(d.campaignExpirationTimestamp)).unsigned = true; + else if (typeof d.campaignExpirationTimestamp === "string") + m.campaignExpirationTimestamp = parseInt(d.campaignExpirationTimestamp, 10); + else if (typeof d.campaignExpirationTimestamp === "number") + m.campaignExpirationTimestamp = d.campaignExpirationTimestamp; + else if (typeof d.campaignExpirationTimestamp === "object") + m.campaignExpirationTimestamp = new $util.LongBits(d.campaignExpirationTimestamp.low >>> 0, d.campaignExpirationTimestamp.high >>> 0).toNumber(true); + } + return m; + }; + + StatusPSA.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + if ($util.Long) { + var n = new $util.Long(0, 0, true); + d.campaignId = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.campaignId = o.longs === String ? "0" : 0; + } + if (m.campaignId != null && m.hasOwnProperty("campaignId")) { + if (typeof m.campaignId === "number") + d.campaignId = o.longs === String ? String(m.campaignId) : m.campaignId; + else + d.campaignId = o.longs === String ? $util.Long.prototype.toString.call(m.campaignId) : o.longs === Number ? new $util.LongBits(m.campaignId.low >>> 0, m.campaignId.high >>> 0).toNumber(true) : m.campaignId; + } + if (m.campaignExpirationTimestamp != null && m.hasOwnProperty("campaignExpirationTimestamp")) { + if (typeof m.campaignExpirationTimestamp === "number") + d.campaignExpirationTimestamp = o.longs === String ? String(m.campaignExpirationTimestamp) : m.campaignExpirationTimestamp; + else + d.campaignExpirationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.campaignExpirationTimestamp) : o.longs === Number ? new $util.LongBits(m.campaignExpirationTimestamp.low >>> 0, m.campaignExpirationTimestamp.high >>> 0).toNumber(true) : m.campaignExpirationTimestamp; + if (o.oneofs) + d._campaignExpirationTimestamp = "campaignExpirationTimestamp"; + } + return d; + }; + + StatusPSA.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StatusPSA.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30137,18 +67766,92 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - StickerMetadata.prototype.url = ""; - StickerMetadata.prototype.fileSha256 = $util.newBuffer([]); - StickerMetadata.prototype.fileEncSha256 = $util.newBuffer([]); - StickerMetadata.prototype.mediaKey = $util.newBuffer([]); - StickerMetadata.prototype.mimetype = ""; - StickerMetadata.prototype.height = 0; - StickerMetadata.prototype.width = 0; - StickerMetadata.prototype.directPath = ""; - StickerMetadata.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - StickerMetadata.prototype.weight = 0; - StickerMetadata.prototype.lastStickerSentTs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - StickerMetadata.prototype.isLottie = false; + StickerMetadata.prototype.url = null; + StickerMetadata.prototype.fileSha256 = null; + StickerMetadata.prototype.fileEncSha256 = null; + StickerMetadata.prototype.mediaKey = null; + StickerMetadata.prototype.mimetype = null; + StickerMetadata.prototype.height = null; + StickerMetadata.prototype.width = null; + StickerMetadata.prototype.directPath = null; + StickerMetadata.prototype.fileLength = null; + StickerMetadata.prototype.weight = null; + StickerMetadata.prototype.lastStickerSentTs = null; + StickerMetadata.prototype.isLottie = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_fileSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_weight", { + get: $util.oneOfGetter($oneOfFields = ["weight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_lastStickerSentTs", { + get: $util.oneOfGetter($oneOfFields = ["lastStickerSentTs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerMetadata.prototype, "_isLottie", { + get: $util.oneOfGetter($oneOfFields = ["isLottie"]), + set: $util.oneOfSetter($oneOfFields) + }); StickerMetadata.create = function create(properties) { return new StickerMetadata(properties); @@ -30249,6 +67952,149 @@ export const proto = $root.proto = (() => { return m; }; + StickerMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.StickerMetadata) + return d; + var m = new $root.proto.StickerMetadata(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.fileSha256 != null) { + if (typeof d.fileSha256 === "string") + $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0); + else if (d.fileSha256.length >= 0) + m.fileSha256 = d.fileSha256; + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.weight != null) { + m.weight = Number(d.weight); + } + if (d.lastStickerSentTs != null) { + if ($util.Long) + (m.lastStickerSentTs = $util.Long.fromValue(d.lastStickerSentTs)).unsigned = false; + else if (typeof d.lastStickerSentTs === "string") + m.lastStickerSentTs = parseInt(d.lastStickerSentTs, 10); + else if (typeof d.lastStickerSentTs === "number") + m.lastStickerSentTs = d.lastStickerSentTs; + else if (typeof d.lastStickerSentTs === "object") + m.lastStickerSentTs = new $util.LongBits(d.lastStickerSentTs.low >>> 0, d.lastStickerSentTs.high >>> 0).toNumber(); + } + if (d.isLottie != null) { + m.isLottie = Boolean(d.isLottie); + } + return m; + }; + + StickerMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) { + d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256; + if (o.oneofs) + d._fileSha256 = "fileSha256"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.weight != null && m.hasOwnProperty("weight")) { + d.weight = o.json && !isFinite(m.weight) ? String(m.weight) : m.weight; + if (o.oneofs) + d._weight = "weight"; + } + if (m.lastStickerSentTs != null && m.hasOwnProperty("lastStickerSentTs")) { + if (typeof m.lastStickerSentTs === "number") + d.lastStickerSentTs = o.longs === String ? String(m.lastStickerSentTs) : m.lastStickerSentTs; + else + d.lastStickerSentTs = o.longs === String ? $util.Long.prototype.toString.call(m.lastStickerSentTs) : o.longs === Number ? new $util.LongBits(m.lastStickerSentTs.low >>> 0, m.lastStickerSentTs.high >>> 0).toNumber() : m.lastStickerSentTs; + if (o.oneofs) + d._lastStickerSentTs = "lastStickerSentTs"; + } + if (m.isLottie != null && m.hasOwnProperty("isLottie")) { + d.isLottie = m.isLottie; + if (o.oneofs) + d._isLottie = "isLottie"; + } + return d; + }; + + StickerMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StickerMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30268,10 +68114,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncActionData.prototype.index = $util.newBuffer([]); + SyncActionData.prototype.index = null; SyncActionData.prototype.value = null; - SyncActionData.prototype.padding = $util.newBuffer([]); - SyncActionData.prototype.version = 0; + SyncActionData.prototype.padding = null; + SyncActionData.prototype.version = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionData.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionData.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionData.prototype, "_padding", { + get: $util.oneOfGetter($oneOfFields = ["padding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionData.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncActionData.create = function create(properties) { return new SyncActionData(properties); @@ -30324,6 +68196,64 @@ export const proto = $root.proto = (() => { return m; }; + SyncActionData.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionData) + return d; + var m = new $root.proto.SyncActionData(); + if (d.index != null) { + if (typeof d.index === "string") + $util.base64.decode(d.index, m.index = $util.newBuffer($util.base64.length(d.index)), 0); + else if (d.index.length >= 0) + m.index = d.index; + } + if (d.value != null) { + if (typeof d.value !== "object") + throw TypeError(".proto.SyncActionData.value: object expected"); + m.value = $root.proto.SyncActionValue.fromObject(d.value); + } + if (d.padding != null) { + if (typeof d.padding === "string") + $util.base64.decode(d.padding, m.padding = $util.newBuffer($util.base64.length(d.padding)), 0); + else if (d.padding.length >= 0) + m.padding = d.padding; + } + if (d.version != null) { + m.version = d.version | 0; + } + return m; + }; + + SyncActionData.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.index != null && m.hasOwnProperty("index")) { + d.index = o.bytes === String ? $util.base64.encode(m.index, 0, m.index.length) : o.bytes === Array ? Array.prototype.slice.call(m.index) : m.index; + if (o.oneofs) + d._index = "index"; + } + if (m.value != null && m.hasOwnProperty("value")) { + d.value = $root.proto.SyncActionValue.toObject(m.value, o); + if (o.oneofs) + d._value = "value"; + } + if (m.padding != null && m.hasOwnProperty("padding")) { + d.padding = o.bytes === String ? $util.base64.encode(m.padding, 0, m.padding.length) : o.bytes === Array ? Array.prototype.slice.call(m.padding) : m.padding; + if (o.oneofs) + d._padding = "padding"; + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = m.version; + if (o.oneofs) + d._version = "version"; + } + return d; + }; + + SyncActionData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncActionData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30343,7 +68273,7 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncActionValue.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SyncActionValue.prototype.timestamp = null; SyncActionValue.prototype.starAction = null; SyncActionValue.prototype.contactAction = null; SyncActionValue.prototype.muteAction = null; @@ -30401,6 +68331,350 @@ export const proto = $root.proto = (() => { SyncActionValue.prototype.ctwaPerCustomerDataSharingAction = null; SyncActionValue.prototype.paymentTosAction = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_starAction", { + get: $util.oneOfGetter($oneOfFields = ["starAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_contactAction", { + get: $util.oneOfGetter($oneOfFields = ["contactAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_muteAction", { + get: $util.oneOfGetter($oneOfFields = ["muteAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_pinAction", { + get: $util.oneOfGetter($oneOfFields = ["pinAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_securityNotificationSetting", { + get: $util.oneOfGetter($oneOfFields = ["securityNotificationSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_pushNameSetting", { + get: $util.oneOfGetter($oneOfFields = ["pushNameSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_quickReplyAction", { + get: $util.oneOfGetter($oneOfFields = ["quickReplyAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_recentEmojiWeightsAction", { + get: $util.oneOfGetter($oneOfFields = ["recentEmojiWeightsAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_labelEditAction", { + get: $util.oneOfGetter($oneOfFields = ["labelEditAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_labelAssociationAction", { + get: $util.oneOfGetter($oneOfFields = ["labelAssociationAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_localeSetting", { + get: $util.oneOfGetter($oneOfFields = ["localeSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_archiveChatAction", { + get: $util.oneOfGetter($oneOfFields = ["archiveChatAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_deleteMessageForMeAction", { + get: $util.oneOfGetter($oneOfFields = ["deleteMessageForMeAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_keyExpiration", { + get: $util.oneOfGetter($oneOfFields = ["keyExpiration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_markChatAsReadAction", { + get: $util.oneOfGetter($oneOfFields = ["markChatAsReadAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_clearChatAction", { + get: $util.oneOfGetter($oneOfFields = ["clearChatAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_deleteChatAction", { + get: $util.oneOfGetter($oneOfFields = ["deleteChatAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_unarchiveChatsSetting", { + get: $util.oneOfGetter($oneOfFields = ["unarchiveChatsSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_primaryFeature", { + get: $util.oneOfGetter($oneOfFields = ["primaryFeature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_androidUnsupportedActions", { + get: $util.oneOfGetter($oneOfFields = ["androidUnsupportedActions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_agentAction", { + get: $util.oneOfGetter($oneOfFields = ["agentAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_subscriptionAction", { + get: $util.oneOfGetter($oneOfFields = ["subscriptionAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_userStatusMuteAction", { + get: $util.oneOfGetter($oneOfFields = ["userStatusMuteAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_timeFormatAction", { + get: $util.oneOfGetter($oneOfFields = ["timeFormatAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_nuxAction", { + get: $util.oneOfGetter($oneOfFields = ["nuxAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_primaryVersionAction", { + get: $util.oneOfGetter($oneOfFields = ["primaryVersionAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_stickerAction", { + get: $util.oneOfGetter($oneOfFields = ["stickerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_removeRecentStickerAction", { + get: $util.oneOfGetter($oneOfFields = ["removeRecentStickerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_chatAssignment", { + get: $util.oneOfGetter($oneOfFields = ["chatAssignment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_chatAssignmentOpenedStatus", { + get: $util.oneOfGetter($oneOfFields = ["chatAssignmentOpenedStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_pnForLidChatAction", { + get: $util.oneOfGetter($oneOfFields = ["pnForLidChatAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_marketingMessageAction", { + get: $util.oneOfGetter($oneOfFields = ["marketingMessageAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_marketingMessageBroadcastAction", { + get: $util.oneOfGetter($oneOfFields = ["marketingMessageBroadcastAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_externalWebBetaAction", { + get: $util.oneOfGetter($oneOfFields = ["externalWebBetaAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_privacySettingRelayAllCalls", { + get: $util.oneOfGetter($oneOfFields = ["privacySettingRelayAllCalls"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_callLogAction", { + get: $util.oneOfGetter($oneOfFields = ["callLogAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_statusPrivacy", { + get: $util.oneOfGetter($oneOfFields = ["statusPrivacy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_botWelcomeRequestAction", { + get: $util.oneOfGetter($oneOfFields = ["botWelcomeRequestAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_deleteIndividualCallLog", { + get: $util.oneOfGetter($oneOfFields = ["deleteIndividualCallLog"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_labelReorderingAction", { + get: $util.oneOfGetter($oneOfFields = ["labelReorderingAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_paymentInfoAction", { + get: $util.oneOfGetter($oneOfFields = ["paymentInfoAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_customPaymentMethodsAction", { + get: $util.oneOfGetter($oneOfFields = ["customPaymentMethodsAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_lockChatAction", { + get: $util.oneOfGetter($oneOfFields = ["lockChatAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_chatLockSettings", { + get: $util.oneOfGetter($oneOfFields = ["chatLockSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_wamoUserIdentifierAction", { + get: $util.oneOfGetter($oneOfFields = ["wamoUserIdentifierAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_privacySettingDisableLinkPreviewsAction", { + get: $util.oneOfGetter($oneOfFields = ["privacySettingDisableLinkPreviewsAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_deviceCapabilities", { + get: $util.oneOfGetter($oneOfFields = ["deviceCapabilities"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_noteEditAction", { + get: $util.oneOfGetter($oneOfFields = ["noteEditAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_favoritesAction", { + get: $util.oneOfGetter($oneOfFields = ["favoritesAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_merchantPaymentPartnerAction", { + get: $util.oneOfGetter($oneOfFields = ["merchantPaymentPartnerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_waffleAccountLinkStateAction", { + get: $util.oneOfGetter($oneOfFields = ["waffleAccountLinkStateAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_usernameChatStartMode", { + get: $util.oneOfGetter($oneOfFields = ["usernameChatStartMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_notificationActivitySettingAction", { + get: $util.oneOfGetter($oneOfFields = ["notificationActivitySettingAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_lidContactAction", { + get: $util.oneOfGetter($oneOfFields = ["lidContactAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_ctwaPerCustomerDataSharingAction", { + get: $util.oneOfGetter($oneOfFields = ["ctwaPerCustomerDataSharingAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionValue.prototype, "_paymentTosAction", { + get: $util.oneOfGetter($oneOfFields = ["paymentTosAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + SyncActionValue.create = function create(properties) { return new SyncActionValue(properties); }; @@ -30770,6 +69044,602 @@ export const proto = $root.proto = (() => { return m; }; + SyncActionValue.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue) + return d; + var m = new $root.proto.SyncActionValue(); + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + if (d.starAction != null) { + if (typeof d.starAction !== "object") + throw TypeError(".proto.SyncActionValue.starAction: object expected"); + m.starAction = $root.proto.SyncActionValue.StarAction.fromObject(d.starAction); + } + if (d.contactAction != null) { + if (typeof d.contactAction !== "object") + throw TypeError(".proto.SyncActionValue.contactAction: object expected"); + m.contactAction = $root.proto.SyncActionValue.ContactAction.fromObject(d.contactAction); + } + if (d.muteAction != null) { + if (typeof d.muteAction !== "object") + throw TypeError(".proto.SyncActionValue.muteAction: object expected"); + m.muteAction = $root.proto.SyncActionValue.MuteAction.fromObject(d.muteAction); + } + if (d.pinAction != null) { + if (typeof d.pinAction !== "object") + throw TypeError(".proto.SyncActionValue.pinAction: object expected"); + m.pinAction = $root.proto.SyncActionValue.PinAction.fromObject(d.pinAction); + } + if (d.securityNotificationSetting != null) { + if (typeof d.securityNotificationSetting !== "object") + throw TypeError(".proto.SyncActionValue.securityNotificationSetting: object expected"); + m.securityNotificationSetting = $root.proto.SyncActionValue.SecurityNotificationSetting.fromObject(d.securityNotificationSetting); + } + if (d.pushNameSetting != null) { + if (typeof d.pushNameSetting !== "object") + throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected"); + m.pushNameSetting = $root.proto.SyncActionValue.PushNameSetting.fromObject(d.pushNameSetting); + } + if (d.quickReplyAction != null) { + if (typeof d.quickReplyAction !== "object") + throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected"); + m.quickReplyAction = $root.proto.SyncActionValue.QuickReplyAction.fromObject(d.quickReplyAction); + } + if (d.recentEmojiWeightsAction != null) { + if (typeof d.recentEmojiWeightsAction !== "object") + throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected"); + m.recentEmojiWeightsAction = $root.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(d.recentEmojiWeightsAction); + } + if (d.labelEditAction != null) { + if (typeof d.labelEditAction !== "object") + throw TypeError(".proto.SyncActionValue.labelEditAction: object expected"); + m.labelEditAction = $root.proto.SyncActionValue.LabelEditAction.fromObject(d.labelEditAction); + } + if (d.labelAssociationAction != null) { + if (typeof d.labelAssociationAction !== "object") + throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected"); + m.labelAssociationAction = $root.proto.SyncActionValue.LabelAssociationAction.fromObject(d.labelAssociationAction); + } + if (d.localeSetting != null) { + if (typeof d.localeSetting !== "object") + throw TypeError(".proto.SyncActionValue.localeSetting: object expected"); + m.localeSetting = $root.proto.SyncActionValue.LocaleSetting.fromObject(d.localeSetting); + } + if (d.archiveChatAction != null) { + if (typeof d.archiveChatAction !== "object") + throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected"); + m.archiveChatAction = $root.proto.SyncActionValue.ArchiveChatAction.fromObject(d.archiveChatAction); + } + if (d.deleteMessageForMeAction != null) { + if (typeof d.deleteMessageForMeAction !== "object") + throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected"); + m.deleteMessageForMeAction = $root.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(d.deleteMessageForMeAction); + } + if (d.keyExpiration != null) { + if (typeof d.keyExpiration !== "object") + throw TypeError(".proto.SyncActionValue.keyExpiration: object expected"); + m.keyExpiration = $root.proto.SyncActionValue.KeyExpiration.fromObject(d.keyExpiration); + } + if (d.markChatAsReadAction != null) { + if (typeof d.markChatAsReadAction !== "object") + throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected"); + m.markChatAsReadAction = $root.proto.SyncActionValue.MarkChatAsReadAction.fromObject(d.markChatAsReadAction); + } + if (d.clearChatAction != null) { + if (typeof d.clearChatAction !== "object") + throw TypeError(".proto.SyncActionValue.clearChatAction: object expected"); + m.clearChatAction = $root.proto.SyncActionValue.ClearChatAction.fromObject(d.clearChatAction); + } + if (d.deleteChatAction != null) { + if (typeof d.deleteChatAction !== "object") + throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected"); + m.deleteChatAction = $root.proto.SyncActionValue.DeleteChatAction.fromObject(d.deleteChatAction); + } + if (d.unarchiveChatsSetting != null) { + if (typeof d.unarchiveChatsSetting !== "object") + throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected"); + m.unarchiveChatsSetting = $root.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(d.unarchiveChatsSetting); + } + if (d.primaryFeature != null) { + if (typeof d.primaryFeature !== "object") + throw TypeError(".proto.SyncActionValue.primaryFeature: object expected"); + m.primaryFeature = $root.proto.SyncActionValue.PrimaryFeature.fromObject(d.primaryFeature); + } + if (d.androidUnsupportedActions != null) { + if (typeof d.androidUnsupportedActions !== "object") + throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected"); + m.androidUnsupportedActions = $root.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(d.androidUnsupportedActions); + } + if (d.agentAction != null) { + if (typeof d.agentAction !== "object") + throw TypeError(".proto.SyncActionValue.agentAction: object expected"); + m.agentAction = $root.proto.SyncActionValue.AgentAction.fromObject(d.agentAction); + } + if (d.subscriptionAction != null) { + if (typeof d.subscriptionAction !== "object") + throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected"); + m.subscriptionAction = $root.proto.SyncActionValue.SubscriptionAction.fromObject(d.subscriptionAction); + } + if (d.userStatusMuteAction != null) { + if (typeof d.userStatusMuteAction !== "object") + throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected"); + m.userStatusMuteAction = $root.proto.SyncActionValue.UserStatusMuteAction.fromObject(d.userStatusMuteAction); + } + if (d.timeFormatAction != null) { + if (typeof d.timeFormatAction !== "object") + throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected"); + m.timeFormatAction = $root.proto.SyncActionValue.TimeFormatAction.fromObject(d.timeFormatAction); + } + if (d.nuxAction != null) { + if (typeof d.nuxAction !== "object") + throw TypeError(".proto.SyncActionValue.nuxAction: object expected"); + m.nuxAction = $root.proto.SyncActionValue.NuxAction.fromObject(d.nuxAction); + } + if (d.primaryVersionAction != null) { + if (typeof d.primaryVersionAction !== "object") + throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected"); + m.primaryVersionAction = $root.proto.SyncActionValue.PrimaryVersionAction.fromObject(d.primaryVersionAction); + } + if (d.stickerAction != null) { + if (typeof d.stickerAction !== "object") + throw TypeError(".proto.SyncActionValue.stickerAction: object expected"); + m.stickerAction = $root.proto.SyncActionValue.StickerAction.fromObject(d.stickerAction); + } + if (d.removeRecentStickerAction != null) { + if (typeof d.removeRecentStickerAction !== "object") + throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected"); + m.removeRecentStickerAction = $root.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(d.removeRecentStickerAction); + } + if (d.chatAssignment != null) { + if (typeof d.chatAssignment !== "object") + throw TypeError(".proto.SyncActionValue.chatAssignment: object expected"); + m.chatAssignment = $root.proto.SyncActionValue.ChatAssignmentAction.fromObject(d.chatAssignment); + } + if (d.chatAssignmentOpenedStatus != null) { + if (typeof d.chatAssignmentOpenedStatus !== "object") + throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected"); + m.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(d.chatAssignmentOpenedStatus); + } + if (d.pnForLidChatAction != null) { + if (typeof d.pnForLidChatAction !== "object") + throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected"); + m.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.fromObject(d.pnForLidChatAction); + } + if (d.marketingMessageAction != null) { + if (typeof d.marketingMessageAction !== "object") + throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected"); + m.marketingMessageAction = $root.proto.SyncActionValue.MarketingMessageAction.fromObject(d.marketingMessageAction); + } + if (d.marketingMessageBroadcastAction != null) { + if (typeof d.marketingMessageBroadcastAction !== "object") + throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected"); + m.marketingMessageBroadcastAction = $root.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(d.marketingMessageBroadcastAction); + } + if (d.externalWebBetaAction != null) { + if (typeof d.externalWebBetaAction !== "object") + throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected"); + m.externalWebBetaAction = $root.proto.SyncActionValue.ExternalWebBetaAction.fromObject(d.externalWebBetaAction); + } + if (d.privacySettingRelayAllCalls != null) { + if (typeof d.privacySettingRelayAllCalls !== "object") + throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected"); + m.privacySettingRelayAllCalls = $root.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(d.privacySettingRelayAllCalls); + } + if (d.callLogAction != null) { + if (typeof d.callLogAction !== "object") + throw TypeError(".proto.SyncActionValue.callLogAction: object expected"); + m.callLogAction = $root.proto.SyncActionValue.CallLogAction.fromObject(d.callLogAction); + } + if (d.statusPrivacy != null) { + if (typeof d.statusPrivacy !== "object") + throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected"); + m.statusPrivacy = $root.proto.SyncActionValue.StatusPrivacyAction.fromObject(d.statusPrivacy); + } + if (d.botWelcomeRequestAction != null) { + if (typeof d.botWelcomeRequestAction !== "object") + throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected"); + m.botWelcomeRequestAction = $root.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(d.botWelcomeRequestAction); + } + if (d.deleteIndividualCallLog != null) { + if (typeof d.deleteIndividualCallLog !== "object") + throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected"); + m.deleteIndividualCallLog = $root.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(d.deleteIndividualCallLog); + } + if (d.labelReorderingAction != null) { + if (typeof d.labelReorderingAction !== "object") + throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected"); + m.labelReorderingAction = $root.proto.SyncActionValue.LabelReorderingAction.fromObject(d.labelReorderingAction); + } + if (d.paymentInfoAction != null) { + if (typeof d.paymentInfoAction !== "object") + throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected"); + m.paymentInfoAction = $root.proto.SyncActionValue.PaymentInfoAction.fromObject(d.paymentInfoAction); + } + if (d.customPaymentMethodsAction != null) { + if (typeof d.customPaymentMethodsAction !== "object") + throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected"); + m.customPaymentMethodsAction = $root.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(d.customPaymentMethodsAction); + } + if (d.lockChatAction != null) { + if (typeof d.lockChatAction !== "object") + throw TypeError(".proto.SyncActionValue.lockChatAction: object expected"); + m.lockChatAction = $root.proto.SyncActionValue.LockChatAction.fromObject(d.lockChatAction); + } + if (d.chatLockSettings != null) { + if (typeof d.chatLockSettings !== "object") + throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected"); + m.chatLockSettings = $root.proto.ChatLockSettings.fromObject(d.chatLockSettings); + } + if (d.wamoUserIdentifierAction != null) { + if (typeof d.wamoUserIdentifierAction !== "object") + throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected"); + m.wamoUserIdentifierAction = $root.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(d.wamoUserIdentifierAction); + } + if (d.privacySettingDisableLinkPreviewsAction != null) { + if (typeof d.privacySettingDisableLinkPreviewsAction !== "object") + throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected"); + m.privacySettingDisableLinkPreviewsAction = $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(d.privacySettingDisableLinkPreviewsAction); + } + if (d.deviceCapabilities != null) { + if (typeof d.deviceCapabilities !== "object") + throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected"); + m.deviceCapabilities = $root.proto.DeviceCapabilities.fromObject(d.deviceCapabilities); + } + if (d.noteEditAction != null) { + if (typeof d.noteEditAction !== "object") + throw TypeError(".proto.SyncActionValue.noteEditAction: object expected"); + m.noteEditAction = $root.proto.SyncActionValue.NoteEditAction.fromObject(d.noteEditAction); + } + if (d.favoritesAction != null) { + if (typeof d.favoritesAction !== "object") + throw TypeError(".proto.SyncActionValue.favoritesAction: object expected"); + m.favoritesAction = $root.proto.SyncActionValue.FavoritesAction.fromObject(d.favoritesAction); + } + if (d.merchantPaymentPartnerAction != null) { + if (typeof d.merchantPaymentPartnerAction !== "object") + throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected"); + m.merchantPaymentPartnerAction = $root.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(d.merchantPaymentPartnerAction); + } + if (d.waffleAccountLinkStateAction != null) { + if (typeof d.waffleAccountLinkStateAction !== "object") + throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected"); + m.waffleAccountLinkStateAction = $root.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(d.waffleAccountLinkStateAction); + } + if (d.usernameChatStartMode != null) { + if (typeof d.usernameChatStartMode !== "object") + throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected"); + m.usernameChatStartMode = $root.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(d.usernameChatStartMode); + } + if (d.notificationActivitySettingAction != null) { + if (typeof d.notificationActivitySettingAction !== "object") + throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected"); + m.notificationActivitySettingAction = $root.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(d.notificationActivitySettingAction); + } + if (d.lidContactAction != null) { + if (typeof d.lidContactAction !== "object") + throw TypeError(".proto.SyncActionValue.lidContactAction: object expected"); + m.lidContactAction = $root.proto.SyncActionValue.LidContactAction.fromObject(d.lidContactAction); + } + if (d.ctwaPerCustomerDataSharingAction != null) { + if (typeof d.ctwaPerCustomerDataSharingAction !== "object") + throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected"); + m.ctwaPerCustomerDataSharingAction = $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(d.ctwaPerCustomerDataSharingAction); + } + if (d.paymentTosAction != null) { + if (typeof d.paymentTosAction !== "object") + throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected"); + m.paymentTosAction = $root.proto.SyncActionValue.PaymentTosAction.fromObject(d.paymentTosAction); + } + return m; + }; + + SyncActionValue.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + if (m.starAction != null && m.hasOwnProperty("starAction")) { + d.starAction = $root.proto.SyncActionValue.StarAction.toObject(m.starAction, o); + if (o.oneofs) + d._starAction = "starAction"; + } + if (m.contactAction != null && m.hasOwnProperty("contactAction")) { + d.contactAction = $root.proto.SyncActionValue.ContactAction.toObject(m.contactAction, o); + if (o.oneofs) + d._contactAction = "contactAction"; + } + if (m.muteAction != null && m.hasOwnProperty("muteAction")) { + d.muteAction = $root.proto.SyncActionValue.MuteAction.toObject(m.muteAction, o); + if (o.oneofs) + d._muteAction = "muteAction"; + } + if (m.pinAction != null && m.hasOwnProperty("pinAction")) { + d.pinAction = $root.proto.SyncActionValue.PinAction.toObject(m.pinAction, o); + if (o.oneofs) + d._pinAction = "pinAction"; + } + if (m.securityNotificationSetting != null && m.hasOwnProperty("securityNotificationSetting")) { + d.securityNotificationSetting = $root.proto.SyncActionValue.SecurityNotificationSetting.toObject(m.securityNotificationSetting, o); + if (o.oneofs) + d._securityNotificationSetting = "securityNotificationSetting"; + } + if (m.pushNameSetting != null && m.hasOwnProperty("pushNameSetting")) { + d.pushNameSetting = $root.proto.SyncActionValue.PushNameSetting.toObject(m.pushNameSetting, o); + if (o.oneofs) + d._pushNameSetting = "pushNameSetting"; + } + if (m.quickReplyAction != null && m.hasOwnProperty("quickReplyAction")) { + d.quickReplyAction = $root.proto.SyncActionValue.QuickReplyAction.toObject(m.quickReplyAction, o); + if (o.oneofs) + d._quickReplyAction = "quickReplyAction"; + } + if (m.recentEmojiWeightsAction != null && m.hasOwnProperty("recentEmojiWeightsAction")) { + d.recentEmojiWeightsAction = $root.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(m.recentEmojiWeightsAction, o); + if (o.oneofs) + d._recentEmojiWeightsAction = "recentEmojiWeightsAction"; + } + if (m.labelEditAction != null && m.hasOwnProperty("labelEditAction")) { + d.labelEditAction = $root.proto.SyncActionValue.LabelEditAction.toObject(m.labelEditAction, o); + if (o.oneofs) + d._labelEditAction = "labelEditAction"; + } + if (m.labelAssociationAction != null && m.hasOwnProperty("labelAssociationAction")) { + d.labelAssociationAction = $root.proto.SyncActionValue.LabelAssociationAction.toObject(m.labelAssociationAction, o); + if (o.oneofs) + d._labelAssociationAction = "labelAssociationAction"; + } + if (m.localeSetting != null && m.hasOwnProperty("localeSetting")) { + d.localeSetting = $root.proto.SyncActionValue.LocaleSetting.toObject(m.localeSetting, o); + if (o.oneofs) + d._localeSetting = "localeSetting"; + } + if (m.archiveChatAction != null && m.hasOwnProperty("archiveChatAction")) { + d.archiveChatAction = $root.proto.SyncActionValue.ArchiveChatAction.toObject(m.archiveChatAction, o); + if (o.oneofs) + d._archiveChatAction = "archiveChatAction"; + } + if (m.deleteMessageForMeAction != null && m.hasOwnProperty("deleteMessageForMeAction")) { + d.deleteMessageForMeAction = $root.proto.SyncActionValue.DeleteMessageForMeAction.toObject(m.deleteMessageForMeAction, o); + if (o.oneofs) + d._deleteMessageForMeAction = "deleteMessageForMeAction"; + } + if (m.keyExpiration != null && m.hasOwnProperty("keyExpiration")) { + d.keyExpiration = $root.proto.SyncActionValue.KeyExpiration.toObject(m.keyExpiration, o); + if (o.oneofs) + d._keyExpiration = "keyExpiration"; + } + if (m.markChatAsReadAction != null && m.hasOwnProperty("markChatAsReadAction")) { + d.markChatAsReadAction = $root.proto.SyncActionValue.MarkChatAsReadAction.toObject(m.markChatAsReadAction, o); + if (o.oneofs) + d._markChatAsReadAction = "markChatAsReadAction"; + } + if (m.clearChatAction != null && m.hasOwnProperty("clearChatAction")) { + d.clearChatAction = $root.proto.SyncActionValue.ClearChatAction.toObject(m.clearChatAction, o); + if (o.oneofs) + d._clearChatAction = "clearChatAction"; + } + if (m.deleteChatAction != null && m.hasOwnProperty("deleteChatAction")) { + d.deleteChatAction = $root.proto.SyncActionValue.DeleteChatAction.toObject(m.deleteChatAction, o); + if (o.oneofs) + d._deleteChatAction = "deleteChatAction"; + } + if (m.unarchiveChatsSetting != null && m.hasOwnProperty("unarchiveChatsSetting")) { + d.unarchiveChatsSetting = $root.proto.SyncActionValue.UnarchiveChatsSetting.toObject(m.unarchiveChatsSetting, o); + if (o.oneofs) + d._unarchiveChatsSetting = "unarchiveChatsSetting"; + } + if (m.primaryFeature != null && m.hasOwnProperty("primaryFeature")) { + d.primaryFeature = $root.proto.SyncActionValue.PrimaryFeature.toObject(m.primaryFeature, o); + if (o.oneofs) + d._primaryFeature = "primaryFeature"; + } + if (m.androidUnsupportedActions != null && m.hasOwnProperty("androidUnsupportedActions")) { + d.androidUnsupportedActions = $root.proto.SyncActionValue.AndroidUnsupportedActions.toObject(m.androidUnsupportedActions, o); + if (o.oneofs) + d._androidUnsupportedActions = "androidUnsupportedActions"; + } + if (m.agentAction != null && m.hasOwnProperty("agentAction")) { + d.agentAction = $root.proto.SyncActionValue.AgentAction.toObject(m.agentAction, o); + if (o.oneofs) + d._agentAction = "agentAction"; + } + if (m.subscriptionAction != null && m.hasOwnProperty("subscriptionAction")) { + d.subscriptionAction = $root.proto.SyncActionValue.SubscriptionAction.toObject(m.subscriptionAction, o); + if (o.oneofs) + d._subscriptionAction = "subscriptionAction"; + } + if (m.userStatusMuteAction != null && m.hasOwnProperty("userStatusMuteAction")) { + d.userStatusMuteAction = $root.proto.SyncActionValue.UserStatusMuteAction.toObject(m.userStatusMuteAction, o); + if (o.oneofs) + d._userStatusMuteAction = "userStatusMuteAction"; + } + if (m.timeFormatAction != null && m.hasOwnProperty("timeFormatAction")) { + d.timeFormatAction = $root.proto.SyncActionValue.TimeFormatAction.toObject(m.timeFormatAction, o); + if (o.oneofs) + d._timeFormatAction = "timeFormatAction"; + } + if (m.nuxAction != null && m.hasOwnProperty("nuxAction")) { + d.nuxAction = $root.proto.SyncActionValue.NuxAction.toObject(m.nuxAction, o); + if (o.oneofs) + d._nuxAction = "nuxAction"; + } + if (m.primaryVersionAction != null && m.hasOwnProperty("primaryVersionAction")) { + d.primaryVersionAction = $root.proto.SyncActionValue.PrimaryVersionAction.toObject(m.primaryVersionAction, o); + if (o.oneofs) + d._primaryVersionAction = "primaryVersionAction"; + } + if (m.stickerAction != null && m.hasOwnProperty("stickerAction")) { + d.stickerAction = $root.proto.SyncActionValue.StickerAction.toObject(m.stickerAction, o); + if (o.oneofs) + d._stickerAction = "stickerAction"; + } + if (m.removeRecentStickerAction != null && m.hasOwnProperty("removeRecentStickerAction")) { + d.removeRecentStickerAction = $root.proto.SyncActionValue.RemoveRecentStickerAction.toObject(m.removeRecentStickerAction, o); + if (o.oneofs) + d._removeRecentStickerAction = "removeRecentStickerAction"; + } + if (m.chatAssignment != null && m.hasOwnProperty("chatAssignment")) { + d.chatAssignment = $root.proto.SyncActionValue.ChatAssignmentAction.toObject(m.chatAssignment, o); + if (o.oneofs) + d._chatAssignment = "chatAssignment"; + } + if (m.chatAssignmentOpenedStatus != null && m.hasOwnProperty("chatAssignmentOpenedStatus")) { + d.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(m.chatAssignmentOpenedStatus, o); + if (o.oneofs) + d._chatAssignmentOpenedStatus = "chatAssignmentOpenedStatus"; + } + if (m.pnForLidChatAction != null && m.hasOwnProperty("pnForLidChatAction")) { + d.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.toObject(m.pnForLidChatAction, o); + if (o.oneofs) + d._pnForLidChatAction = "pnForLidChatAction"; + } + if (m.marketingMessageAction != null && m.hasOwnProperty("marketingMessageAction")) { + d.marketingMessageAction = $root.proto.SyncActionValue.MarketingMessageAction.toObject(m.marketingMessageAction, o); + if (o.oneofs) + d._marketingMessageAction = "marketingMessageAction"; + } + if (m.marketingMessageBroadcastAction != null && m.hasOwnProperty("marketingMessageBroadcastAction")) { + d.marketingMessageBroadcastAction = $root.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(m.marketingMessageBroadcastAction, o); + if (o.oneofs) + d._marketingMessageBroadcastAction = "marketingMessageBroadcastAction"; + } + if (m.externalWebBetaAction != null && m.hasOwnProperty("externalWebBetaAction")) { + d.externalWebBetaAction = $root.proto.SyncActionValue.ExternalWebBetaAction.toObject(m.externalWebBetaAction, o); + if (o.oneofs) + d._externalWebBetaAction = "externalWebBetaAction"; + } + if (m.privacySettingRelayAllCalls != null && m.hasOwnProperty("privacySettingRelayAllCalls")) { + d.privacySettingRelayAllCalls = $root.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(m.privacySettingRelayAllCalls, o); + if (o.oneofs) + d._privacySettingRelayAllCalls = "privacySettingRelayAllCalls"; + } + if (m.callLogAction != null && m.hasOwnProperty("callLogAction")) { + d.callLogAction = $root.proto.SyncActionValue.CallLogAction.toObject(m.callLogAction, o); + if (o.oneofs) + d._callLogAction = "callLogAction"; + } + if (m.statusPrivacy != null && m.hasOwnProperty("statusPrivacy")) { + d.statusPrivacy = $root.proto.SyncActionValue.StatusPrivacyAction.toObject(m.statusPrivacy, o); + if (o.oneofs) + d._statusPrivacy = "statusPrivacy"; + } + if (m.botWelcomeRequestAction != null && m.hasOwnProperty("botWelcomeRequestAction")) { + d.botWelcomeRequestAction = $root.proto.SyncActionValue.BotWelcomeRequestAction.toObject(m.botWelcomeRequestAction, o); + if (o.oneofs) + d._botWelcomeRequestAction = "botWelcomeRequestAction"; + } + if (m.deleteIndividualCallLog != null && m.hasOwnProperty("deleteIndividualCallLog")) { + d.deleteIndividualCallLog = $root.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(m.deleteIndividualCallLog, o); + if (o.oneofs) + d._deleteIndividualCallLog = "deleteIndividualCallLog"; + } + if (m.labelReorderingAction != null && m.hasOwnProperty("labelReorderingAction")) { + d.labelReorderingAction = $root.proto.SyncActionValue.LabelReorderingAction.toObject(m.labelReorderingAction, o); + if (o.oneofs) + d._labelReorderingAction = "labelReorderingAction"; + } + if (m.paymentInfoAction != null && m.hasOwnProperty("paymentInfoAction")) { + d.paymentInfoAction = $root.proto.SyncActionValue.PaymentInfoAction.toObject(m.paymentInfoAction, o); + if (o.oneofs) + d._paymentInfoAction = "paymentInfoAction"; + } + if (m.customPaymentMethodsAction != null && m.hasOwnProperty("customPaymentMethodsAction")) { + d.customPaymentMethodsAction = $root.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(m.customPaymentMethodsAction, o); + if (o.oneofs) + d._customPaymentMethodsAction = "customPaymentMethodsAction"; + } + if (m.lockChatAction != null && m.hasOwnProperty("lockChatAction")) { + d.lockChatAction = $root.proto.SyncActionValue.LockChatAction.toObject(m.lockChatAction, o); + if (o.oneofs) + d._lockChatAction = "lockChatAction"; + } + if (m.chatLockSettings != null && m.hasOwnProperty("chatLockSettings")) { + d.chatLockSettings = $root.proto.ChatLockSettings.toObject(m.chatLockSettings, o); + if (o.oneofs) + d._chatLockSettings = "chatLockSettings"; + } + if (m.wamoUserIdentifierAction != null && m.hasOwnProperty("wamoUserIdentifierAction")) { + d.wamoUserIdentifierAction = $root.proto.SyncActionValue.WamoUserIdentifierAction.toObject(m.wamoUserIdentifierAction, o); + if (o.oneofs) + d._wamoUserIdentifierAction = "wamoUserIdentifierAction"; + } + if (m.privacySettingDisableLinkPreviewsAction != null && m.hasOwnProperty("privacySettingDisableLinkPreviewsAction")) { + d.privacySettingDisableLinkPreviewsAction = $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(m.privacySettingDisableLinkPreviewsAction, o); + if (o.oneofs) + d._privacySettingDisableLinkPreviewsAction = "privacySettingDisableLinkPreviewsAction"; + } + if (m.deviceCapabilities != null && m.hasOwnProperty("deviceCapabilities")) { + d.deviceCapabilities = $root.proto.DeviceCapabilities.toObject(m.deviceCapabilities, o); + if (o.oneofs) + d._deviceCapabilities = "deviceCapabilities"; + } + if (m.noteEditAction != null && m.hasOwnProperty("noteEditAction")) { + d.noteEditAction = $root.proto.SyncActionValue.NoteEditAction.toObject(m.noteEditAction, o); + if (o.oneofs) + d._noteEditAction = "noteEditAction"; + } + if (m.favoritesAction != null && m.hasOwnProperty("favoritesAction")) { + d.favoritesAction = $root.proto.SyncActionValue.FavoritesAction.toObject(m.favoritesAction, o); + if (o.oneofs) + d._favoritesAction = "favoritesAction"; + } + if (m.merchantPaymentPartnerAction != null && m.hasOwnProperty("merchantPaymentPartnerAction")) { + d.merchantPaymentPartnerAction = $root.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(m.merchantPaymentPartnerAction, o); + if (o.oneofs) + d._merchantPaymentPartnerAction = "merchantPaymentPartnerAction"; + } + if (m.waffleAccountLinkStateAction != null && m.hasOwnProperty("waffleAccountLinkStateAction")) { + d.waffleAccountLinkStateAction = $root.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(m.waffleAccountLinkStateAction, o); + if (o.oneofs) + d._waffleAccountLinkStateAction = "waffleAccountLinkStateAction"; + } + if (m.usernameChatStartMode != null && m.hasOwnProperty("usernameChatStartMode")) { + d.usernameChatStartMode = $root.proto.SyncActionValue.UsernameChatStartModeAction.toObject(m.usernameChatStartMode, o); + if (o.oneofs) + d._usernameChatStartMode = "usernameChatStartMode"; + } + if (m.notificationActivitySettingAction != null && m.hasOwnProperty("notificationActivitySettingAction")) { + d.notificationActivitySettingAction = $root.proto.SyncActionValue.NotificationActivitySettingAction.toObject(m.notificationActivitySettingAction, o); + if (o.oneofs) + d._notificationActivitySettingAction = "notificationActivitySettingAction"; + } + if (m.lidContactAction != null && m.hasOwnProperty("lidContactAction")) { + d.lidContactAction = $root.proto.SyncActionValue.LidContactAction.toObject(m.lidContactAction, o); + if (o.oneofs) + d._lidContactAction = "lidContactAction"; + } + if (m.ctwaPerCustomerDataSharingAction != null && m.hasOwnProperty("ctwaPerCustomerDataSharingAction")) { + d.ctwaPerCustomerDataSharingAction = $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(m.ctwaPerCustomerDataSharingAction, o); + if (o.oneofs) + d._ctwaPerCustomerDataSharingAction = "ctwaPerCustomerDataSharingAction"; + } + if (m.paymentTosAction != null && m.hasOwnProperty("paymentTosAction")) { + d.paymentTosAction = $root.proto.SyncActionValue.PaymentTosAction.toObject(m.paymentTosAction, o); + if (o.oneofs) + d._paymentTosAction = "paymentTosAction"; + } + return d; + }; + + SyncActionValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncActionValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30786,9 +69656,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AgentAction.prototype.name = ""; - AgentAction.prototype.deviceID = 0; - AgentAction.prototype.isDeleted = false; + AgentAction.prototype.name = null; + AgentAction.prototype.deviceID = null; + AgentAction.prototype.isDeleted = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AgentAction.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AgentAction.prototype, "_deviceID", { + get: $util.oneOfGetter($oneOfFields = ["deviceID"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AgentAction.prototype, "_isDeleted", { + get: $util.oneOfGetter($oneOfFields = ["isDeleted"]), + set: $util.oneOfSetter($oneOfFields) + }); AgentAction.create = function create(properties) { return new AgentAction(properties); @@ -30835,6 +69725,48 @@ export const proto = $root.proto = (() => { return m; }; + AgentAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.AgentAction) + return d; + var m = new $root.proto.SyncActionValue.AgentAction(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.deviceID != null) { + m.deviceID = d.deviceID | 0; + } + if (d.isDeleted != null) { + m.isDeleted = Boolean(d.isDeleted); + } + return m; + }; + + AgentAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.deviceID != null && m.hasOwnProperty("deviceID")) { + d.deviceID = m.deviceID; + if (o.oneofs) + d._deviceID = "deviceID"; + } + if (m.isDeleted != null && m.hasOwnProperty("isDeleted")) { + d.isDeleted = m.isDeleted; + if (o.oneofs) + d._isDeleted = "isDeleted"; + } + return d; + }; + + AgentAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AgentAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30854,7 +69786,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - AndroidUnsupportedActions.prototype.allowed = false; + AndroidUnsupportedActions.prototype.allowed = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AndroidUnsupportedActions.prototype, "_allowed", { + get: $util.oneOfGetter($oneOfFields = ["allowed"]), + set: $util.oneOfSetter($oneOfFields) + }); AndroidUnsupportedActions.create = function create(properties) { return new AndroidUnsupportedActions(properties); @@ -30889,6 +69829,32 @@ export const proto = $root.proto = (() => { return m; }; + AndroidUnsupportedActions.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.AndroidUnsupportedActions) + return d; + var m = new $root.proto.SyncActionValue.AndroidUnsupportedActions(); + if (d.allowed != null) { + m.allowed = Boolean(d.allowed); + } + return m; + }; + + AndroidUnsupportedActions.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.allowed != null && m.hasOwnProperty("allowed")) { + d.allowed = m.allowed; + if (o.oneofs) + d._allowed = "allowed"; + } + return d; + }; + + AndroidUnsupportedActions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AndroidUnsupportedActions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30908,9 +69874,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ArchiveChatAction.prototype.archived = false; + ArchiveChatAction.prototype.archived = null; ArchiveChatAction.prototype.messageRange = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ArchiveChatAction.prototype, "_archived", { + get: $util.oneOfGetter($oneOfFields = ["archived"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ArchiveChatAction.prototype, "_messageRange", { + get: $util.oneOfGetter($oneOfFields = ["messageRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + ArchiveChatAction.create = function create(properties) { return new ArchiveChatAction(properties); }; @@ -30950,6 +69930,42 @@ export const proto = $root.proto = (() => { return m; }; + ArchiveChatAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.ArchiveChatAction) + return d; + var m = new $root.proto.SyncActionValue.ArchiveChatAction(); + if (d.archived != null) { + m.archived = Boolean(d.archived); + } + if (d.messageRange != null) { + if (typeof d.messageRange !== "object") + throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected"); + m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange); + } + return m; + }; + + ArchiveChatAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.archived != null && m.hasOwnProperty("archived")) { + d.archived = m.archived; + if (o.oneofs) + d._archived = "archived"; + } + if (m.messageRange != null && m.hasOwnProperty("messageRange")) { + d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o); + if (o.oneofs) + d._messageRange = "messageRange"; + } + return d; + }; + + ArchiveChatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ArchiveChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -30969,7 +69985,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - BotWelcomeRequestAction.prototype.isSent = false; + BotWelcomeRequestAction.prototype.isSent = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BotWelcomeRequestAction.prototype, "_isSent", { + get: $util.oneOfGetter($oneOfFields = ["isSent"]), + set: $util.oneOfSetter($oneOfFields) + }); BotWelcomeRequestAction.create = function create(properties) { return new BotWelcomeRequestAction(properties); @@ -31004,6 +70028,32 @@ export const proto = $root.proto = (() => { return m; }; + BotWelcomeRequestAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.BotWelcomeRequestAction) + return d; + var m = new $root.proto.SyncActionValue.BotWelcomeRequestAction(); + if (d.isSent != null) { + m.isSent = Boolean(d.isSent); + } + return m; + }; + + BotWelcomeRequestAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isSent != null && m.hasOwnProperty("isSent")) { + d.isSent = m.isSent; + if (o.oneofs) + d._isSent = "isSent"; + } + return d; + }; + + BotWelcomeRequestAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + BotWelcomeRequestAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31025,6 +70075,14 @@ export const proto = $root.proto = (() => { CallLogAction.prototype.callLogRecord = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallLogAction.prototype, "_callLogRecord", { + get: $util.oneOfGetter($oneOfFields = ["callLogRecord"]), + set: $util.oneOfSetter($oneOfFields) + }); + CallLogAction.create = function create(properties) { return new CallLogAction(properties); }; @@ -31058,6 +70116,34 @@ export const proto = $root.proto = (() => { return m; }; + CallLogAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.CallLogAction) + return d; + var m = new $root.proto.SyncActionValue.CallLogAction(); + if (d.callLogRecord != null) { + if (typeof d.callLogRecord !== "object") + throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected"); + m.callLogRecord = $root.proto.CallLogRecord.fromObject(d.callLogRecord); + } + return m; + }; + + CallLogAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.callLogRecord != null && m.hasOwnProperty("callLogRecord")) { + d.callLogRecord = $root.proto.CallLogRecord.toObject(m.callLogRecord, o); + if (o.oneofs) + d._callLogRecord = "callLogRecord"; + } + return d; + }; + + CallLogAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CallLogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31077,7 +70163,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ChatAssignmentAction.prototype.deviceAgentID = ""; + ChatAssignmentAction.prototype.deviceAgentID = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChatAssignmentAction.prototype, "_deviceAgentID", { + get: $util.oneOfGetter($oneOfFields = ["deviceAgentID"]), + set: $util.oneOfSetter($oneOfFields) + }); ChatAssignmentAction.create = function create(properties) { return new ChatAssignmentAction(properties); @@ -31112,6 +70206,32 @@ export const proto = $root.proto = (() => { return m; }; + ChatAssignmentAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.ChatAssignmentAction) + return d; + var m = new $root.proto.SyncActionValue.ChatAssignmentAction(); + if (d.deviceAgentID != null) { + m.deviceAgentID = String(d.deviceAgentID); + } + return m; + }; + + ChatAssignmentAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.deviceAgentID != null && m.hasOwnProperty("deviceAgentID")) { + d.deviceAgentID = m.deviceAgentID; + if (o.oneofs) + d._deviceAgentID = "deviceAgentID"; + } + return d; + }; + + ChatAssignmentAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ChatAssignmentAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31131,7 +70251,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ChatAssignmentOpenedStatusAction.prototype.chatOpened = false; + ChatAssignmentOpenedStatusAction.prototype.chatOpened = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChatAssignmentOpenedStatusAction.prototype, "_chatOpened", { + get: $util.oneOfGetter($oneOfFields = ["chatOpened"]), + set: $util.oneOfSetter($oneOfFields) + }); ChatAssignmentOpenedStatusAction.create = function create(properties) { return new ChatAssignmentOpenedStatusAction(properties); @@ -31166,6 +70294,32 @@ export const proto = $root.proto = (() => { return m; }; + ChatAssignmentOpenedStatusAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction) + return d; + var m = new $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction(); + if (d.chatOpened != null) { + m.chatOpened = Boolean(d.chatOpened); + } + return m; + }; + + ChatAssignmentOpenedStatusAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.chatOpened != null && m.hasOwnProperty("chatOpened")) { + d.chatOpened = m.chatOpened; + if (o.oneofs) + d._chatOpened = "chatOpened"; + } + return d; + }; + + ChatAssignmentOpenedStatusAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ChatAssignmentOpenedStatusAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31187,6 +70341,14 @@ export const proto = $root.proto = (() => { ClearChatAction.prototype.messageRange = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ClearChatAction.prototype, "_messageRange", { + get: $util.oneOfGetter($oneOfFields = ["messageRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + ClearChatAction.create = function create(properties) { return new ClearChatAction(properties); }; @@ -31220,6 +70382,34 @@ export const proto = $root.proto = (() => { return m; }; + ClearChatAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.ClearChatAction) + return d; + var m = new $root.proto.SyncActionValue.ClearChatAction(); + if (d.messageRange != null) { + if (typeof d.messageRange !== "object") + throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected"); + m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange); + } + return m; + }; + + ClearChatAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageRange != null && m.hasOwnProperty("messageRange")) { + d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o); + if (o.oneofs) + d._messageRange = "messageRange"; + } + return d; + }; + + ClearChatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ClearChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31239,12 +70429,50 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ContactAction.prototype.fullName = ""; - ContactAction.prototype.firstName = ""; - ContactAction.prototype.lidJid = ""; - ContactAction.prototype.saveOnPrimaryAddressbook = false; - ContactAction.prototype.pnJid = ""; - ContactAction.prototype.username = ""; + ContactAction.prototype.fullName = null; + ContactAction.prototype.firstName = null; + ContactAction.prototype.lidJid = null; + ContactAction.prototype.saveOnPrimaryAddressbook = null; + ContactAction.prototype.pnJid = null; + ContactAction.prototype.username = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactAction.prototype, "_fullName", { + get: $util.oneOfGetter($oneOfFields = ["fullName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactAction.prototype, "_firstName", { + get: $util.oneOfGetter($oneOfFields = ["firstName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactAction.prototype, "_lidJid", { + get: $util.oneOfGetter($oneOfFields = ["lidJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactAction.prototype, "_saveOnPrimaryAddressbook", { + get: $util.oneOfGetter($oneOfFields = ["saveOnPrimaryAddressbook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactAction.prototype, "_pnJid", { + get: $util.oneOfGetter($oneOfFields = ["pnJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactAction.prototype, "_username", { + get: $util.oneOfGetter($oneOfFields = ["username"]), + set: $util.oneOfSetter($oneOfFields) + }); ContactAction.create = function create(properties) { return new ContactAction(properties); @@ -31309,6 +70537,72 @@ export const proto = $root.proto = (() => { return m; }; + ContactAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.ContactAction) + return d; + var m = new $root.proto.SyncActionValue.ContactAction(); + if (d.fullName != null) { + m.fullName = String(d.fullName); + } + if (d.firstName != null) { + m.firstName = String(d.firstName); + } + if (d.lidJid != null) { + m.lidJid = String(d.lidJid); + } + if (d.saveOnPrimaryAddressbook != null) { + m.saveOnPrimaryAddressbook = Boolean(d.saveOnPrimaryAddressbook); + } + if (d.pnJid != null) { + m.pnJid = String(d.pnJid); + } + if (d.username != null) { + m.username = String(d.username); + } + return m; + }; + + ContactAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fullName != null && m.hasOwnProperty("fullName")) { + d.fullName = m.fullName; + if (o.oneofs) + d._fullName = "fullName"; + } + if (m.firstName != null && m.hasOwnProperty("firstName")) { + d.firstName = m.firstName; + if (o.oneofs) + d._firstName = "firstName"; + } + if (m.lidJid != null && m.hasOwnProperty("lidJid")) { + d.lidJid = m.lidJid; + if (o.oneofs) + d._lidJid = "lidJid"; + } + if (m.saveOnPrimaryAddressbook != null && m.hasOwnProperty("saveOnPrimaryAddressbook")) { + d.saveOnPrimaryAddressbook = m.saveOnPrimaryAddressbook; + if (o.oneofs) + d._saveOnPrimaryAddressbook = "saveOnPrimaryAddressbook"; + } + if (m.pnJid != null && m.hasOwnProperty("pnJid")) { + d.pnJid = m.pnJid; + if (o.oneofs) + d._pnJid = "pnJid"; + } + if (m.username != null && m.hasOwnProperty("username")) { + d.username = m.username; + if (o.oneofs) + d._username = "username"; + } + return d; + }; + + ContactAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ContactAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31328,7 +70622,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - CtwaPerCustomerDataSharingAction.prototype.isCtwaPerCustomerDataSharingEnabled = false; + CtwaPerCustomerDataSharingAction.prototype.isCtwaPerCustomerDataSharingEnabled = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CtwaPerCustomerDataSharingAction.prototype, "_isCtwaPerCustomerDataSharingEnabled", { + get: $util.oneOfGetter($oneOfFields = ["isCtwaPerCustomerDataSharingEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); CtwaPerCustomerDataSharingAction.create = function create(properties) { return new CtwaPerCustomerDataSharingAction(properties); @@ -31363,6 +70665,32 @@ export const proto = $root.proto = (() => { return m; }; + CtwaPerCustomerDataSharingAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction) + return d; + var m = new $root.proto.SyncActionValue.CtwaPerCustomerDataSharingAction(); + if (d.isCtwaPerCustomerDataSharingEnabled != null) { + m.isCtwaPerCustomerDataSharingEnabled = Boolean(d.isCtwaPerCustomerDataSharingEnabled); + } + return m; + }; + + CtwaPerCustomerDataSharingAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isCtwaPerCustomerDataSharingEnabled != null && m.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")) { + d.isCtwaPerCustomerDataSharingEnabled = m.isCtwaPerCustomerDataSharingEnabled; + if (o.oneofs) + d._isCtwaPerCustomerDataSharingEnabled = "isCtwaPerCustomerDataSharingEnabled"; + } + return d; + }; + + CtwaPerCustomerDataSharingAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CtwaPerCustomerDataSharingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31395,9 +70723,12 @@ export const proto = $root.proto = (() => { CustomPaymentMethod.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(10).string(m.credentialId); - w.uint32(18).string(m.country); - w.uint32(26).string(m.type); + if (m.credentialId != null && Object.hasOwnProperty.call(m, "credentialId")) + w.uint32(10).string(m.credentialId); + if (m.country != null && Object.hasOwnProperty.call(m, "country")) + w.uint32(18).string(m.country); + if (m.type != null && Object.hasOwnProperty.call(m, "type")) + w.uint32(26).string(m.type); if (m.metadata != null && m.metadata.length) { for (var i = 0; i < m.metadata.length; ++i) $root.proto.SyncActionValue.CustomPaymentMethodMetadata.encode(m.metadata[i], w.uint32(34).fork()).ldelim(); @@ -31437,15 +70768,69 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("credentialId")) - throw $util.ProtocolError("missing required 'credentialId'", { instance: m }); - if (!m.hasOwnProperty("country")) - throw $util.ProtocolError("missing required 'country'", { instance: m }); - if (!m.hasOwnProperty("type")) - throw $util.ProtocolError("missing required 'type'", { instance: m }); return m; }; + CustomPaymentMethod.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.CustomPaymentMethod) + return d; + var m = new $root.proto.SyncActionValue.CustomPaymentMethod(); + if (d.credentialId != null) { + m.credentialId = String(d.credentialId); + } + if (d.country != null) { + m.country = String(d.country); + } + if (d.type != null) { + m.type = String(d.type); + } + if (d.metadata) { + if (!Array.isArray(d.metadata)) + throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected"); + m.metadata = []; + for (var i = 0; i < d.metadata.length; ++i) { + if (typeof d.metadata[i] !== "object") + throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: object expected"); + m.metadata[i] = $root.proto.SyncActionValue.CustomPaymentMethodMetadata.fromObject(d.metadata[i]); + } + } + return m; + }; + + CustomPaymentMethod.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.metadata = []; + } + if (o.defaults) { + d.credentialId = ""; + d.country = ""; + d.type = ""; + } + if (m.credentialId != null && m.hasOwnProperty("credentialId")) { + d.credentialId = m.credentialId; + } + if (m.country != null && m.hasOwnProperty("country")) { + d.country = m.country; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = m.type; + } + if (m.metadata && m.metadata.length) { + d.metadata = []; + for (var j = 0; j < m.metadata.length; ++j) { + d.metadata[j] = $root.proto.SyncActionValue.CustomPaymentMethodMetadata.toObject(m.metadata[j], o); + } + } + return d; + }; + + CustomPaymentMethod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CustomPaymentMethod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31475,8 +70860,10 @@ export const proto = $root.proto = (() => { CustomPaymentMethodMetadata.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(10).string(m.key); - w.uint32(18).string(m.value); + if (m.key != null && Object.hasOwnProperty.call(m, "key")) + w.uint32(10).string(m.key); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); return w; }; @@ -31502,13 +70889,43 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("key")) - throw $util.ProtocolError("missing required 'key'", { instance: m }); - if (!m.hasOwnProperty("value")) - throw $util.ProtocolError("missing required 'value'", { instance: m }); return m; }; + CustomPaymentMethodMetadata.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.CustomPaymentMethodMetadata) + return d; + var m = new $root.proto.SyncActionValue.CustomPaymentMethodMetadata(); + if (d.key != null) { + m.key = String(d.key); + } + if (d.value != null) { + m.value = String(d.value); + } + return m; + }; + + CustomPaymentMethodMetadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.key = ""; + d.value = ""; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = m.key; + } + if (m.value != null && m.hasOwnProperty("value")) { + d.value = m.value; + } + return d; + }; + + CustomPaymentMethodMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CustomPaymentMethodMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31568,6 +70985,43 @@ export const proto = $root.proto = (() => { return m; }; + CustomPaymentMethodsAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.CustomPaymentMethodsAction) + return d; + var m = new $root.proto.SyncActionValue.CustomPaymentMethodsAction(); + if (d.customPaymentMethods) { + if (!Array.isArray(d.customPaymentMethods)) + throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected"); + m.customPaymentMethods = []; + for (var i = 0; i < d.customPaymentMethods.length; ++i) { + if (typeof d.customPaymentMethods[i] !== "object") + throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: object expected"); + m.customPaymentMethods[i] = $root.proto.SyncActionValue.CustomPaymentMethod.fromObject(d.customPaymentMethods[i]); + } + } + return m; + }; + + CustomPaymentMethodsAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.customPaymentMethods = []; + } + if (m.customPaymentMethods && m.customPaymentMethods.length) { + d.customPaymentMethods = []; + for (var j = 0; j < m.customPaymentMethods.length; ++j) { + d.customPaymentMethods[j] = $root.proto.SyncActionValue.CustomPaymentMethod.toObject(m.customPaymentMethods[j], o); + } + } + return d; + }; + + CustomPaymentMethodsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CustomPaymentMethodsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31589,6 +71043,14 @@ export const proto = $root.proto = (() => { DeleteChatAction.prototype.messageRange = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteChatAction.prototype, "_messageRange", { + get: $util.oneOfGetter($oneOfFields = ["messageRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + DeleteChatAction.create = function create(properties) { return new DeleteChatAction(properties); }; @@ -31622,6 +71084,34 @@ export const proto = $root.proto = (() => { return m; }; + DeleteChatAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.DeleteChatAction) + return d; + var m = new $root.proto.SyncActionValue.DeleteChatAction(); + if (d.messageRange != null) { + if (typeof d.messageRange !== "object") + throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected"); + m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange); + } + return m; + }; + + DeleteChatAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.messageRange != null && m.hasOwnProperty("messageRange")) { + d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o); + if (o.oneofs) + d._messageRange = "messageRange"; + } + return d; + }; + + DeleteChatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeleteChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31641,8 +71131,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeleteIndividualCallLogAction.prototype.peerJid = ""; - DeleteIndividualCallLogAction.prototype.isIncoming = false; + DeleteIndividualCallLogAction.prototype.peerJid = null; + DeleteIndividualCallLogAction.prototype.isIncoming = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteIndividualCallLogAction.prototype, "_peerJid", { + get: $util.oneOfGetter($oneOfFields = ["peerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteIndividualCallLogAction.prototype, "_isIncoming", { + get: $util.oneOfGetter($oneOfFields = ["isIncoming"]), + set: $util.oneOfSetter($oneOfFields) + }); DeleteIndividualCallLogAction.create = function create(properties) { return new DeleteIndividualCallLogAction(properties); @@ -31683,6 +71187,40 @@ export const proto = $root.proto = (() => { return m; }; + DeleteIndividualCallLogAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.DeleteIndividualCallLogAction) + return d; + var m = new $root.proto.SyncActionValue.DeleteIndividualCallLogAction(); + if (d.peerJid != null) { + m.peerJid = String(d.peerJid); + } + if (d.isIncoming != null) { + m.isIncoming = Boolean(d.isIncoming); + } + return m; + }; + + DeleteIndividualCallLogAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.peerJid != null && m.hasOwnProperty("peerJid")) { + d.peerJid = m.peerJid; + if (o.oneofs) + d._peerJid = "peerJid"; + } + if (m.isIncoming != null && m.hasOwnProperty("isIncoming")) { + d.isIncoming = m.isIncoming; + if (o.oneofs) + d._isIncoming = "isIncoming"; + } + return d; + }; + + DeleteIndividualCallLogAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeleteIndividualCallLogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31702,8 +71240,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - DeleteMessageForMeAction.prototype.deleteMedia = false; - DeleteMessageForMeAction.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DeleteMessageForMeAction.prototype.deleteMedia = null; + DeleteMessageForMeAction.prototype.messageTimestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteMessageForMeAction.prototype, "_deleteMedia", { + get: $util.oneOfGetter($oneOfFields = ["deleteMedia"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteMessageForMeAction.prototype, "_messageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["messageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); DeleteMessageForMeAction.create = function create(properties) { return new DeleteMessageForMeAction(properties); @@ -31744,6 +71296,50 @@ export const proto = $root.proto = (() => { return m; }; + DeleteMessageForMeAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.DeleteMessageForMeAction) + return d; + var m = new $root.proto.SyncActionValue.DeleteMessageForMeAction(); + if (d.deleteMedia != null) { + m.deleteMedia = Boolean(d.deleteMedia); + } + if (d.messageTimestamp != null) { + if ($util.Long) + (m.messageTimestamp = $util.Long.fromValue(d.messageTimestamp)).unsigned = false; + else if (typeof d.messageTimestamp === "string") + m.messageTimestamp = parseInt(d.messageTimestamp, 10); + else if (typeof d.messageTimestamp === "number") + m.messageTimestamp = d.messageTimestamp; + else if (typeof d.messageTimestamp === "object") + m.messageTimestamp = new $util.LongBits(d.messageTimestamp.low >>> 0, d.messageTimestamp.high >>> 0).toNumber(); + } + return m; + }; + + DeleteMessageForMeAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.deleteMedia != null && m.hasOwnProperty("deleteMedia")) { + d.deleteMedia = m.deleteMedia; + if (o.oneofs) + d._deleteMedia = "deleteMedia"; + } + if (m.messageTimestamp != null && m.hasOwnProperty("messageTimestamp")) { + if (typeof m.messageTimestamp === "number") + d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp; + else + d.messageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageTimestamp) : o.longs === Number ? new $util.LongBits(m.messageTimestamp.low >>> 0, m.messageTimestamp.high >>> 0).toNumber() : m.messageTimestamp; + if (o.oneofs) + d._messageTimestamp = "messageTimestamp"; + } + return d; + }; + + DeleteMessageForMeAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + DeleteMessageForMeAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31763,7 +71359,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - ExternalWebBetaAction.prototype.isOptIn = false; + ExternalWebBetaAction.prototype.isOptIn = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalWebBetaAction.prototype, "_isOptIn", { + get: $util.oneOfGetter($oneOfFields = ["isOptIn"]), + set: $util.oneOfSetter($oneOfFields) + }); ExternalWebBetaAction.create = function create(properties) { return new ExternalWebBetaAction(properties); @@ -31798,6 +71402,32 @@ export const proto = $root.proto = (() => { return m; }; + ExternalWebBetaAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.ExternalWebBetaAction) + return d; + var m = new $root.proto.SyncActionValue.ExternalWebBetaAction(); + if (d.isOptIn != null) { + m.isOptIn = Boolean(d.isOptIn); + } + return m; + }; + + ExternalWebBetaAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isOptIn != null && m.hasOwnProperty("isOptIn")) { + d.isOptIn = m.isOptIn; + if (o.oneofs) + d._isOptIn = "isOptIn"; + } + return d; + }; + + ExternalWebBetaAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExternalWebBetaAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31857,6 +71487,43 @@ export const proto = $root.proto = (() => { return m; }; + FavoritesAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.FavoritesAction) + return d; + var m = new $root.proto.SyncActionValue.FavoritesAction(); + if (d.favorites) { + if (!Array.isArray(d.favorites)) + throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected"); + m.favorites = []; + for (var i = 0; i < d.favorites.length; ++i) { + if (typeof d.favorites[i] !== "object") + throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: object expected"); + m.favorites[i] = $root.proto.SyncActionValue.FavoritesAction.Favorite.fromObject(d.favorites[i]); + } + } + return m; + }; + + FavoritesAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.favorites = []; + } + if (m.favorites && m.favorites.length) { + d.favorites = []; + for (var j = 0; j < m.favorites.length; ++j) { + d.favorites[j] = $root.proto.SyncActionValue.FavoritesAction.Favorite.toObject(m.favorites[j], o); + } + } + return d; + }; + + FavoritesAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + FavoritesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31873,7 +71540,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Favorite.prototype.id = ""; + Favorite.prototype.id = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Favorite.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); Favorite.create = function create(properties) { return new Favorite(properties); @@ -31908,6 +71583,32 @@ export const proto = $root.proto = (() => { return m; }; + Favorite.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.FavoritesAction.Favorite) + return d; + var m = new $root.proto.SyncActionValue.FavoritesAction.Favorite(); + if (d.id != null) { + m.id = String(d.id); + } + return m; + }; + + Favorite.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + return d; + }; + + Favorite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Favorite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31930,7 +71631,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - KeyExpiration.prototype.expiredKeyEpoch = 0; + KeyExpiration.prototype.expiredKeyEpoch = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyExpiration.prototype, "_expiredKeyEpoch", { + get: $util.oneOfGetter($oneOfFields = ["expiredKeyEpoch"]), + set: $util.oneOfSetter($oneOfFields) + }); KeyExpiration.create = function create(properties) { return new KeyExpiration(properties); @@ -31965,6 +71674,32 @@ export const proto = $root.proto = (() => { return m; }; + KeyExpiration.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.KeyExpiration) + return d; + var m = new $root.proto.SyncActionValue.KeyExpiration(); + if (d.expiredKeyEpoch != null) { + m.expiredKeyEpoch = d.expiredKeyEpoch | 0; + } + return m; + }; + + KeyExpiration.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.expiredKeyEpoch != null && m.hasOwnProperty("expiredKeyEpoch")) { + d.expiredKeyEpoch = m.expiredKeyEpoch; + if (o.oneofs) + d._expiredKeyEpoch = "expiredKeyEpoch"; + } + return d; + }; + + KeyExpiration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeyExpiration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -31984,7 +71719,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LabelAssociationAction.prototype.labeled = false; + LabelAssociationAction.prototype.labeled = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelAssociationAction.prototype, "_labeled", { + get: $util.oneOfGetter($oneOfFields = ["labeled"]), + set: $util.oneOfSetter($oneOfFields) + }); LabelAssociationAction.create = function create(properties) { return new LabelAssociationAction(properties); @@ -32019,6 +71762,32 @@ export const proto = $root.proto = (() => { return m; }; + LabelAssociationAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.LabelAssociationAction) + return d; + var m = new $root.proto.SyncActionValue.LabelAssociationAction(); + if (d.labeled != null) { + m.labeled = Boolean(d.labeled); + } + return m; + }; + + LabelAssociationAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.labeled != null && m.hasOwnProperty("labeled")) { + d.labeled = m.labeled; + if (o.oneofs) + d._labeled = "labeled"; + } + return d; + }; + + LabelAssociationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LabelAssociationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32038,14 +71807,64 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LabelEditAction.prototype.name = ""; - LabelEditAction.prototype.color = 0; - LabelEditAction.prototype.predefinedId = 0; - LabelEditAction.prototype.deleted = false; - LabelEditAction.prototype.orderIndex = 0; - LabelEditAction.prototype.isActive = false; - LabelEditAction.prototype.type = 0; - LabelEditAction.prototype.isImmutable = false; + LabelEditAction.prototype.name = null; + LabelEditAction.prototype.color = null; + LabelEditAction.prototype.predefinedId = null; + LabelEditAction.prototype.deleted = null; + LabelEditAction.prototype.orderIndex = null; + LabelEditAction.prototype.isActive = null; + LabelEditAction.prototype.type = null; + LabelEditAction.prototype.isImmutable = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_color", { + get: $util.oneOfGetter($oneOfFields = ["color"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_predefinedId", { + get: $util.oneOfGetter($oneOfFields = ["predefinedId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_deleted", { + get: $util.oneOfGetter($oneOfFields = ["deleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_orderIndex", { + get: $util.oneOfGetter($oneOfFields = ["orderIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_isActive", { + get: $util.oneOfGetter($oneOfFields = ["isActive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LabelEditAction.prototype, "_isImmutable", { + get: $util.oneOfGetter($oneOfFields = ["isImmutable"]), + set: $util.oneOfSetter($oneOfFields) + }); LabelEditAction.create = function create(properties) { return new LabelEditAction(properties); @@ -32122,6 +71941,125 @@ export const proto = $root.proto = (() => { return m; }; + LabelEditAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.LabelEditAction) + return d; + var m = new $root.proto.SyncActionValue.LabelEditAction(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.color != null) { + m.color = d.color | 0; + } + if (d.predefinedId != null) { + m.predefinedId = d.predefinedId | 0; + } + if (d.deleted != null) { + m.deleted = Boolean(d.deleted); + } + if (d.orderIndex != null) { + m.orderIndex = d.orderIndex | 0; + } + if (d.isActive != null) { + m.isActive = Boolean(d.isActive); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "NONE": + case 0: + m.type = 0; + break; + case "UNREAD": + case 1: + m.type = 1; + break; + case "GROUPS": + case 2: + m.type = 2; + break; + case "FAVORITES": + case 3: + m.type = 3; + break; + case "PREDEFINED": + case 4: + m.type = 4; + break; + case "CUSTOM": + case 5: + m.type = 5; + break; + case "COMMUNITY": + case 6: + m.type = 6; + break; + case "SERVER_ASSIGNED": + case 7: + m.type = 7; + break; + } + if (d.isImmutable != null) { + m.isImmutable = Boolean(d.isImmutable); + } + return m; + }; + + LabelEditAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.color != null && m.hasOwnProperty("color")) { + d.color = m.color; + if (o.oneofs) + d._color = "color"; + } + if (m.predefinedId != null && m.hasOwnProperty("predefinedId")) { + d.predefinedId = m.predefinedId; + if (o.oneofs) + d._predefinedId = "predefinedId"; + } + if (m.deleted != null && m.hasOwnProperty("deleted")) { + d.deleted = m.deleted; + if (o.oneofs) + d._deleted = "deleted"; + } + if (m.orderIndex != null && m.hasOwnProperty("orderIndex")) { + d.orderIndex = m.orderIndex; + if (o.oneofs) + d._orderIndex = "orderIndex"; + } + if (m.isActive != null && m.hasOwnProperty("isActive")) { + d.isActive = m.isActive; + if (o.oneofs) + d._isActive = "isActive"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.SyncActionValue.LabelEditAction.ListType[m.type] === undefined ? m.type : $root.proto.SyncActionValue.LabelEditAction.ListType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.isImmutable != null && m.hasOwnProperty("isImmutable")) { + d.isImmutable = m.isImmutable; + if (o.oneofs) + d._isImmutable = "isImmutable"; + } + return d; + }; + + LabelEditAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LabelEditAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32165,8 +72103,10 @@ export const proto = $root.proto = (() => { if (!w) w = $Writer.create(); if (m.sortedLabelIds != null && m.sortedLabelIds.length) { + w.uint32(10).fork(); for (var i = 0; i < m.sortedLabelIds.length; ++i) - w.uint32(8).int32(m.sortedLabelIds[i]); + w.int32(m.sortedLabelIds[i]); + w.ldelim(); } return w; }; @@ -32199,6 +72139,41 @@ export const proto = $root.proto = (() => { return m; }; + LabelReorderingAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.LabelReorderingAction) + return d; + var m = new $root.proto.SyncActionValue.LabelReorderingAction(); + if (d.sortedLabelIds) { + if (!Array.isArray(d.sortedLabelIds)) + throw TypeError(".proto.SyncActionValue.LabelReorderingAction.sortedLabelIds: array expected"); + m.sortedLabelIds = []; + for (var i = 0; i < d.sortedLabelIds.length; ++i) { + m.sortedLabelIds[i] = d.sortedLabelIds[i] | 0; + } + } + return m; + }; + + LabelReorderingAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.sortedLabelIds = []; + } + if (m.sortedLabelIds && m.sortedLabelIds.length) { + d.sortedLabelIds = []; + for (var j = 0; j < m.sortedLabelIds.length; ++j) { + d.sortedLabelIds[j] = m.sortedLabelIds[j]; + } + } + return d; + }; + + LabelReorderingAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LabelReorderingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32218,10 +72193,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LidContactAction.prototype.fullName = ""; - LidContactAction.prototype.firstName = ""; - LidContactAction.prototype.username = ""; - LidContactAction.prototype.saveOnPrimaryAddressbook = false; + LidContactAction.prototype.fullName = null; + LidContactAction.prototype.firstName = null; + LidContactAction.prototype.username = null; + LidContactAction.prototype.saveOnPrimaryAddressbook = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LidContactAction.prototype, "_fullName", { + get: $util.oneOfGetter($oneOfFields = ["fullName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LidContactAction.prototype, "_firstName", { + get: $util.oneOfGetter($oneOfFields = ["firstName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LidContactAction.prototype, "_username", { + get: $util.oneOfGetter($oneOfFields = ["username"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LidContactAction.prototype, "_saveOnPrimaryAddressbook", { + get: $util.oneOfGetter($oneOfFields = ["saveOnPrimaryAddressbook"]), + set: $util.oneOfSetter($oneOfFields) + }); LidContactAction.create = function create(properties) { return new LidContactAction(properties); @@ -32274,6 +72275,56 @@ export const proto = $root.proto = (() => { return m; }; + LidContactAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.LidContactAction) + return d; + var m = new $root.proto.SyncActionValue.LidContactAction(); + if (d.fullName != null) { + m.fullName = String(d.fullName); + } + if (d.firstName != null) { + m.firstName = String(d.firstName); + } + if (d.username != null) { + m.username = String(d.username); + } + if (d.saveOnPrimaryAddressbook != null) { + m.saveOnPrimaryAddressbook = Boolean(d.saveOnPrimaryAddressbook); + } + return m; + }; + + LidContactAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.fullName != null && m.hasOwnProperty("fullName")) { + d.fullName = m.fullName; + if (o.oneofs) + d._fullName = "fullName"; + } + if (m.firstName != null && m.hasOwnProperty("firstName")) { + d.firstName = m.firstName; + if (o.oneofs) + d._firstName = "firstName"; + } + if (m.username != null && m.hasOwnProperty("username")) { + d.username = m.username; + if (o.oneofs) + d._username = "username"; + } + if (m.saveOnPrimaryAddressbook != null && m.hasOwnProperty("saveOnPrimaryAddressbook")) { + d.saveOnPrimaryAddressbook = m.saveOnPrimaryAddressbook; + if (o.oneofs) + d._saveOnPrimaryAddressbook = "saveOnPrimaryAddressbook"; + } + return d; + }; + + LidContactAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LidContactAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32293,7 +72344,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LocaleSetting.prototype.locale = ""; + LocaleSetting.prototype.locale = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LocaleSetting.prototype, "_locale", { + get: $util.oneOfGetter($oneOfFields = ["locale"]), + set: $util.oneOfSetter($oneOfFields) + }); LocaleSetting.create = function create(properties) { return new LocaleSetting(properties); @@ -32328,6 +72387,32 @@ export const proto = $root.proto = (() => { return m; }; + LocaleSetting.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.LocaleSetting) + return d; + var m = new $root.proto.SyncActionValue.LocaleSetting(); + if (d.locale != null) { + m.locale = String(d.locale); + } + return m; + }; + + LocaleSetting.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.locale != null && m.hasOwnProperty("locale")) { + d.locale = m.locale; + if (o.oneofs) + d._locale = "locale"; + } + return d; + }; + + LocaleSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LocaleSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32347,7 +72432,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - LockChatAction.prototype.locked = false; + LockChatAction.prototype.locked = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LockChatAction.prototype, "_locked", { + get: $util.oneOfGetter($oneOfFields = ["locked"]), + set: $util.oneOfSetter($oneOfFields) + }); LockChatAction.create = function create(properties) { return new LockChatAction(properties); @@ -32382,6 +72475,32 @@ export const proto = $root.proto = (() => { return m; }; + LockChatAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.LockChatAction) + return d; + var m = new $root.proto.SyncActionValue.LockChatAction(); + if (d.locked != null) { + m.locked = Boolean(d.locked); + } + return m; + }; + + LockChatAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.locked != null && m.hasOwnProperty("locked")) { + d.locked = m.locked; + if (o.oneofs) + d._locked = "locked"; + } + return d; + }; + + LockChatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LockChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32401,9 +72520,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MarkChatAsReadAction.prototype.read = false; + MarkChatAsReadAction.prototype.read = null; MarkChatAsReadAction.prototype.messageRange = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarkChatAsReadAction.prototype, "_read", { + get: $util.oneOfGetter($oneOfFields = ["read"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarkChatAsReadAction.prototype, "_messageRange", { + get: $util.oneOfGetter($oneOfFields = ["messageRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + MarkChatAsReadAction.create = function create(properties) { return new MarkChatAsReadAction(properties); }; @@ -32443,6 +72576,42 @@ export const proto = $root.proto = (() => { return m; }; + MarkChatAsReadAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.MarkChatAsReadAction) + return d; + var m = new $root.proto.SyncActionValue.MarkChatAsReadAction(); + if (d.read != null) { + m.read = Boolean(d.read); + } + if (d.messageRange != null) { + if (typeof d.messageRange !== "object") + throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected"); + m.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.fromObject(d.messageRange); + } + return m; + }; + + MarkChatAsReadAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.read != null && m.hasOwnProperty("read")) { + d.read = m.read; + if (o.oneofs) + d._read = "read"; + } + if (m.messageRange != null && m.hasOwnProperty("messageRange")) { + d.messageRange = $root.proto.SyncActionValue.SyncActionMessageRange.toObject(m.messageRange, o); + if (o.oneofs) + d._messageRange = "messageRange"; + } + return d; + }; + + MarkChatAsReadAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MarkChatAsReadAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32462,13 +72631,57 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MarketingMessageAction.prototype.name = ""; - MarketingMessageAction.prototype.message = ""; - MarketingMessageAction.prototype.type = 0; - MarketingMessageAction.prototype.createdAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MarketingMessageAction.prototype.lastSentAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MarketingMessageAction.prototype.isDeleted = false; - MarketingMessageAction.prototype.mediaId = ""; + MarketingMessageAction.prototype.name = null; + MarketingMessageAction.prototype.message = null; + MarketingMessageAction.prototype.type = null; + MarketingMessageAction.prototype.createdAt = null; + MarketingMessageAction.prototype.lastSentAt = null; + MarketingMessageAction.prototype.isDeleted = null; + MarketingMessageAction.prototype.mediaId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_createdAt", { + get: $util.oneOfGetter($oneOfFields = ["createdAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_lastSentAt", { + get: $util.oneOfGetter($oneOfFields = ["lastSentAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_isDeleted", { + get: $util.oneOfGetter($oneOfFields = ["isDeleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageAction.prototype, "_mediaId", { + get: $util.oneOfGetter($oneOfFields = ["mediaId"]), + set: $util.oneOfSetter($oneOfFields) + }); MarketingMessageAction.create = function create(properties) { return new MarketingMessageAction(properties); @@ -32539,6 +72752,109 @@ export const proto = $root.proto = (() => { return m; }; + MarketingMessageAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.MarketingMessageAction) + return d; + var m = new $root.proto.SyncActionValue.MarketingMessageAction(); + if (d.name != null) { + m.name = String(d.name); + } + if (d.message != null) { + m.message = String(d.message); + } + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "PERSONALIZED": + case 0: + m.type = 0; + break; + } + if (d.createdAt != null) { + if ($util.Long) + (m.createdAt = $util.Long.fromValue(d.createdAt)).unsigned = false; + else if (typeof d.createdAt === "string") + m.createdAt = parseInt(d.createdAt, 10); + else if (typeof d.createdAt === "number") + m.createdAt = d.createdAt; + else if (typeof d.createdAt === "object") + m.createdAt = new $util.LongBits(d.createdAt.low >>> 0, d.createdAt.high >>> 0).toNumber(); + } + if (d.lastSentAt != null) { + if ($util.Long) + (m.lastSentAt = $util.Long.fromValue(d.lastSentAt)).unsigned = false; + else if (typeof d.lastSentAt === "string") + m.lastSentAt = parseInt(d.lastSentAt, 10); + else if (typeof d.lastSentAt === "number") + m.lastSentAt = d.lastSentAt; + else if (typeof d.lastSentAt === "object") + m.lastSentAt = new $util.LongBits(d.lastSentAt.low >>> 0, d.lastSentAt.high >>> 0).toNumber(); + } + if (d.isDeleted != null) { + m.isDeleted = Boolean(d.isDeleted); + } + if (d.mediaId != null) { + m.mediaId = String(d.mediaId); + } + return m; + }; + + MarketingMessageAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = m.message; + if (o.oneofs) + d._message = "message"; + } + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[m.type] === undefined ? m.type : $root.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.createdAt != null && m.hasOwnProperty("createdAt")) { + if (typeof m.createdAt === "number") + d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt; + else + d.createdAt = o.longs === String ? $util.Long.prototype.toString.call(m.createdAt) : o.longs === Number ? new $util.LongBits(m.createdAt.low >>> 0, m.createdAt.high >>> 0).toNumber() : m.createdAt; + if (o.oneofs) + d._createdAt = "createdAt"; + } + if (m.lastSentAt != null && m.hasOwnProperty("lastSentAt")) { + if (typeof m.lastSentAt === "number") + d.lastSentAt = o.longs === String ? String(m.lastSentAt) : m.lastSentAt; + else + d.lastSentAt = o.longs === String ? $util.Long.prototype.toString.call(m.lastSentAt) : o.longs === Number ? new $util.LongBits(m.lastSentAt.low >>> 0, m.lastSentAt.high >>> 0).toNumber() : m.lastSentAt; + if (o.oneofs) + d._lastSentAt = "lastSentAt"; + } + if (m.isDeleted != null && m.hasOwnProperty("isDeleted")) { + d.isDeleted = m.isDeleted; + if (o.oneofs) + d._isDeleted = "isDeleted"; + } + if (m.mediaId != null && m.hasOwnProperty("mediaId")) { + d.mediaId = m.mediaId; + if (o.oneofs) + d._mediaId = "mediaId"; + } + return d; + }; + + MarketingMessageAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MarketingMessageAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32564,7 +72880,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MarketingMessageBroadcastAction.prototype.repliedCount = 0; + MarketingMessageBroadcastAction.prototype.repliedCount = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingMessageBroadcastAction.prototype, "_repliedCount", { + get: $util.oneOfGetter($oneOfFields = ["repliedCount"]), + set: $util.oneOfSetter($oneOfFields) + }); MarketingMessageBroadcastAction.create = function create(properties) { return new MarketingMessageBroadcastAction(properties); @@ -32599,6 +72923,32 @@ export const proto = $root.proto = (() => { return m; }; + MarketingMessageBroadcastAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.MarketingMessageBroadcastAction) + return d; + var m = new $root.proto.SyncActionValue.MarketingMessageBroadcastAction(); + if (d.repliedCount != null) { + m.repliedCount = d.repliedCount | 0; + } + return m; + }; + + MarketingMessageBroadcastAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.repliedCount != null && m.hasOwnProperty("repliedCount")) { + d.repliedCount = m.repliedCount; + if (o.oneofs) + d._repliedCount = "repliedCount"; + } + return d; + }; + + MarketingMessageBroadcastAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MarketingMessageBroadcastAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32620,8 +72970,22 @@ export const proto = $root.proto = (() => { MerchantPaymentPartnerAction.prototype.status = 0; MerchantPaymentPartnerAction.prototype.country = ""; - MerchantPaymentPartnerAction.prototype.gatewayName = ""; - MerchantPaymentPartnerAction.prototype.credentialId = ""; + MerchantPaymentPartnerAction.prototype.gatewayName = null; + MerchantPaymentPartnerAction.prototype.credentialId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_gatewayName", { + get: $util.oneOfGetter($oneOfFields = ["gatewayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_credentialId", { + get: $util.oneOfGetter($oneOfFields = ["credentialId"]), + set: $util.oneOfSetter($oneOfFields) + }); MerchantPaymentPartnerAction.create = function create(properties) { return new MerchantPaymentPartnerAction(properties); @@ -32630,8 +72994,10 @@ export const proto = $root.proto = (() => { MerchantPaymentPartnerAction.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(8).int32(m.status); - w.uint32(18).string(m.country); + if (m.status != null && Object.hasOwnProperty.call(m, "status")) + w.uint32(8).int32(m.status); + if (m.country != null && Object.hasOwnProperty.call(m, "country")) + w.uint32(18).string(m.country); if (m.gatewayName != null && Object.hasOwnProperty.call(m, "gatewayName")) w.uint32(26).string(m.gatewayName); if (m.credentialId != null && Object.hasOwnProperty.call(m, "credentialId")) @@ -32669,13 +73035,72 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("status")) - throw $util.ProtocolError("missing required 'status'", { instance: m }); - if (!m.hasOwnProperty("country")) - throw $util.ProtocolError("missing required 'country'", { instance: m }); return m; }; + MerchantPaymentPartnerAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.MerchantPaymentPartnerAction) + return d; + var m = new $root.proto.SyncActionValue.MerchantPaymentPartnerAction(); + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "ACTIVE": + case 0: + m.status = 0; + break; + case "INACTIVE": + case 1: + m.status = 1; + break; + } + if (d.country != null) { + m.country = String(d.country); + } + if (d.gatewayName != null) { + m.gatewayName = String(d.gatewayName); + } + if (d.credentialId != null) { + m.credentialId = String(d.credentialId); + } + return m; + }; + + MerchantPaymentPartnerAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.status = o.enums === String ? "ACTIVE" : 0; + d.country = ""; + } + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] === undefined ? m.status : $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] : m.status; + } + if (m.country != null && m.hasOwnProperty("country")) { + d.country = m.country; + } + if (m.gatewayName != null && m.hasOwnProperty("gatewayName")) { + d.gatewayName = m.gatewayName; + if (o.oneofs) + d._gatewayName = "gatewayName"; + } + if (m.credentialId != null && m.hasOwnProperty("credentialId")) { + d.credentialId = m.credentialId; + if (o.oneofs) + d._credentialId = "credentialId"; + } + return d; + }; + + MerchantPaymentPartnerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MerchantPaymentPartnerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32702,9 +73127,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - MuteAction.prototype.muted = false; - MuteAction.prototype.muteEndTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - MuteAction.prototype.autoMuted = false; + MuteAction.prototype.muted = null; + MuteAction.prototype.muteEndTimestamp = null; + MuteAction.prototype.autoMuted = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MuteAction.prototype, "_muted", { + get: $util.oneOfGetter($oneOfFields = ["muted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MuteAction.prototype, "_muteEndTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["muteEndTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MuteAction.prototype, "_autoMuted", { + get: $util.oneOfGetter($oneOfFields = ["autoMuted"]), + set: $util.oneOfSetter($oneOfFields) + }); MuteAction.create = function create(properties) { return new MuteAction(properties); @@ -32751,6 +73196,58 @@ export const proto = $root.proto = (() => { return m; }; + MuteAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.MuteAction) + return d; + var m = new $root.proto.SyncActionValue.MuteAction(); + if (d.muted != null) { + m.muted = Boolean(d.muted); + } + if (d.muteEndTimestamp != null) { + if ($util.Long) + (m.muteEndTimestamp = $util.Long.fromValue(d.muteEndTimestamp)).unsigned = false; + else if (typeof d.muteEndTimestamp === "string") + m.muteEndTimestamp = parseInt(d.muteEndTimestamp, 10); + else if (typeof d.muteEndTimestamp === "number") + m.muteEndTimestamp = d.muteEndTimestamp; + else if (typeof d.muteEndTimestamp === "object") + m.muteEndTimestamp = new $util.LongBits(d.muteEndTimestamp.low >>> 0, d.muteEndTimestamp.high >>> 0).toNumber(); + } + if (d.autoMuted != null) { + m.autoMuted = Boolean(d.autoMuted); + } + return m; + }; + + MuteAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.muted != null && m.hasOwnProperty("muted")) { + d.muted = m.muted; + if (o.oneofs) + d._muted = "muted"; + } + if (m.muteEndTimestamp != null && m.hasOwnProperty("muteEndTimestamp")) { + if (typeof m.muteEndTimestamp === "number") + d.muteEndTimestamp = o.longs === String ? String(m.muteEndTimestamp) : m.muteEndTimestamp; + else + d.muteEndTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.muteEndTimestamp) : o.longs === Number ? new $util.LongBits(m.muteEndTimestamp.low >>> 0, m.muteEndTimestamp.high >>> 0).toNumber() : m.muteEndTimestamp; + if (o.oneofs) + d._muteEndTimestamp = "muteEndTimestamp"; + } + if (m.autoMuted != null && m.hasOwnProperty("autoMuted")) { + d.autoMuted = m.autoMuted; + if (o.oneofs) + d._autoMuted = "autoMuted"; + } + return d; + }; + + MuteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MuteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32770,11 +73267,43 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NoteEditAction.prototype.type = 1; - NoteEditAction.prototype.chatJid = ""; - NoteEditAction.prototype.createdAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - NoteEditAction.prototype.deleted = false; - NoteEditAction.prototype.unstructuredContent = ""; + NoteEditAction.prototype.type = null; + NoteEditAction.prototype.chatJid = null; + NoteEditAction.prototype.createdAt = null; + NoteEditAction.prototype.deleted = null; + NoteEditAction.prototype.unstructuredContent = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoteEditAction.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoteEditAction.prototype, "_chatJid", { + get: $util.oneOfGetter($oneOfFields = ["chatJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoteEditAction.prototype, "_createdAt", { + get: $util.oneOfGetter($oneOfFields = ["createdAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoteEditAction.prototype, "_deleted", { + get: $util.oneOfGetter($oneOfFields = ["deleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NoteEditAction.prototype, "_unstructuredContent", { + get: $util.oneOfGetter($oneOfFields = ["unstructuredContent"]), + set: $util.oneOfSetter($oneOfFields) + }); NoteEditAction.create = function create(properties) { return new NoteEditAction(properties); @@ -32833,6 +73362,87 @@ export const proto = $root.proto = (() => { return m; }; + NoteEditAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.NoteEditAction) + return d; + var m = new $root.proto.SyncActionValue.NoteEditAction(); + switch (d.type) { + default: + if (typeof d.type === "number") { + m.type = d.type; + break; + } + break; + case "UNSTRUCTURED": + case 1: + m.type = 1; + break; + case "STRUCTURED": + case 2: + m.type = 2; + break; + } + if (d.chatJid != null) { + m.chatJid = String(d.chatJid); + } + if (d.createdAt != null) { + if ($util.Long) + (m.createdAt = $util.Long.fromValue(d.createdAt)).unsigned = false; + else if (typeof d.createdAt === "string") + m.createdAt = parseInt(d.createdAt, 10); + else if (typeof d.createdAt === "number") + m.createdAt = d.createdAt; + else if (typeof d.createdAt === "object") + m.createdAt = new $util.LongBits(d.createdAt.low >>> 0, d.createdAt.high >>> 0).toNumber(); + } + if (d.deleted != null) { + m.deleted = Boolean(d.deleted); + } + if (d.unstructuredContent != null) { + m.unstructuredContent = String(d.unstructuredContent); + } + return m; + }; + + NoteEditAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.type != null && m.hasOwnProperty("type")) { + d.type = o.enums === String ? $root.proto.SyncActionValue.NoteEditAction.NoteType[m.type] === undefined ? m.type : $root.proto.SyncActionValue.NoteEditAction.NoteType[m.type] : m.type; + if (o.oneofs) + d._type = "type"; + } + if (m.chatJid != null && m.hasOwnProperty("chatJid")) { + d.chatJid = m.chatJid; + if (o.oneofs) + d._chatJid = "chatJid"; + } + if (m.createdAt != null && m.hasOwnProperty("createdAt")) { + if (typeof m.createdAt === "number") + d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt; + else + d.createdAt = o.longs === String ? $util.Long.prototype.toString.call(m.createdAt) : o.longs === Number ? new $util.LongBits(m.createdAt.low >>> 0, m.createdAt.high >>> 0).toNumber() : m.createdAt; + if (o.oneofs) + d._createdAt = "createdAt"; + } + if (m.deleted != null && m.hasOwnProperty("deleted")) { + d.deleted = m.deleted; + if (o.oneofs) + d._deleted = "deleted"; + } + if (m.unstructuredContent != null && m.hasOwnProperty("unstructuredContent")) { + d.unstructuredContent = m.unstructuredContent; + if (o.oneofs) + d._unstructuredContent = "unstructuredContent"; + } + return d; + }; + + NoteEditAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NoteEditAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32859,7 +73469,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NotificationActivitySettingAction.prototype.notificationActivitySetting = 0; + NotificationActivitySettingAction.prototype.notificationActivitySetting = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NotificationActivitySettingAction.prototype, "_notificationActivitySetting", { + get: $util.oneOfGetter($oneOfFields = ["notificationActivitySetting"]), + set: $util.oneOfSetter($oneOfFields) + }); NotificationActivitySettingAction.create = function create(properties) { return new NotificationActivitySettingAction(properties); @@ -32894,6 +73512,53 @@ export const proto = $root.proto = (() => { return m; }; + NotificationActivitySettingAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.NotificationActivitySettingAction) + return d; + var m = new $root.proto.SyncActionValue.NotificationActivitySettingAction(); + switch (d.notificationActivitySetting) { + default: + if (typeof d.notificationActivitySetting === "number") { + m.notificationActivitySetting = d.notificationActivitySetting; + break; + } + break; + case "DEFAULT_ALL_MESSAGES": + case 0: + m.notificationActivitySetting = 0; + break; + case "ALL_MESSAGES": + case 1: + m.notificationActivitySetting = 1; + break; + case "HIGHLIGHTS": + case 2: + m.notificationActivitySetting = 2; + break; + case "DEFAULT_HIGHLIGHTS": + case 3: + m.notificationActivitySetting = 3; + break; + } + return m; + }; + + NotificationActivitySettingAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.notificationActivitySetting != null && m.hasOwnProperty("notificationActivitySetting")) { + d.notificationActivitySetting = o.enums === String ? $root.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[m.notificationActivitySetting] === undefined ? m.notificationActivitySetting : $root.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[m.notificationActivitySetting] : m.notificationActivitySetting; + if (o.oneofs) + d._notificationActivitySetting = "notificationActivitySetting"; + } + return d; + }; + + NotificationActivitySettingAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NotificationActivitySettingAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32922,7 +73587,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - NuxAction.prototype.acknowledged = false; + NuxAction.prototype.acknowledged = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NuxAction.prototype, "_acknowledged", { + get: $util.oneOfGetter($oneOfFields = ["acknowledged"]), + set: $util.oneOfSetter($oneOfFields) + }); NuxAction.create = function create(properties) { return new NuxAction(properties); @@ -32957,6 +73630,32 @@ export const proto = $root.proto = (() => { return m; }; + NuxAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.NuxAction) + return d; + var m = new $root.proto.SyncActionValue.NuxAction(); + if (d.acknowledged != null) { + m.acknowledged = Boolean(d.acknowledged); + } + return m; + }; + + NuxAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.acknowledged != null && m.hasOwnProperty("acknowledged")) { + d.acknowledged = m.acknowledged; + if (o.oneofs) + d._acknowledged = "acknowledged"; + } + return d; + }; + + NuxAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NuxAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -32976,7 +73675,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PaymentInfoAction.prototype.cpi = ""; + PaymentInfoAction.prototype.cpi = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PaymentInfoAction.prototype, "_cpi", { + get: $util.oneOfGetter($oneOfFields = ["cpi"]), + set: $util.oneOfSetter($oneOfFields) + }); PaymentInfoAction.create = function create(properties) { return new PaymentInfoAction(properties); @@ -33011,6 +73718,32 @@ export const proto = $root.proto = (() => { return m; }; + PaymentInfoAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PaymentInfoAction) + return d; + var m = new $root.proto.SyncActionValue.PaymentInfoAction(); + if (d.cpi != null) { + m.cpi = String(d.cpi); + } + return m; + }; + + PaymentInfoAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.cpi != null && m.hasOwnProperty("cpi")) { + d.cpi = m.cpi; + if (o.oneofs) + d._cpi = "cpi"; + } + return d; + }; + + PaymentInfoAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentInfoAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33040,8 +73773,10 @@ export const proto = $root.proto = (() => { PaymentTosAction.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(8).int32(m.paymentNotice); - w.uint32(16).bool(m.accepted); + if (m.paymentNotice != null && Object.hasOwnProperty.call(m, "paymentNotice")) + w.uint32(8).int32(m.paymentNotice); + if (m.accepted != null && Object.hasOwnProperty.call(m, "accepted")) + w.uint32(16).bool(m.accepted); return w; }; @@ -33067,13 +73802,52 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("paymentNotice")) - throw $util.ProtocolError("missing required 'paymentNotice'", { instance: m }); - if (!m.hasOwnProperty("accepted")) - throw $util.ProtocolError("missing required 'accepted'", { instance: m }); return m; }; + PaymentTosAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PaymentTosAction) + return d; + var m = new $root.proto.SyncActionValue.PaymentTosAction(); + switch (d.paymentNotice) { + default: + if (typeof d.paymentNotice === "number") { + m.paymentNotice = d.paymentNotice; + break; + } + break; + case "BR_PAY_PRIVACY_POLICY": + case 0: + m.paymentNotice = 0; + break; + } + if (d.accepted != null) { + m.accepted = Boolean(d.accepted); + } + return m; + }; + + PaymentTosAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.paymentNotice = o.enums === String ? "BR_PAY_PRIVACY_POLICY" : 0; + d.accepted = false; + } + if (m.paymentNotice != null && m.hasOwnProperty("paymentNotice")) { + d.paymentNotice = o.enums === String ? $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] === undefined ? m.paymentNotice : $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] : m.paymentNotice; + } + if (m.accepted != null && m.hasOwnProperty("accepted")) { + d.accepted = m.accepted; + } + return d; + }; + + PaymentTosAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PaymentTosAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33099,7 +73873,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PinAction.prototype.pinned = false; + PinAction.prototype.pinned = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PinAction.prototype, "_pinned", { + get: $util.oneOfGetter($oneOfFields = ["pinned"]), + set: $util.oneOfSetter($oneOfFields) + }); PinAction.create = function create(properties) { return new PinAction(properties); @@ -33134,6 +73916,32 @@ export const proto = $root.proto = (() => { return m; }; + PinAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PinAction) + return d; + var m = new $root.proto.SyncActionValue.PinAction(); + if (d.pinned != null) { + m.pinned = Boolean(d.pinned); + } + return m; + }; + + PinAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.pinned != null && m.hasOwnProperty("pinned")) { + d.pinned = m.pinned; + if (o.oneofs) + d._pinned = "pinned"; + } + return d; + }; + + PinAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PinAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33153,7 +73961,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PnForLidChatAction.prototype.pnJid = ""; + PnForLidChatAction.prototype.pnJid = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PnForLidChatAction.prototype, "_pnJid", { + get: $util.oneOfGetter($oneOfFields = ["pnJid"]), + set: $util.oneOfSetter($oneOfFields) + }); PnForLidChatAction.create = function create(properties) { return new PnForLidChatAction(properties); @@ -33188,6 +74004,32 @@ export const proto = $root.proto = (() => { return m; }; + PnForLidChatAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PnForLidChatAction) + return d; + var m = new $root.proto.SyncActionValue.PnForLidChatAction(); + if (d.pnJid != null) { + m.pnJid = String(d.pnJid); + } + return m; + }; + + PnForLidChatAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.pnJid != null && m.hasOwnProperty("pnJid")) { + d.pnJid = m.pnJid; + if (o.oneofs) + d._pnJid = "pnJid"; + } + return d; + }; + + PnForLidChatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PnForLidChatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33247,6 +74089,41 @@ export const proto = $root.proto = (() => { return m; }; + PrimaryFeature.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PrimaryFeature) + return d; + var m = new $root.proto.SyncActionValue.PrimaryFeature(); + if (d.flags) { + if (!Array.isArray(d.flags)) + throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected"); + m.flags = []; + for (var i = 0; i < d.flags.length; ++i) { + m.flags[i] = String(d.flags[i]); + } + } + return m; + }; + + PrimaryFeature.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.flags = []; + } + if (m.flags && m.flags.length) { + d.flags = []; + for (var j = 0; j < m.flags.length; ++j) { + d.flags[j] = m.flags[j]; + } + } + return d; + }; + + PrimaryFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PrimaryFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33266,7 +74143,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PrimaryVersionAction.prototype.version = ""; + PrimaryVersionAction.prototype.version = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PrimaryVersionAction.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); PrimaryVersionAction.create = function create(properties) { return new PrimaryVersionAction(properties); @@ -33301,6 +74186,32 @@ export const proto = $root.proto = (() => { return m; }; + PrimaryVersionAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PrimaryVersionAction) + return d; + var m = new $root.proto.SyncActionValue.PrimaryVersionAction(); + if (d.version != null) { + m.version = String(d.version); + } + return m; + }; + + PrimaryVersionAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.version != null && m.hasOwnProperty("version")) { + d.version = m.version; + if (o.oneofs) + d._version = "version"; + } + return d; + }; + + PrimaryVersionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PrimaryVersionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33320,7 +74231,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PrivacySettingDisableLinkPreviewsAction.prototype.isPreviewsDisabled = false; + PrivacySettingDisableLinkPreviewsAction.prototype.isPreviewsDisabled = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PrivacySettingDisableLinkPreviewsAction.prototype, "_isPreviewsDisabled", { + get: $util.oneOfGetter($oneOfFields = ["isPreviewsDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); PrivacySettingDisableLinkPreviewsAction.create = function create(properties) { return new PrivacySettingDisableLinkPreviewsAction(properties); @@ -33355,6 +74274,32 @@ export const proto = $root.proto = (() => { return m; }; + PrivacySettingDisableLinkPreviewsAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction) + return d; + var m = new $root.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction(); + if (d.isPreviewsDisabled != null) { + m.isPreviewsDisabled = Boolean(d.isPreviewsDisabled); + } + return m; + }; + + PrivacySettingDisableLinkPreviewsAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isPreviewsDisabled != null && m.hasOwnProperty("isPreviewsDisabled")) { + d.isPreviewsDisabled = m.isPreviewsDisabled; + if (o.oneofs) + d._isPreviewsDisabled = "isPreviewsDisabled"; + } + return d; + }; + + PrivacySettingDisableLinkPreviewsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PrivacySettingDisableLinkPreviewsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33374,7 +74319,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PrivacySettingRelayAllCalls.prototype.isEnabled = false; + PrivacySettingRelayAllCalls.prototype.isEnabled = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PrivacySettingRelayAllCalls.prototype, "_isEnabled", { + get: $util.oneOfGetter($oneOfFields = ["isEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); PrivacySettingRelayAllCalls.create = function create(properties) { return new PrivacySettingRelayAllCalls(properties); @@ -33409,6 +74362,32 @@ export const proto = $root.proto = (() => { return m; }; + PrivacySettingRelayAllCalls.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PrivacySettingRelayAllCalls) + return d; + var m = new $root.proto.SyncActionValue.PrivacySettingRelayAllCalls(); + if (d.isEnabled != null) { + m.isEnabled = Boolean(d.isEnabled); + } + return m; + }; + + PrivacySettingRelayAllCalls.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isEnabled != null && m.hasOwnProperty("isEnabled")) { + d.isEnabled = m.isEnabled; + if (o.oneofs) + d._isEnabled = "isEnabled"; + } + return d; + }; + + PrivacySettingRelayAllCalls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PrivacySettingRelayAllCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33428,7 +74407,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - PushNameSetting.prototype.name = ""; + PushNameSetting.prototype.name = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PushNameSetting.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); PushNameSetting.create = function create(properties) { return new PushNameSetting(properties); @@ -33463,6 +74450,32 @@ export const proto = $root.proto = (() => { return m; }; + PushNameSetting.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.PushNameSetting) + return d; + var m = new $root.proto.SyncActionValue.PushNameSetting(); + if (d.name != null) { + m.name = String(d.name); + } + return m; + }; + + PushNameSetting.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.name != null && m.hasOwnProperty("name")) { + d.name = m.name; + if (o.oneofs) + d._name = "name"; + } + return d; + }; + + PushNameSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + PushNameSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33483,11 +74496,37 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - QuickReplyAction.prototype.shortcut = ""; - QuickReplyAction.prototype.message = ""; + QuickReplyAction.prototype.shortcut = null; + QuickReplyAction.prototype.message = null; QuickReplyAction.prototype.keywords = $util.emptyArray; - QuickReplyAction.prototype.count = 0; - QuickReplyAction.prototype.deleted = false; + QuickReplyAction.prototype.count = null; + QuickReplyAction.prototype.deleted = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QuickReplyAction.prototype, "_shortcut", { + get: $util.oneOfGetter($oneOfFields = ["shortcut"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QuickReplyAction.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QuickReplyAction.prototype, "_count", { + get: $util.oneOfGetter($oneOfFields = ["count"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QuickReplyAction.prototype, "_deleted", { + get: $util.oneOfGetter($oneOfFields = ["deleted"]), + set: $util.oneOfSetter($oneOfFields) + }); QuickReplyAction.create = function create(properties) { return new QuickReplyAction(properties); @@ -33550,6 +74589,73 @@ export const proto = $root.proto = (() => { return m; }; + QuickReplyAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.QuickReplyAction) + return d; + var m = new $root.proto.SyncActionValue.QuickReplyAction(); + if (d.shortcut != null) { + m.shortcut = String(d.shortcut); + } + if (d.message != null) { + m.message = String(d.message); + } + if (d.keywords) { + if (!Array.isArray(d.keywords)) + throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected"); + m.keywords = []; + for (var i = 0; i < d.keywords.length; ++i) { + m.keywords[i] = String(d.keywords[i]); + } + } + if (d.count != null) { + m.count = d.count | 0; + } + if (d.deleted != null) { + m.deleted = Boolean(d.deleted); + } + return m; + }; + + QuickReplyAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.keywords = []; + } + if (m.shortcut != null && m.hasOwnProperty("shortcut")) { + d.shortcut = m.shortcut; + if (o.oneofs) + d._shortcut = "shortcut"; + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = m.message; + if (o.oneofs) + d._message = "message"; + } + if (m.keywords && m.keywords.length) { + d.keywords = []; + for (var j = 0; j < m.keywords.length; ++j) { + d.keywords[j] = m.keywords[j]; + } + } + if (m.count != null && m.hasOwnProperty("count")) { + d.count = m.count; + if (o.oneofs) + d._count = "count"; + } + if (m.deleted != null && m.hasOwnProperty("deleted")) { + d.deleted = m.deleted; + if (o.oneofs) + d._deleted = "deleted"; + } + return d; + }; + + QuickReplyAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + QuickReplyAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33609,6 +74715,43 @@ export const proto = $root.proto = (() => { return m; }; + RecentEmojiWeightsAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.RecentEmojiWeightsAction) + return d; + var m = new $root.proto.SyncActionValue.RecentEmojiWeightsAction(); + if (d.weights) { + if (!Array.isArray(d.weights)) + throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected"); + m.weights = []; + for (var i = 0; i < d.weights.length; ++i) { + if (typeof d.weights[i] !== "object") + throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: object expected"); + m.weights[i] = $root.proto.RecentEmojiWeight.fromObject(d.weights[i]); + } + } + return m; + }; + + RecentEmojiWeightsAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.weights = []; + } + if (m.weights && m.weights.length) { + d.weights = []; + for (var j = 0; j < m.weights.length; ++j) { + d.weights[j] = $root.proto.RecentEmojiWeight.toObject(m.weights[j], o); + } + } + return d; + }; + + RecentEmojiWeightsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RecentEmojiWeightsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33628,7 +74771,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - RemoveRecentStickerAction.prototype.lastStickerSentTs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + RemoveRecentStickerAction.prototype.lastStickerSentTs = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RemoveRecentStickerAction.prototype, "_lastStickerSentTs", { + get: $util.oneOfGetter($oneOfFields = ["lastStickerSentTs"]), + set: $util.oneOfSetter($oneOfFields) + }); RemoveRecentStickerAction.create = function create(properties) { return new RemoveRecentStickerAction(properties); @@ -33663,6 +74814,42 @@ export const proto = $root.proto = (() => { return m; }; + RemoveRecentStickerAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.RemoveRecentStickerAction) + return d; + var m = new $root.proto.SyncActionValue.RemoveRecentStickerAction(); + if (d.lastStickerSentTs != null) { + if ($util.Long) + (m.lastStickerSentTs = $util.Long.fromValue(d.lastStickerSentTs)).unsigned = false; + else if (typeof d.lastStickerSentTs === "string") + m.lastStickerSentTs = parseInt(d.lastStickerSentTs, 10); + else if (typeof d.lastStickerSentTs === "number") + m.lastStickerSentTs = d.lastStickerSentTs; + else if (typeof d.lastStickerSentTs === "object") + m.lastStickerSentTs = new $util.LongBits(d.lastStickerSentTs.low >>> 0, d.lastStickerSentTs.high >>> 0).toNumber(); + } + return m; + }; + + RemoveRecentStickerAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.lastStickerSentTs != null && m.hasOwnProperty("lastStickerSentTs")) { + if (typeof m.lastStickerSentTs === "number") + d.lastStickerSentTs = o.longs === String ? String(m.lastStickerSentTs) : m.lastStickerSentTs; + else + d.lastStickerSentTs = o.longs === String ? $util.Long.prototype.toString.call(m.lastStickerSentTs) : o.longs === Number ? new $util.LongBits(m.lastStickerSentTs.low >>> 0, m.lastStickerSentTs.high >>> 0).toNumber() : m.lastStickerSentTs; + if (o.oneofs) + d._lastStickerSentTs = "lastStickerSentTs"; + } + return d; + }; + + RemoveRecentStickerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + RemoveRecentStickerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33682,7 +74869,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SecurityNotificationSetting.prototype.showNotification = false; + SecurityNotificationSetting.prototype.showNotification = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SecurityNotificationSetting.prototype, "_showNotification", { + get: $util.oneOfGetter($oneOfFields = ["showNotification"]), + set: $util.oneOfSetter($oneOfFields) + }); SecurityNotificationSetting.create = function create(properties) { return new SecurityNotificationSetting(properties); @@ -33717,6 +74912,32 @@ export const proto = $root.proto = (() => { return m; }; + SecurityNotificationSetting.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.SecurityNotificationSetting) + return d; + var m = new $root.proto.SyncActionValue.SecurityNotificationSetting(); + if (d.showNotification != null) { + m.showNotification = Boolean(d.showNotification); + } + return m; + }; + + SecurityNotificationSetting.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.showNotification != null && m.hasOwnProperty("showNotification")) { + d.showNotification = m.showNotification; + if (o.oneofs) + d._showNotification = "showNotification"; + } + return d; + }; + + SecurityNotificationSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SecurityNotificationSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33736,7 +74957,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - StarAction.prototype.starred = false; + StarAction.prototype.starred = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StarAction.prototype, "_starred", { + get: $util.oneOfGetter($oneOfFields = ["starred"]), + set: $util.oneOfSetter($oneOfFields) + }); StarAction.create = function create(properties) { return new StarAction(properties); @@ -33771,6 +75000,32 @@ export const proto = $root.proto = (() => { return m; }; + StarAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.StarAction) + return d; + var m = new $root.proto.SyncActionValue.StarAction(); + if (d.starred != null) { + m.starred = Boolean(d.starred); + } + return m; + }; + + StarAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.starred != null && m.hasOwnProperty("starred")) { + d.starred = m.starred; + if (o.oneofs) + d._starred = "starred"; + } + return d; + }; + + StarAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StarAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33791,9 +75046,17 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - StatusPrivacyAction.prototype.mode = 0; + StatusPrivacyAction.prototype.mode = null; StatusPrivacyAction.prototype.userJid = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StatusPrivacyAction.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + StatusPrivacyAction.create = function create(properties) { return new StatusPrivacyAction(properties); }; @@ -33837,6 +75100,66 @@ export const proto = $root.proto = (() => { return m; }; + StatusPrivacyAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.StatusPrivacyAction) + return d; + var m = new $root.proto.SyncActionValue.StatusPrivacyAction(); + switch (d.mode) { + default: + if (typeof d.mode === "number") { + m.mode = d.mode; + break; + } + break; + case "ALLOW_LIST": + case 0: + m.mode = 0; + break; + case "DENY_LIST": + case 1: + m.mode = 1; + break; + case "CONTACTS": + case 2: + m.mode = 2; + break; + } + if (d.userJid) { + if (!Array.isArray(d.userJid)) + throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected"); + m.userJid = []; + for (var i = 0; i < d.userJid.length; ++i) { + m.userJid[i] = String(d.userJid[i]); + } + } + return m; + }; + + StatusPrivacyAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.userJid = []; + } + if (m.mode != null && m.hasOwnProperty("mode")) { + d.mode = o.enums === String ? $root.proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode[m.mode] === undefined ? m.mode : $root.proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode[m.mode] : m.mode; + if (o.oneofs) + d._mode = "mode"; + } + if (m.userJid && m.userJid.length) { + d.userJid = []; + for (var j = 0; j < m.userJid.length; ++j) { + d.userJid[j] = m.userJid[j]; + } + } + return d; + }; + + StatusPrivacyAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StatusPrivacyAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33864,17 +75187,85 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - StickerAction.prototype.url = ""; - StickerAction.prototype.fileEncSha256 = $util.newBuffer([]); - StickerAction.prototype.mediaKey = $util.newBuffer([]); - StickerAction.prototype.mimetype = ""; - StickerAction.prototype.height = 0; - StickerAction.prototype.width = 0; - StickerAction.prototype.directPath = ""; - StickerAction.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - StickerAction.prototype.isFavorite = false; - StickerAction.prototype.deviceIdHint = 0; - StickerAction.prototype.isLottie = false; + StickerAction.prototype.url = null; + StickerAction.prototype.fileEncSha256 = null; + StickerAction.prototype.mediaKey = null; + StickerAction.prototype.mimetype = null; + StickerAction.prototype.height = null; + StickerAction.prototype.width = null; + StickerAction.prototype.directPath = null; + StickerAction.prototype.fileLength = null; + StickerAction.prototype.isFavorite = null; + StickerAction.prototype.deviceIdHint = null; + StickerAction.prototype.isLottie = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_fileEncSha256", { + get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_mediaKey", { + get: $util.oneOfGetter($oneOfFields = ["mediaKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_mimetype", { + get: $util.oneOfGetter($oneOfFields = ["mimetype"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_height", { + get: $util.oneOfGetter($oneOfFields = ["height"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_width", { + get: $util.oneOfGetter($oneOfFields = ["width"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_directPath", { + get: $util.oneOfGetter($oneOfFields = ["directPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_fileLength", { + get: $util.oneOfGetter($oneOfFields = ["fileLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_isFavorite", { + get: $util.oneOfGetter($oneOfFields = ["isFavorite"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_deviceIdHint", { + get: $util.oneOfGetter($oneOfFields = ["deviceIdHint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StickerAction.prototype, "_isLottie", { + get: $util.oneOfGetter($oneOfFields = ["isLottie"]), + set: $util.oneOfSetter($oneOfFields) + }); StickerAction.create = function create(properties) { return new StickerAction(properties); @@ -33969,6 +75360,128 @@ export const proto = $root.proto = (() => { return m; }; + StickerAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.StickerAction) + return d; + var m = new $root.proto.SyncActionValue.StickerAction(); + if (d.url != null) { + m.url = String(d.url); + } + if (d.fileEncSha256 != null) { + if (typeof d.fileEncSha256 === "string") + $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0); + else if (d.fileEncSha256.length >= 0) + m.fileEncSha256 = d.fileEncSha256; + } + if (d.mediaKey != null) { + if (typeof d.mediaKey === "string") + $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0); + else if (d.mediaKey.length >= 0) + m.mediaKey = d.mediaKey; + } + if (d.mimetype != null) { + m.mimetype = String(d.mimetype); + } + if (d.height != null) { + m.height = d.height >>> 0; + } + if (d.width != null) { + m.width = d.width >>> 0; + } + if (d.directPath != null) { + m.directPath = String(d.directPath); + } + if (d.fileLength != null) { + if ($util.Long) + (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true; + else if (typeof d.fileLength === "string") + m.fileLength = parseInt(d.fileLength, 10); + else if (typeof d.fileLength === "number") + m.fileLength = d.fileLength; + else if (typeof d.fileLength === "object") + m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true); + } + if (d.isFavorite != null) { + m.isFavorite = Boolean(d.isFavorite); + } + if (d.deviceIdHint != null) { + m.deviceIdHint = d.deviceIdHint >>> 0; + } + if (d.isLottie != null) { + m.isLottie = Boolean(d.isLottie); + } + return m; + }; + + StickerAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.url != null && m.hasOwnProperty("url")) { + d.url = m.url; + if (o.oneofs) + d._url = "url"; + } + if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) { + d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256; + if (o.oneofs) + d._fileEncSha256 = "fileEncSha256"; + } + if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) { + d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey; + if (o.oneofs) + d._mediaKey = "mediaKey"; + } + if (m.mimetype != null && m.hasOwnProperty("mimetype")) { + d.mimetype = m.mimetype; + if (o.oneofs) + d._mimetype = "mimetype"; + } + if (m.height != null && m.hasOwnProperty("height")) { + d.height = m.height; + if (o.oneofs) + d._height = "height"; + } + if (m.width != null && m.hasOwnProperty("width")) { + d.width = m.width; + if (o.oneofs) + d._width = "width"; + } + if (m.directPath != null && m.hasOwnProperty("directPath")) { + d.directPath = m.directPath; + if (o.oneofs) + d._directPath = "directPath"; + } + if (m.fileLength != null && m.hasOwnProperty("fileLength")) { + if (typeof m.fileLength === "number") + d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; + else + d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + if (o.oneofs) + d._fileLength = "fileLength"; + } + if (m.isFavorite != null && m.hasOwnProperty("isFavorite")) { + d.isFavorite = m.isFavorite; + if (o.oneofs) + d._isFavorite = "isFavorite"; + } + if (m.deviceIdHint != null && m.hasOwnProperty("deviceIdHint")) { + d.deviceIdHint = m.deviceIdHint; + if (o.oneofs) + d._deviceIdHint = "deviceIdHint"; + } + if (m.isLottie != null && m.hasOwnProperty("isLottie")) { + d.isLottie = m.isLottie; + if (o.oneofs) + d._isLottie = "isLottie"; + } + return d; + }; + + StickerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + StickerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -33988,9 +75501,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SubscriptionAction.prototype.isDeactivated = false; - SubscriptionAction.prototype.isAutoRenewing = false; - SubscriptionAction.prototype.expirationDate = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SubscriptionAction.prototype.isDeactivated = null; + SubscriptionAction.prototype.isAutoRenewing = null; + SubscriptionAction.prototype.expirationDate = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SubscriptionAction.prototype, "_isDeactivated", { + get: $util.oneOfGetter($oneOfFields = ["isDeactivated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SubscriptionAction.prototype, "_isAutoRenewing", { + get: $util.oneOfGetter($oneOfFields = ["isAutoRenewing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SubscriptionAction.prototype, "_expirationDate", { + get: $util.oneOfGetter($oneOfFields = ["expirationDate"]), + set: $util.oneOfSetter($oneOfFields) + }); SubscriptionAction.create = function create(properties) { return new SubscriptionAction(properties); @@ -34037,6 +75570,58 @@ export const proto = $root.proto = (() => { return m; }; + SubscriptionAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.SubscriptionAction) + return d; + var m = new $root.proto.SyncActionValue.SubscriptionAction(); + if (d.isDeactivated != null) { + m.isDeactivated = Boolean(d.isDeactivated); + } + if (d.isAutoRenewing != null) { + m.isAutoRenewing = Boolean(d.isAutoRenewing); + } + if (d.expirationDate != null) { + if ($util.Long) + (m.expirationDate = $util.Long.fromValue(d.expirationDate)).unsigned = false; + else if (typeof d.expirationDate === "string") + m.expirationDate = parseInt(d.expirationDate, 10); + else if (typeof d.expirationDate === "number") + m.expirationDate = d.expirationDate; + else if (typeof d.expirationDate === "object") + m.expirationDate = new $util.LongBits(d.expirationDate.low >>> 0, d.expirationDate.high >>> 0).toNumber(); + } + return m; + }; + + SubscriptionAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isDeactivated != null && m.hasOwnProperty("isDeactivated")) { + d.isDeactivated = m.isDeactivated; + if (o.oneofs) + d._isDeactivated = "isDeactivated"; + } + if (m.isAutoRenewing != null && m.hasOwnProperty("isAutoRenewing")) { + d.isAutoRenewing = m.isAutoRenewing; + if (o.oneofs) + d._isAutoRenewing = "isAutoRenewing"; + } + if (m.expirationDate != null && m.hasOwnProperty("expirationDate")) { + if (typeof m.expirationDate === "number") + d.expirationDate = o.longs === String ? String(m.expirationDate) : m.expirationDate; + else + d.expirationDate = o.longs === String ? $util.Long.prototype.toString.call(m.expirationDate) : o.longs === Number ? new $util.LongBits(m.expirationDate.low >>> 0, m.expirationDate.high >>> 0).toNumber() : m.expirationDate; + if (o.oneofs) + d._expirationDate = "expirationDate"; + } + return d; + }; + + SubscriptionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SubscriptionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34057,7 +75642,21 @@ export const proto = $root.proto = (() => { } SyncActionMessage.prototype.key = null; - SyncActionMessage.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SyncActionMessage.prototype.timestamp = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionMessage.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionMessage.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncActionMessage.create = function create(properties) { return new SyncActionMessage(properties); @@ -34098,6 +75697,52 @@ export const proto = $root.proto = (() => { return m; }; + SyncActionMessage.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.SyncActionMessage) + return d; + var m = new $root.proto.SyncActionValue.SyncActionMessage(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); + } + return m; + }; + + SyncActionMessage.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + if (o.oneofs) + d._key = "key"; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + return d; + }; + + SyncActionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncActionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34118,10 +75763,24 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncActionMessageRange.prototype.lastMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - SyncActionMessageRange.prototype.lastSystemMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SyncActionMessageRange.prototype.lastMessageTimestamp = null; + SyncActionMessageRange.prototype.lastSystemMessageTimestamp = null; SyncActionMessageRange.prototype.messages = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionMessageRange.prototype, "_lastMessageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastMessageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncActionMessageRange.prototype, "_lastSystemMessageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastSystemMessageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + SyncActionMessageRange.create = function create(properties) { return new SyncActionMessageRange(properties); }; @@ -34171,6 +75830,79 @@ export const proto = $root.proto = (() => { return m; }; + SyncActionMessageRange.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.SyncActionMessageRange) + return d; + var m = new $root.proto.SyncActionValue.SyncActionMessageRange(); + if (d.lastMessageTimestamp != null) { + if ($util.Long) + (m.lastMessageTimestamp = $util.Long.fromValue(d.lastMessageTimestamp)).unsigned = false; + else if (typeof d.lastMessageTimestamp === "string") + m.lastMessageTimestamp = parseInt(d.lastMessageTimestamp, 10); + else if (typeof d.lastMessageTimestamp === "number") + m.lastMessageTimestamp = d.lastMessageTimestamp; + else if (typeof d.lastMessageTimestamp === "object") + m.lastMessageTimestamp = new $util.LongBits(d.lastMessageTimestamp.low >>> 0, d.lastMessageTimestamp.high >>> 0).toNumber(); + } + if (d.lastSystemMessageTimestamp != null) { + if ($util.Long) + (m.lastSystemMessageTimestamp = $util.Long.fromValue(d.lastSystemMessageTimestamp)).unsigned = false; + else if (typeof d.lastSystemMessageTimestamp === "string") + m.lastSystemMessageTimestamp = parseInt(d.lastSystemMessageTimestamp, 10); + else if (typeof d.lastSystemMessageTimestamp === "number") + m.lastSystemMessageTimestamp = d.lastSystemMessageTimestamp; + else if (typeof d.lastSystemMessageTimestamp === "object") + m.lastSystemMessageTimestamp = new $util.LongBits(d.lastSystemMessageTimestamp.low >>> 0, d.lastSystemMessageTimestamp.high >>> 0).toNumber(); + } + if (d.messages) { + if (!Array.isArray(d.messages)) + throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected"); + m.messages = []; + for (var i = 0; i < d.messages.length; ++i) { + if (typeof d.messages[i] !== "object") + throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: object expected"); + m.messages[i] = $root.proto.SyncActionValue.SyncActionMessage.fromObject(d.messages[i]); + } + } + return m; + }; + + SyncActionMessageRange.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.messages = []; + } + if (m.lastMessageTimestamp != null && m.hasOwnProperty("lastMessageTimestamp")) { + if (typeof m.lastMessageTimestamp === "number") + d.lastMessageTimestamp = o.longs === String ? String(m.lastMessageTimestamp) : m.lastMessageTimestamp; + else + d.lastMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.lastMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.lastMessageTimestamp.low >>> 0, m.lastMessageTimestamp.high >>> 0).toNumber() : m.lastMessageTimestamp; + if (o.oneofs) + d._lastMessageTimestamp = "lastMessageTimestamp"; + } + if (m.lastSystemMessageTimestamp != null && m.hasOwnProperty("lastSystemMessageTimestamp")) { + if (typeof m.lastSystemMessageTimestamp === "number") + d.lastSystemMessageTimestamp = o.longs === String ? String(m.lastSystemMessageTimestamp) : m.lastSystemMessageTimestamp; + else + d.lastSystemMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.lastSystemMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.lastSystemMessageTimestamp.low >>> 0, m.lastSystemMessageTimestamp.high >>> 0).toNumber() : m.lastSystemMessageTimestamp; + if (o.oneofs) + d._lastSystemMessageTimestamp = "lastSystemMessageTimestamp"; + } + if (m.messages && m.messages.length) { + d.messages = []; + for (var j = 0; j < m.messages.length; ++j) { + d.messages[j] = $root.proto.SyncActionValue.SyncActionMessage.toObject(m.messages[j], o); + } + } + return d; + }; + + SyncActionMessageRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncActionMessageRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34190,7 +75922,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - TimeFormatAction.prototype.isTwentyFourHourFormatEnabled = false; + TimeFormatAction.prototype.isTwentyFourHourFormatEnabled = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TimeFormatAction.prototype, "_isTwentyFourHourFormatEnabled", { + get: $util.oneOfGetter($oneOfFields = ["isTwentyFourHourFormatEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); TimeFormatAction.create = function create(properties) { return new TimeFormatAction(properties); @@ -34225,6 +75965,32 @@ export const proto = $root.proto = (() => { return m; }; + TimeFormatAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.TimeFormatAction) + return d; + var m = new $root.proto.SyncActionValue.TimeFormatAction(); + if (d.isTwentyFourHourFormatEnabled != null) { + m.isTwentyFourHourFormatEnabled = Boolean(d.isTwentyFourHourFormatEnabled); + } + return m; + }; + + TimeFormatAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.isTwentyFourHourFormatEnabled != null && m.hasOwnProperty("isTwentyFourHourFormatEnabled")) { + d.isTwentyFourHourFormatEnabled = m.isTwentyFourHourFormatEnabled; + if (o.oneofs) + d._isTwentyFourHourFormatEnabled = "isTwentyFourHourFormatEnabled"; + } + return d; + }; + + TimeFormatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TimeFormatAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34244,7 +76010,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UnarchiveChatsSetting.prototype.unarchiveChats = false; + UnarchiveChatsSetting.prototype.unarchiveChats = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UnarchiveChatsSetting.prototype, "_unarchiveChats", { + get: $util.oneOfGetter($oneOfFields = ["unarchiveChats"]), + set: $util.oneOfSetter($oneOfFields) + }); UnarchiveChatsSetting.create = function create(properties) { return new UnarchiveChatsSetting(properties); @@ -34279,6 +76053,32 @@ export const proto = $root.proto = (() => { return m; }; + UnarchiveChatsSetting.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.UnarchiveChatsSetting) + return d; + var m = new $root.proto.SyncActionValue.UnarchiveChatsSetting(); + if (d.unarchiveChats != null) { + m.unarchiveChats = Boolean(d.unarchiveChats); + } + return m; + }; + + UnarchiveChatsSetting.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.unarchiveChats != null && m.hasOwnProperty("unarchiveChats")) { + d.unarchiveChats = m.unarchiveChats; + if (o.oneofs) + d._unarchiveChats = "unarchiveChats"; + } + return d; + }; + + UnarchiveChatsSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UnarchiveChatsSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34298,7 +76098,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UserStatusMuteAction.prototype.muted = false; + UserStatusMuteAction.prototype.muted = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserStatusMuteAction.prototype, "_muted", { + get: $util.oneOfGetter($oneOfFields = ["muted"]), + set: $util.oneOfSetter($oneOfFields) + }); UserStatusMuteAction.create = function create(properties) { return new UserStatusMuteAction(properties); @@ -34333,6 +76141,32 @@ export const proto = $root.proto = (() => { return m; }; + UserStatusMuteAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.UserStatusMuteAction) + return d; + var m = new $root.proto.SyncActionValue.UserStatusMuteAction(); + if (d.muted != null) { + m.muted = Boolean(d.muted); + } + return m; + }; + + UserStatusMuteAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.muted != null && m.hasOwnProperty("muted")) { + d.muted = m.muted; + if (o.oneofs) + d._muted = "muted"; + } + return d; + }; + + UserStatusMuteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UserStatusMuteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34352,7 +76186,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UsernameChatStartModeAction.prototype.chatStartMode = 1; + UsernameChatStartModeAction.prototype.chatStartMode = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UsernameChatStartModeAction.prototype, "_chatStartMode", { + get: $util.oneOfGetter($oneOfFields = ["chatStartMode"]), + set: $util.oneOfSetter($oneOfFields) + }); UsernameChatStartModeAction.create = function create(properties) { return new UsernameChatStartModeAction(properties); @@ -34387,6 +76229,45 @@ export const proto = $root.proto = (() => { return m; }; + UsernameChatStartModeAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.UsernameChatStartModeAction) + return d; + var m = new $root.proto.SyncActionValue.UsernameChatStartModeAction(); + switch (d.chatStartMode) { + default: + if (typeof d.chatStartMode === "number") { + m.chatStartMode = d.chatStartMode; + break; + } + break; + case "LID": + case 1: + m.chatStartMode = 1; + break; + case "PN": + case 2: + m.chatStartMode = 2; + break; + } + return m; + }; + + UsernameChatStartModeAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.chatStartMode != null && m.hasOwnProperty("chatStartMode")) { + d.chatStartMode = o.enums === String ? $root.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[m.chatStartMode] === undefined ? m.chatStartMode : $root.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[m.chatStartMode] : m.chatStartMode; + if (o.oneofs) + d._chatStartMode = "chatStartMode"; + } + return d; + }; + + UsernameChatStartModeAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UsernameChatStartModeAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34413,7 +76294,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WaffleAccountLinkStateAction.prototype.linkState = 0; + WaffleAccountLinkStateAction.prototype.linkState = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WaffleAccountLinkStateAction.prototype, "_linkState", { + get: $util.oneOfGetter($oneOfFields = ["linkState"]), + set: $util.oneOfSetter($oneOfFields) + }); WaffleAccountLinkStateAction.create = function create(properties) { return new WaffleAccountLinkStateAction(properties); @@ -34448,6 +76337,41 @@ export const proto = $root.proto = (() => { return m; }; + WaffleAccountLinkStateAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.WaffleAccountLinkStateAction) + return d; + var m = new $root.proto.SyncActionValue.WaffleAccountLinkStateAction(); + switch (d.linkState) { + default: + if (typeof d.linkState === "number") { + m.linkState = d.linkState; + break; + } + break; + case "ACTIVE": + case 0: + m.linkState = 0; + break; + } + return m; + }; + + WaffleAccountLinkStateAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.linkState != null && m.hasOwnProperty("linkState")) { + d.linkState = o.enums === String ? $root.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[m.linkState] === undefined ? m.linkState : $root.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[m.linkState] : m.linkState; + if (o.oneofs) + d._linkState = "linkState"; + } + return d; + }; + + WaffleAccountLinkStateAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WaffleAccountLinkStateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34473,7 +76397,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WamoUserIdentifierAction.prototype.identifier = ""; + WamoUserIdentifierAction.prototype.identifier = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WamoUserIdentifierAction.prototype, "_identifier", { + get: $util.oneOfGetter($oneOfFields = ["identifier"]), + set: $util.oneOfSetter($oneOfFields) + }); WamoUserIdentifierAction.create = function create(properties) { return new WamoUserIdentifierAction(properties); @@ -34508,6 +76440,32 @@ export const proto = $root.proto = (() => { return m; }; + WamoUserIdentifierAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncActionValue.WamoUserIdentifierAction) + return d; + var m = new $root.proto.SyncActionValue.WamoUserIdentifierAction(); + if (d.identifier != null) { + m.identifier = String(d.identifier); + } + return m; + }; + + WamoUserIdentifierAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.identifier != null && m.hasOwnProperty("identifier")) { + d.identifier = m.identifier; + if (o.oneofs) + d._identifier = "identifier"; + } + return d; + }; + + WamoUserIdentifierAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WamoUserIdentifierAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34530,7 +76488,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncdIndex.prototype.blob = $util.newBuffer([]); + SyncdIndex.prototype.blob = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdIndex.prototype, "_blob", { + get: $util.oneOfGetter($oneOfFields = ["blob"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncdIndex.create = function create(properties) { return new SyncdIndex(properties); @@ -34565,6 +76531,35 @@ export const proto = $root.proto = (() => { return m; }; + SyncdIndex.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdIndex) + return d; + var m = new $root.proto.SyncdIndex(); + if (d.blob != null) { + if (typeof d.blob === "string") + $util.base64.decode(d.blob, m.blob = $util.newBuffer($util.base64.length(d.blob)), 0); + else if (d.blob.length >= 0) + m.blob = d.blob; + } + return m; + }; + + SyncdIndex.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.blob != null && m.hasOwnProperty("blob")) { + d.blob = o.bytes === String ? $util.base64.encode(m.blob, 0, m.blob.length) : o.bytes === Array ? Array.prototype.slice.call(m.blob) : m.blob; + if (o.oneofs) + d._blob = "blob"; + } + return d; + }; + + SyncdIndex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdIndex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34584,9 +76579,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncdMutation.prototype.operation = 0; + SyncdMutation.prototype.operation = null; SyncdMutation.prototype.record = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdMutation.prototype, "_operation", { + get: $util.oneOfGetter($oneOfFields = ["operation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdMutation.prototype, "_record", { + get: $util.oneOfGetter($oneOfFields = ["record"]), + set: $util.oneOfSetter($oneOfFields) + }); + SyncdMutation.create = function create(properties) { return new SyncdMutation(properties); }; @@ -34626,6 +76635,55 @@ export const proto = $root.proto = (() => { return m; }; + SyncdMutation.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdMutation) + return d; + var m = new $root.proto.SyncdMutation(); + switch (d.operation) { + default: + if (typeof d.operation === "number") { + m.operation = d.operation; + break; + } + break; + case "SET": + case 0: + m.operation = 0; + break; + case "REMOVE": + case 1: + m.operation = 1; + break; + } + if (d.record != null) { + if (typeof d.record !== "object") + throw TypeError(".proto.SyncdMutation.record: object expected"); + m.record = $root.proto.SyncdRecord.fromObject(d.record); + } + return m; + }; + + SyncdMutation.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.operation != null && m.hasOwnProperty("operation")) { + d.operation = o.enums === String ? $root.proto.SyncdMutation.SyncdOperation[m.operation] === undefined ? m.operation : $root.proto.SyncdMutation.SyncdOperation[m.operation] : m.operation; + if (o.oneofs) + d._operation = "operation"; + } + if (m.record != null && m.hasOwnProperty("record")) { + d.record = $root.proto.SyncdRecord.toObject(m.record, o); + if (o.oneofs) + d._record = "record"; + } + return d; + }; + + SyncdMutation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdMutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34692,6 +76750,43 @@ export const proto = $root.proto = (() => { return m; }; + SyncdMutations.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdMutations) + return d; + var m = new $root.proto.SyncdMutations(); + if (d.mutations) { + if (!Array.isArray(d.mutations)) + throw TypeError(".proto.SyncdMutations.mutations: array expected"); + m.mutations = []; + for (var i = 0; i < d.mutations.length; ++i) { + if (typeof d.mutations[i] !== "object") + throw TypeError(".proto.SyncdMutations.mutations: object expected"); + m.mutations[i] = $root.proto.SyncdMutation.fromObject(d.mutations[i]); + } + } + return m; + }; + + SyncdMutations.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.mutations = []; + } + if (m.mutations && m.mutations.length) { + d.mutations = []; + for (var j = 0; j < m.mutations.length; ++j) { + d.mutations[j] = $root.proto.SyncdMutation.toObject(m.mutations[j], o); + } + } + return d; + }; + + SyncdMutations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdMutations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34715,12 +76810,62 @@ export const proto = $root.proto = (() => { SyncdPatch.prototype.version = null; SyncdPatch.prototype.mutations = $util.emptyArray; SyncdPatch.prototype.externalMutations = null; - SyncdPatch.prototype.snapshotMac = $util.newBuffer([]); - SyncdPatch.prototype.patchMac = $util.newBuffer([]); + SyncdPatch.prototype.snapshotMac = null; + SyncdPatch.prototype.patchMac = null; SyncdPatch.prototype.keyId = null; SyncdPatch.prototype.exitCode = null; - SyncdPatch.prototype.deviceIndex = 0; - SyncdPatch.prototype.clientDebugData = $util.newBuffer([]); + SyncdPatch.prototype.deviceIndex = null; + SyncdPatch.prototype.clientDebugData = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_externalMutations", { + get: $util.oneOfGetter($oneOfFields = ["externalMutations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_snapshotMac", { + get: $util.oneOfGetter($oneOfFields = ["snapshotMac"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_patchMac", { + get: $util.oneOfGetter($oneOfFields = ["patchMac"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_keyId", { + get: $util.oneOfGetter($oneOfFields = ["keyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_exitCode", { + get: $util.oneOfGetter($oneOfFields = ["exitCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_deviceIndex", { + get: $util.oneOfGetter($oneOfFields = ["deviceIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdPatch.prototype, "_clientDebugData", { + get: $util.oneOfGetter($oneOfFields = ["clientDebugData"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncdPatch.create = function create(properties) { return new SyncdPatch(properties); @@ -34807,6 +76952,124 @@ export const proto = $root.proto = (() => { return m; }; + SyncdPatch.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdPatch) + return d; + var m = new $root.proto.SyncdPatch(); + if (d.version != null) { + if (typeof d.version !== "object") + throw TypeError(".proto.SyncdPatch.version: object expected"); + m.version = $root.proto.SyncdVersion.fromObject(d.version); + } + if (d.mutations) { + if (!Array.isArray(d.mutations)) + throw TypeError(".proto.SyncdPatch.mutations: array expected"); + m.mutations = []; + for (var i = 0; i < d.mutations.length; ++i) { + if (typeof d.mutations[i] !== "object") + throw TypeError(".proto.SyncdPatch.mutations: object expected"); + m.mutations[i] = $root.proto.SyncdMutation.fromObject(d.mutations[i]); + } + } + if (d.externalMutations != null) { + if (typeof d.externalMutations !== "object") + throw TypeError(".proto.SyncdPatch.externalMutations: object expected"); + m.externalMutations = $root.proto.ExternalBlobReference.fromObject(d.externalMutations); + } + if (d.snapshotMac != null) { + if (typeof d.snapshotMac === "string") + $util.base64.decode(d.snapshotMac, m.snapshotMac = $util.newBuffer($util.base64.length(d.snapshotMac)), 0); + else if (d.snapshotMac.length >= 0) + m.snapshotMac = d.snapshotMac; + } + if (d.patchMac != null) { + if (typeof d.patchMac === "string") + $util.base64.decode(d.patchMac, m.patchMac = $util.newBuffer($util.base64.length(d.patchMac)), 0); + else if (d.patchMac.length >= 0) + m.patchMac = d.patchMac; + } + if (d.keyId != null) { + if (typeof d.keyId !== "object") + throw TypeError(".proto.SyncdPatch.keyId: object expected"); + m.keyId = $root.proto.KeyId.fromObject(d.keyId); + } + if (d.exitCode != null) { + if (typeof d.exitCode !== "object") + throw TypeError(".proto.SyncdPatch.exitCode: object expected"); + m.exitCode = $root.proto.ExitCode.fromObject(d.exitCode); + } + if (d.deviceIndex != null) { + m.deviceIndex = d.deviceIndex >>> 0; + } + if (d.clientDebugData != null) { + if (typeof d.clientDebugData === "string") + $util.base64.decode(d.clientDebugData, m.clientDebugData = $util.newBuffer($util.base64.length(d.clientDebugData)), 0); + else if (d.clientDebugData.length >= 0) + m.clientDebugData = d.clientDebugData; + } + return m; + }; + + SyncdPatch.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.mutations = []; + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = $root.proto.SyncdVersion.toObject(m.version, o); + if (o.oneofs) + d._version = "version"; + } + if (m.mutations && m.mutations.length) { + d.mutations = []; + for (var j = 0; j < m.mutations.length; ++j) { + d.mutations[j] = $root.proto.SyncdMutation.toObject(m.mutations[j], o); + } + } + if (m.externalMutations != null && m.hasOwnProperty("externalMutations")) { + d.externalMutations = $root.proto.ExternalBlobReference.toObject(m.externalMutations, o); + if (o.oneofs) + d._externalMutations = "externalMutations"; + } + if (m.snapshotMac != null && m.hasOwnProperty("snapshotMac")) { + d.snapshotMac = o.bytes === String ? $util.base64.encode(m.snapshotMac, 0, m.snapshotMac.length) : o.bytes === Array ? Array.prototype.slice.call(m.snapshotMac) : m.snapshotMac; + if (o.oneofs) + d._snapshotMac = "snapshotMac"; + } + if (m.patchMac != null && m.hasOwnProperty("patchMac")) { + d.patchMac = o.bytes === String ? $util.base64.encode(m.patchMac, 0, m.patchMac.length) : o.bytes === Array ? Array.prototype.slice.call(m.patchMac) : m.patchMac; + if (o.oneofs) + d._patchMac = "patchMac"; + } + if (m.keyId != null && m.hasOwnProperty("keyId")) { + d.keyId = $root.proto.KeyId.toObject(m.keyId, o); + if (o.oneofs) + d._keyId = "keyId"; + } + if (m.exitCode != null && m.hasOwnProperty("exitCode")) { + d.exitCode = $root.proto.ExitCode.toObject(m.exitCode, o); + if (o.oneofs) + d._exitCode = "exitCode"; + } + if (m.deviceIndex != null && m.hasOwnProperty("deviceIndex")) { + d.deviceIndex = m.deviceIndex; + if (o.oneofs) + d._deviceIndex = "deviceIndex"; + } + if (m.clientDebugData != null && m.hasOwnProperty("clientDebugData")) { + d.clientDebugData = o.bytes === String ? $util.base64.encode(m.clientDebugData, 0, m.clientDebugData.length) : o.bytes === Array ? Array.prototype.slice.call(m.clientDebugData) : m.clientDebugData; + if (o.oneofs) + d._clientDebugData = "clientDebugData"; + } + return d; + }; + + SyncdPatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdPatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34830,6 +77093,26 @@ export const proto = $root.proto = (() => { SyncdRecord.prototype.value = null; SyncdRecord.prototype.keyId = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdRecord.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdRecord.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdRecord.prototype, "_keyId", { + get: $util.oneOfGetter($oneOfFields = ["keyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + SyncdRecord.create = function create(properties) { return new SyncdRecord(properties); }; @@ -34875,6 +77158,54 @@ export const proto = $root.proto = (() => { return m; }; + SyncdRecord.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdRecord) + return d; + var m = new $root.proto.SyncdRecord(); + if (d.index != null) { + if (typeof d.index !== "object") + throw TypeError(".proto.SyncdRecord.index: object expected"); + m.index = $root.proto.SyncdIndex.fromObject(d.index); + } + if (d.value != null) { + if (typeof d.value !== "object") + throw TypeError(".proto.SyncdRecord.value: object expected"); + m.value = $root.proto.SyncdValue.fromObject(d.value); + } + if (d.keyId != null) { + if (typeof d.keyId !== "object") + throw TypeError(".proto.SyncdRecord.keyId: object expected"); + m.keyId = $root.proto.KeyId.fromObject(d.keyId); + } + return m; + }; + + SyncdRecord.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.index != null && m.hasOwnProperty("index")) { + d.index = $root.proto.SyncdIndex.toObject(m.index, o); + if (o.oneofs) + d._index = "index"; + } + if (m.value != null && m.hasOwnProperty("value")) { + d.value = $root.proto.SyncdValue.toObject(m.value, o); + if (o.oneofs) + d._value = "value"; + } + if (m.keyId != null && m.hasOwnProperty("keyId")) { + d.keyId = $root.proto.KeyId.toObject(m.keyId, o); + if (o.oneofs) + d._keyId = "keyId"; + } + return d; + }; + + SyncdRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34897,9 +77228,29 @@ export const proto = $root.proto = (() => { SyncdSnapshot.prototype.version = null; SyncdSnapshot.prototype.records = $util.emptyArray; - SyncdSnapshot.prototype.mac = $util.newBuffer([]); + SyncdSnapshot.prototype.mac = null; SyncdSnapshot.prototype.keyId = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdSnapshot.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdSnapshot.prototype, "_mac", { + get: $util.oneOfGetter($oneOfFields = ["mac"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdSnapshot.prototype, "_keyId", { + get: $util.oneOfGetter($oneOfFields = ["keyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + SyncdSnapshot.create = function create(properties) { return new SyncdSnapshot(properties); }; @@ -34955,6 +77306,74 @@ export const proto = $root.proto = (() => { return m; }; + SyncdSnapshot.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdSnapshot) + return d; + var m = new $root.proto.SyncdSnapshot(); + if (d.version != null) { + if (typeof d.version !== "object") + throw TypeError(".proto.SyncdSnapshot.version: object expected"); + m.version = $root.proto.SyncdVersion.fromObject(d.version); + } + if (d.records) { + if (!Array.isArray(d.records)) + throw TypeError(".proto.SyncdSnapshot.records: array expected"); + m.records = []; + for (var i = 0; i < d.records.length; ++i) { + if (typeof d.records[i] !== "object") + throw TypeError(".proto.SyncdSnapshot.records: object expected"); + m.records[i] = $root.proto.SyncdRecord.fromObject(d.records[i]); + } + } + if (d.mac != null) { + if (typeof d.mac === "string") + $util.base64.decode(d.mac, m.mac = $util.newBuffer($util.base64.length(d.mac)), 0); + else if (d.mac.length >= 0) + m.mac = d.mac; + } + if (d.keyId != null) { + if (typeof d.keyId !== "object") + throw TypeError(".proto.SyncdSnapshot.keyId: object expected"); + m.keyId = $root.proto.KeyId.fromObject(d.keyId); + } + return m; + }; + + SyncdSnapshot.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.records = []; + } + if (m.version != null && m.hasOwnProperty("version")) { + d.version = $root.proto.SyncdVersion.toObject(m.version, o); + if (o.oneofs) + d._version = "version"; + } + if (m.records && m.records.length) { + d.records = []; + for (var j = 0; j < m.records.length; ++j) { + d.records[j] = $root.proto.SyncdRecord.toObject(m.records[j], o); + } + } + if (m.mac != null && m.hasOwnProperty("mac")) { + d.mac = o.bytes === String ? $util.base64.encode(m.mac, 0, m.mac.length) : o.bytes === Array ? Array.prototype.slice.call(m.mac) : m.mac; + if (o.oneofs) + d._mac = "mac"; + } + if (m.keyId != null && m.hasOwnProperty("keyId")) { + d.keyId = $root.proto.KeyId.toObject(m.keyId, o); + if (o.oneofs) + d._keyId = "keyId"; + } + return d; + }; + + SyncdSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -34974,7 +77393,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncdValue.prototype.blob = $util.newBuffer([]); + SyncdValue.prototype.blob = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdValue.prototype, "_blob", { + get: $util.oneOfGetter($oneOfFields = ["blob"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncdValue.create = function create(properties) { return new SyncdValue(properties); @@ -35009,6 +77436,35 @@ export const proto = $root.proto = (() => { return m; }; + SyncdValue.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdValue) + return d; + var m = new $root.proto.SyncdValue(); + if (d.blob != null) { + if (typeof d.blob === "string") + $util.base64.decode(d.blob, m.blob = $util.newBuffer($util.base64.length(d.blob)), 0); + else if (d.blob.length >= 0) + m.blob = d.blob; + } + return m; + }; + + SyncdValue.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.blob != null && m.hasOwnProperty("blob")) { + d.blob = o.bytes === String ? $util.base64.encode(m.blob, 0, m.blob.length) : o.bytes === Array ? Array.prototype.slice.call(m.blob) : m.blob; + if (o.oneofs) + d._blob = "blob"; + } + return d; + }; + + SyncdValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35028,7 +77484,15 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - SyncdVersion.prototype.version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + SyncdVersion.prototype.version = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SyncdVersion.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); SyncdVersion.create = function create(properties) { return new SyncdVersion(properties); @@ -35063,6 +77527,42 @@ export const proto = $root.proto = (() => { return m; }; + SyncdVersion.fromObject = function fromObject(d) { + if (d instanceof $root.proto.SyncdVersion) + return d; + var m = new $root.proto.SyncdVersion(); + if (d.version != null) { + if ($util.Long) + (m.version = $util.Long.fromValue(d.version)).unsigned = true; + else if (typeof d.version === "string") + m.version = parseInt(d.version, 10); + else if (typeof d.version === "number") + m.version = d.version; + else if (typeof d.version === "object") + m.version = new $util.LongBits(d.version.low >>> 0, d.version.high >>> 0).toNumber(true); + } + return m; + }; + + SyncdVersion.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.version != null && m.hasOwnProperty("version")) { + if (typeof m.version === "number") + d.version = o.longs === String ? String(m.version) : m.version; + else + d.version = o.longs === String ? $util.Long.prototype.toString.call(m.version) : o.longs === Number ? new $util.LongBits(m.version.low >>> 0, m.version.high >>> 0).toNumber(true) : m.version; + if (o.oneofs) + d._version = "version"; + } + return d; + }; + + SyncdVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SyncdVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35082,8 +77582,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - TapLinkAction.prototype.title = ""; - TapLinkAction.prototype.tapUrl = ""; + TapLinkAction.prototype.title = null; + TapLinkAction.prototype.tapUrl = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TapLinkAction.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TapLinkAction.prototype, "_tapUrl", { + get: $util.oneOfGetter($oneOfFields = ["tapUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); TapLinkAction.create = function create(properties) { return new TapLinkAction(properties); @@ -35124,6 +77638,40 @@ export const proto = $root.proto = (() => { return m; }; + TapLinkAction.fromObject = function fromObject(d) { + if (d instanceof $root.proto.TapLinkAction) + return d; + var m = new $root.proto.TapLinkAction(); + if (d.title != null) { + m.title = String(d.title); + } + if (d.tapUrl != null) { + m.tapUrl = String(d.tapUrl); + } + return m; + }; + + TapLinkAction.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.title != null && m.hasOwnProperty("title")) { + d.title = m.title; + if (o.oneofs) + d._title = "title"; + } + if (m.tapUrl != null && m.hasOwnProperty("tapUrl")) { + d.tapUrl = m.tapUrl; + if (o.oneofs) + d._tapUrl = "tapUrl"; + } + return d; + }; + + TapLinkAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TapLinkAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35143,13 +77691,19 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - TemplateButton.prototype.index = 0; + TemplateButton.prototype.index = null; TemplateButton.prototype.quickReplyButton = null; TemplateButton.prototype.urlButton = null; TemplateButton.prototype.callButton = null; let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(TemplateButton.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(TemplateButton.prototype, "button", { get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), set: $util.oneOfSetter($oneOfFields) @@ -35206,6 +77760,62 @@ export const proto = $root.proto = (() => { return m; }; + TemplateButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.TemplateButton) + return d; + var m = new $root.proto.TemplateButton(); + if (d.index != null) { + m.index = d.index >>> 0; + } + if (d.quickReplyButton != null) { + if (typeof d.quickReplyButton !== "object") + throw TypeError(".proto.TemplateButton.quickReplyButton: object expected"); + m.quickReplyButton = $root.proto.TemplateButton.QuickReplyButton.fromObject(d.quickReplyButton); + } + if (d.urlButton != null) { + if (typeof d.urlButton !== "object") + throw TypeError(".proto.TemplateButton.urlButton: object expected"); + m.urlButton = $root.proto.TemplateButton.URLButton.fromObject(d.urlButton); + } + if (d.callButton != null) { + if (typeof d.callButton !== "object") + throw TypeError(".proto.TemplateButton.callButton: object expected"); + m.callButton = $root.proto.TemplateButton.CallButton.fromObject(d.callButton); + } + return m; + }; + + TemplateButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.quickReplyButton != null && m.hasOwnProperty("quickReplyButton")) { + d.quickReplyButton = $root.proto.TemplateButton.QuickReplyButton.toObject(m.quickReplyButton, o); + if (o.oneofs) + d.button = "quickReplyButton"; + } + if (m.urlButton != null && m.hasOwnProperty("urlButton")) { + d.urlButton = $root.proto.TemplateButton.URLButton.toObject(m.urlButton, o); + if (o.oneofs) + d.button = "urlButton"; + } + if (m.callButton != null && m.hasOwnProperty("callButton")) { + d.callButton = $root.proto.TemplateButton.CallButton.toObject(m.callButton, o); + if (o.oneofs) + d.button = "callButton"; + } + if (m.index != null && m.hasOwnProperty("index")) { + d.index = m.index; + if (o.oneofs) + d._index = "index"; + } + return d; + }; + + TemplateButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TemplateButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35225,6 +77835,20 @@ export const proto = $root.proto = (() => { CallButton.prototype.displayText = null; CallButton.prototype.phoneNumber = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CallButton.prototype, "_phoneNumber", { + get: $util.oneOfGetter($oneOfFields = ["phoneNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + CallButton.create = function create(properties) { return new CallButton(properties); }; @@ -35264,6 +77888,44 @@ export const proto = $root.proto = (() => { return m; }; + CallButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.TemplateButton.CallButton) + return d; + var m = new $root.proto.TemplateButton.CallButton(); + if (d.displayText != null) { + if (typeof d.displayText !== "object") + throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected"); + m.displayText = $root.proto.Message.HighlyStructuredMessage.fromObject(d.displayText); + } + if (d.phoneNumber != null) { + if (typeof d.phoneNumber !== "object") + throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected"); + m.phoneNumber = $root.proto.Message.HighlyStructuredMessage.fromObject(d.phoneNumber); + } + return m; + }; + + CallButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = $root.proto.Message.HighlyStructuredMessage.toObject(m.displayText, o); + if (o.oneofs) + d._displayText = "displayText"; + } + if (m.phoneNumber != null && m.hasOwnProperty("phoneNumber")) { + d.phoneNumber = $root.proto.Message.HighlyStructuredMessage.toObject(m.phoneNumber, o); + if (o.oneofs) + d._phoneNumber = "phoneNumber"; + } + return d; + }; + + CallButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + CallButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35284,7 +77946,21 @@ export const proto = $root.proto = (() => { } QuickReplyButton.prototype.displayText = null; - QuickReplyButton.prototype.id = ""; + QuickReplyButton.prototype.id = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QuickReplyButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QuickReplyButton.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); QuickReplyButton.create = function create(properties) { return new QuickReplyButton(properties); @@ -35325,6 +78001,42 @@ export const proto = $root.proto = (() => { return m; }; + QuickReplyButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.TemplateButton.QuickReplyButton) + return d; + var m = new $root.proto.TemplateButton.QuickReplyButton(); + if (d.displayText != null) { + if (typeof d.displayText !== "object") + throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected"); + m.displayText = $root.proto.Message.HighlyStructuredMessage.fromObject(d.displayText); + } + if (d.id != null) { + m.id = String(d.id); + } + return m; + }; + + QuickReplyButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = $root.proto.Message.HighlyStructuredMessage.toObject(m.displayText, o); + if (o.oneofs) + d._displayText = "displayText"; + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = m.id; + if (o.oneofs) + d._id = "id"; + } + return d; + }; + + QuickReplyButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + QuickReplyButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35347,6 +78059,20 @@ export const proto = $root.proto = (() => { URLButton.prototype.displayText = null; URLButton.prototype.url = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(URLButton.prototype, "_displayText", { + get: $util.oneOfGetter($oneOfFields = ["displayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(URLButton.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + URLButton.create = function create(properties) { return new URLButton(properties); }; @@ -35386,6 +78112,44 @@ export const proto = $root.proto = (() => { return m; }; + URLButton.fromObject = function fromObject(d) { + if (d instanceof $root.proto.TemplateButton.URLButton) + return d; + var m = new $root.proto.TemplateButton.URLButton(); + if (d.displayText != null) { + if (typeof d.displayText !== "object") + throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected"); + m.displayText = $root.proto.Message.HighlyStructuredMessage.fromObject(d.displayText); + } + if (d.url != null) { + if (typeof d.url !== "object") + throw TypeError(".proto.TemplateButton.URLButton.url: object expected"); + m.url = $root.proto.Message.HighlyStructuredMessage.fromObject(d.url); + } + return m; + }; + + URLButton.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.displayText != null && m.hasOwnProperty("displayText")) { + d.displayText = $root.proto.Message.HighlyStructuredMessage.toObject(m.displayText, o); + if (o.oneofs) + d._displayText = "displayText"; + } + if (m.url != null && m.hasOwnProperty("url")) { + d.url = $root.proto.Message.HighlyStructuredMessage.toObject(m.url, o); + if (o.oneofs) + d._url = "url"; + } + return d; + }; + + URLButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + URLButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35448,6 +78212,43 @@ export const proto = $root.proto = (() => { return m; }; + UrlTrackingMap.fromObject = function fromObject(d) { + if (d instanceof $root.proto.UrlTrackingMap) + return d; + var m = new $root.proto.UrlTrackingMap(); + if (d.urlTrackingMapElements) { + if (!Array.isArray(d.urlTrackingMapElements)) + throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected"); + m.urlTrackingMapElements = []; + for (var i = 0; i < d.urlTrackingMapElements.length; ++i) { + if (typeof d.urlTrackingMapElements[i] !== "object") + throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: object expected"); + m.urlTrackingMapElements[i] = $root.proto.UrlTrackingMap.UrlTrackingMapElement.fromObject(d.urlTrackingMapElements[i]); + } + } + return m; + }; + + UrlTrackingMap.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.urlTrackingMapElements = []; + } + if (m.urlTrackingMapElements && m.urlTrackingMapElements.length) { + d.urlTrackingMapElements = []; + for (var j = 0; j < m.urlTrackingMapElements.length; ++j) { + d.urlTrackingMapElements[j] = $root.proto.UrlTrackingMap.UrlTrackingMapElement.toObject(m.urlTrackingMapElements[j], o); + } + } + return d; + }; + + UrlTrackingMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UrlTrackingMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35464,10 +78265,36 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UrlTrackingMapElement.prototype.originalUrl = ""; - UrlTrackingMapElement.prototype.unconsentedUsersUrl = ""; - UrlTrackingMapElement.prototype.consentedUsersUrl = ""; - UrlTrackingMapElement.prototype.cardIndex = 0; + UrlTrackingMapElement.prototype.originalUrl = null; + UrlTrackingMapElement.prototype.unconsentedUsersUrl = null; + UrlTrackingMapElement.prototype.consentedUsersUrl = null; + UrlTrackingMapElement.prototype.cardIndex = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UrlTrackingMapElement.prototype, "_originalUrl", { + get: $util.oneOfGetter($oneOfFields = ["originalUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UrlTrackingMapElement.prototype, "_unconsentedUsersUrl", { + get: $util.oneOfGetter($oneOfFields = ["unconsentedUsersUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UrlTrackingMapElement.prototype, "_consentedUsersUrl", { + get: $util.oneOfGetter($oneOfFields = ["consentedUsersUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UrlTrackingMapElement.prototype, "_cardIndex", { + get: $util.oneOfGetter($oneOfFields = ["cardIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); UrlTrackingMapElement.create = function create(properties) { return new UrlTrackingMapElement(properties); @@ -35520,6 +78347,56 @@ export const proto = $root.proto = (() => { return m; }; + UrlTrackingMapElement.fromObject = function fromObject(d) { + if (d instanceof $root.proto.UrlTrackingMap.UrlTrackingMapElement) + return d; + var m = new $root.proto.UrlTrackingMap.UrlTrackingMapElement(); + if (d.originalUrl != null) { + m.originalUrl = String(d.originalUrl); + } + if (d.unconsentedUsersUrl != null) { + m.unconsentedUsersUrl = String(d.unconsentedUsersUrl); + } + if (d.consentedUsersUrl != null) { + m.consentedUsersUrl = String(d.consentedUsersUrl); + } + if (d.cardIndex != null) { + m.cardIndex = d.cardIndex >>> 0; + } + return m; + }; + + UrlTrackingMapElement.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.originalUrl != null && m.hasOwnProperty("originalUrl")) { + d.originalUrl = m.originalUrl; + if (o.oneofs) + d._originalUrl = "originalUrl"; + } + if (m.unconsentedUsersUrl != null && m.hasOwnProperty("unconsentedUsersUrl")) { + d.unconsentedUsersUrl = m.unconsentedUsersUrl; + if (o.oneofs) + d._unconsentedUsersUrl = "unconsentedUsersUrl"; + } + if (m.consentedUsersUrl != null && m.hasOwnProperty("consentedUsersUrl")) { + d.consentedUsersUrl = m.consentedUsersUrl; + if (o.oneofs) + d._consentedUsersUrl = "consentedUsersUrl"; + } + if (m.cardIndex != null && m.hasOwnProperty("cardIndex")) { + d.cardIndex = m.cardIndex; + if (o.oneofs) + d._cardIndex = "cardIndex"; + } + return d; + }; + + UrlTrackingMapElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UrlTrackingMapElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35543,10 +78420,30 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - UserPassword.prototype.encoding = 0; - UserPassword.prototype.transformer = 0; + UserPassword.prototype.encoding = null; + UserPassword.prototype.transformer = null; UserPassword.prototype.transformerArg = $util.emptyArray; - UserPassword.prototype.transformedData = $util.newBuffer([]); + UserPassword.prototype.transformedData = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserPassword.prototype, "_encoding", { + get: $util.oneOfGetter($oneOfFields = ["encoding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserPassword.prototype, "_transformer", { + get: $util.oneOfGetter($oneOfFields = ["transformer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserPassword.prototype, "_transformedData", { + get: $util.oneOfGetter($oneOfFields = ["transformedData"]), + set: $util.oneOfSetter($oneOfFields) + }); UserPassword.create = function create(properties) { return new UserPassword(properties); @@ -35603,6 +78500,100 @@ export const proto = $root.proto = (() => { return m; }; + UserPassword.fromObject = function fromObject(d) { + if (d instanceof $root.proto.UserPassword) + return d; + var m = new $root.proto.UserPassword(); + switch (d.encoding) { + default: + if (typeof d.encoding === "number") { + m.encoding = d.encoding; + break; + } + break; + case "UTF8": + case 0: + m.encoding = 0; + break; + case "UTF8_BROKEN": + case 1: + m.encoding = 1; + break; + } + switch (d.transformer) { + default: + if (typeof d.transformer === "number") { + m.transformer = d.transformer; + break; + } + break; + case "NONE": + case 0: + m.transformer = 0; + break; + case "PBKDF2_HMAC_SHA512": + case 1: + m.transformer = 1; + break; + case "PBKDF2_HMAC_SHA384": + case 2: + m.transformer = 2; + break; + } + if (d.transformerArg) { + if (!Array.isArray(d.transformerArg)) + throw TypeError(".proto.UserPassword.transformerArg: array expected"); + m.transformerArg = []; + for (var i = 0; i < d.transformerArg.length; ++i) { + if (typeof d.transformerArg[i] !== "object") + throw TypeError(".proto.UserPassword.transformerArg: object expected"); + m.transformerArg[i] = $root.proto.UserPassword.TransformerArg.fromObject(d.transformerArg[i]); + } + } + if (d.transformedData != null) { + if (typeof d.transformedData === "string") + $util.base64.decode(d.transformedData, m.transformedData = $util.newBuffer($util.base64.length(d.transformedData)), 0); + else if (d.transformedData.length >= 0) + m.transformedData = d.transformedData; + } + return m; + }; + + UserPassword.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.transformerArg = []; + } + if (m.encoding != null && m.hasOwnProperty("encoding")) { + d.encoding = o.enums === String ? $root.proto.UserPassword.Encoding[m.encoding] === undefined ? m.encoding : $root.proto.UserPassword.Encoding[m.encoding] : m.encoding; + if (o.oneofs) + d._encoding = "encoding"; + } + if (m.transformer != null && m.hasOwnProperty("transformer")) { + d.transformer = o.enums === String ? $root.proto.UserPassword.Transformer[m.transformer] === undefined ? m.transformer : $root.proto.UserPassword.Transformer[m.transformer] : m.transformer; + if (o.oneofs) + d._transformer = "transformer"; + } + if (m.transformerArg && m.transformerArg.length) { + d.transformerArg = []; + for (var j = 0; j < m.transformerArg.length; ++j) { + d.transformerArg[j] = $root.proto.UserPassword.TransformerArg.toObject(m.transformerArg[j], o); + } + } + if (m.transformedData != null && m.hasOwnProperty("transformedData")) { + d.transformedData = o.bytes === String ? $util.base64.encode(m.transformedData, 0, m.transformedData.length) : o.bytes === Array ? Array.prototype.slice.call(m.transformedData) : m.transformedData; + if (o.oneofs) + d._transformedData = "transformedData"; + } + return d; + }; + + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35634,9 +78625,23 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - TransformerArg.prototype.key = ""; + TransformerArg.prototype.key = null; TransformerArg.prototype.value = null; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TransformerArg.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TransformerArg.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + TransformerArg.create = function create(properties) { return new TransformerArg(properties); }; @@ -35676,6 +78681,42 @@ export const proto = $root.proto = (() => { return m; }; + TransformerArg.fromObject = function fromObject(d) { + if (d instanceof $root.proto.UserPassword.TransformerArg) + return d; + var m = new $root.proto.UserPassword.TransformerArg(); + if (d.key != null) { + m.key = String(d.key); + } + if (d.value != null) { + if (typeof d.value !== "object") + throw TypeError(".proto.UserPassword.TransformerArg.value: object expected"); + m.value = $root.proto.UserPassword.TransformerArg.Value.fromObject(d.value); + } + return m; + }; + + TransformerArg.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.key != null && m.hasOwnProperty("key")) { + d.key = m.key; + if (o.oneofs) + d._key = "key"; + } + if (m.value != null && m.hasOwnProperty("value")) { + d.value = $root.proto.UserPassword.TransformerArg.Value.toObject(m.value, o); + if (o.oneofs) + d._value = "value"; + } + return d; + }; + + TransformerArg.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TransformerArg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35741,6 +78782,43 @@ export const proto = $root.proto = (() => { return m; }; + Value.fromObject = function fromObject(d) { + if (d instanceof $root.proto.UserPassword.TransformerArg.Value) + return d; + var m = new $root.proto.UserPassword.TransformerArg.Value(); + if (d.asBlob != null) { + if (typeof d.asBlob === "string") + $util.base64.decode(d.asBlob, m.asBlob = $util.newBuffer($util.base64.length(d.asBlob)), 0); + else if (d.asBlob.length >= 0) + m.asBlob = d.asBlob; + } + if (d.asUnsignedInteger != null) { + m.asUnsignedInteger = d.asUnsignedInteger >>> 0; + } + return m; + }; + + Value.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.asBlob != null && m.hasOwnProperty("asBlob")) { + d.asBlob = o.bytes === String ? $util.base64.encode(m.asBlob, 0, m.asBlob.length) : o.bytes === Array ? Array.prototype.slice.call(m.asBlob) : m.asBlob; + if (o.oneofs) + d.value = "asBlob"; + } + if (m.asUnsignedInteger != null && m.hasOwnProperty("asUnsignedInteger")) { + d.asUnsignedInteger = m.asUnsignedInteger; + if (o.oneofs) + d.value = "asUnsignedInteger"; + } + return d; + }; + + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35769,12 +78847,32 @@ export const proto = $root.proto = (() => { } UserReceipt.prototype.userJid = ""; - UserReceipt.prototype.receiptTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - UserReceipt.prototype.readTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - UserReceipt.prototype.playedTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UserReceipt.prototype.receiptTimestamp = null; + UserReceipt.prototype.readTimestamp = null; + UserReceipt.prototype.playedTimestamp = null; UserReceipt.prototype.pendingDeviceJid = $util.emptyArray; UserReceipt.prototype.deliveredDeviceJid = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserReceipt.prototype, "_receiptTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["receiptTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserReceipt.prototype, "_readTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["readTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserReceipt.prototype, "_playedTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["playedTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + UserReceipt.create = function create(properties) { return new UserReceipt(properties); }; @@ -35782,7 +78880,8 @@ export const proto = $root.proto = (() => { UserReceipt.encode = function encode(m, w) { if (!w) w = $Writer.create(); - w.uint32(10).string(m.userJid); + if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid")) + w.uint32(10).string(m.userJid); if (m.receiptTimestamp != null && Object.hasOwnProperty.call(m, "receiptTimestamp")) w.uint32(16).int64(m.receiptTimestamp); if (m.readTimestamp != null && Object.hasOwnProperty.call(m, "readTimestamp")) @@ -35842,11 +78941,122 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("userJid")) - throw $util.ProtocolError("missing required 'userJid'", { instance: m }); return m; }; + UserReceipt.fromObject = function fromObject(d) { + if (d instanceof $root.proto.UserReceipt) + return d; + var m = new $root.proto.UserReceipt(); + if (d.userJid != null) { + m.userJid = String(d.userJid); + } + if (d.receiptTimestamp != null) { + if ($util.Long) + (m.receiptTimestamp = $util.Long.fromValue(d.receiptTimestamp)).unsigned = false; + else if (typeof d.receiptTimestamp === "string") + m.receiptTimestamp = parseInt(d.receiptTimestamp, 10); + else if (typeof d.receiptTimestamp === "number") + m.receiptTimestamp = d.receiptTimestamp; + else if (typeof d.receiptTimestamp === "object") + m.receiptTimestamp = new $util.LongBits(d.receiptTimestamp.low >>> 0, d.receiptTimestamp.high >>> 0).toNumber(); + } + if (d.readTimestamp != null) { + if ($util.Long) + (m.readTimestamp = $util.Long.fromValue(d.readTimestamp)).unsigned = false; + else if (typeof d.readTimestamp === "string") + m.readTimestamp = parseInt(d.readTimestamp, 10); + else if (typeof d.readTimestamp === "number") + m.readTimestamp = d.readTimestamp; + else if (typeof d.readTimestamp === "object") + m.readTimestamp = new $util.LongBits(d.readTimestamp.low >>> 0, d.readTimestamp.high >>> 0).toNumber(); + } + if (d.playedTimestamp != null) { + if ($util.Long) + (m.playedTimestamp = $util.Long.fromValue(d.playedTimestamp)).unsigned = false; + else if (typeof d.playedTimestamp === "string") + m.playedTimestamp = parseInt(d.playedTimestamp, 10); + else if (typeof d.playedTimestamp === "number") + m.playedTimestamp = d.playedTimestamp; + else if (typeof d.playedTimestamp === "object") + m.playedTimestamp = new $util.LongBits(d.playedTimestamp.low >>> 0, d.playedTimestamp.high >>> 0).toNumber(); + } + if (d.pendingDeviceJid) { + if (!Array.isArray(d.pendingDeviceJid)) + throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected"); + m.pendingDeviceJid = []; + for (var i = 0; i < d.pendingDeviceJid.length; ++i) { + m.pendingDeviceJid[i] = String(d.pendingDeviceJid[i]); + } + } + if (d.deliveredDeviceJid) { + if (!Array.isArray(d.deliveredDeviceJid)) + throw TypeError(".proto.UserReceipt.deliveredDeviceJid: array expected"); + m.deliveredDeviceJid = []; + for (var i = 0; i < d.deliveredDeviceJid.length; ++i) { + m.deliveredDeviceJid[i] = String(d.deliveredDeviceJid[i]); + } + } + return m; + }; + + UserReceipt.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.pendingDeviceJid = []; + d.deliveredDeviceJid = []; + } + if (o.defaults) { + d.userJid = ""; + } + if (m.userJid != null && m.hasOwnProperty("userJid")) { + d.userJid = m.userJid; + } + if (m.receiptTimestamp != null && m.hasOwnProperty("receiptTimestamp")) { + if (typeof m.receiptTimestamp === "number") + d.receiptTimestamp = o.longs === String ? String(m.receiptTimestamp) : m.receiptTimestamp; + else + d.receiptTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.receiptTimestamp) : o.longs === Number ? new $util.LongBits(m.receiptTimestamp.low >>> 0, m.receiptTimestamp.high >>> 0).toNumber() : m.receiptTimestamp; + if (o.oneofs) + d._receiptTimestamp = "receiptTimestamp"; + } + if (m.readTimestamp != null && m.hasOwnProperty("readTimestamp")) { + if (typeof m.readTimestamp === "number") + d.readTimestamp = o.longs === String ? String(m.readTimestamp) : m.readTimestamp; + else + d.readTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.readTimestamp) : o.longs === Number ? new $util.LongBits(m.readTimestamp.low >>> 0, m.readTimestamp.high >>> 0).toNumber() : m.readTimestamp; + if (o.oneofs) + d._readTimestamp = "readTimestamp"; + } + if (m.playedTimestamp != null && m.hasOwnProperty("playedTimestamp")) { + if (typeof m.playedTimestamp === "number") + d.playedTimestamp = o.longs === String ? String(m.playedTimestamp) : m.playedTimestamp; + else + d.playedTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.playedTimestamp) : o.longs === Number ? new $util.LongBits(m.playedTimestamp.low >>> 0, m.playedTimestamp.high >>> 0).toNumber() : m.playedTimestamp; + if (o.oneofs) + d._playedTimestamp = "playedTimestamp"; + } + if (m.pendingDeviceJid && m.pendingDeviceJid.length) { + d.pendingDeviceJid = []; + for (var j = 0; j < m.pendingDeviceJid.length; ++j) { + d.pendingDeviceJid[j] = m.pendingDeviceJid[j]; + } + } + if (m.deliveredDeviceJid && m.deliveredDeviceJid.length) { + d.deliveredDeviceJid = []; + for (var j = 0; j < m.deliveredDeviceJid.length; ++j) { + d.deliveredDeviceJid[j] = m.deliveredDeviceJid[j]; + } + } + return d; + }; + + UserReceipt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + UserReceipt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35866,9 +79076,29 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - VerifiedNameCertificate.prototype.details = $util.newBuffer([]); - VerifiedNameCertificate.prototype.signature = $util.newBuffer([]); - VerifiedNameCertificate.prototype.serverSignature = $util.newBuffer([]); + VerifiedNameCertificate.prototype.details = null; + VerifiedNameCertificate.prototype.signature = null; + VerifiedNameCertificate.prototype.serverSignature = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VerifiedNameCertificate.prototype, "_details", { + get: $util.oneOfGetter($oneOfFields = ["details"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VerifiedNameCertificate.prototype, "_signature", { + get: $util.oneOfGetter($oneOfFields = ["signature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VerifiedNameCertificate.prototype, "_serverSignature", { + get: $util.oneOfGetter($oneOfFields = ["serverSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); VerifiedNameCertificate.create = function create(properties) { return new VerifiedNameCertificate(properties); @@ -35915,6 +79145,57 @@ export const proto = $root.proto = (() => { return m; }; + VerifiedNameCertificate.fromObject = function fromObject(d) { + if (d instanceof $root.proto.VerifiedNameCertificate) + return d; + var m = new $root.proto.VerifiedNameCertificate(); + if (d.details != null) { + if (typeof d.details === "string") + $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); + else if (d.details.length >= 0) + m.details = d.details; + } + if (d.signature != null) { + if (typeof d.signature === "string") + $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0); + else if (d.signature.length >= 0) + m.signature = d.signature; + } + if (d.serverSignature != null) { + if (typeof d.serverSignature === "string") + $util.base64.decode(d.serverSignature, m.serverSignature = $util.newBuffer($util.base64.length(d.serverSignature)), 0); + else if (d.serverSignature.length >= 0) + m.serverSignature = d.serverSignature; + } + return m; + }; + + VerifiedNameCertificate.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.details != null && m.hasOwnProperty("details")) { + d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; + if (o.oneofs) + d._details = "details"; + } + if (m.signature != null && m.hasOwnProperty("signature")) { + d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature; + if (o.oneofs) + d._signature = "signature"; + } + if (m.serverSignature != null && m.hasOwnProperty("serverSignature")) { + d.serverSignature = o.bytes === String ? $util.base64.encode(m.serverSignature, 0, m.serverSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.serverSignature) : m.serverSignature; + if (o.oneofs) + d._serverSignature = "serverSignature"; + } + return d; + }; + + VerifiedNameCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + VerifiedNameCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -35932,11 +79213,37 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - Details.prototype.serial = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - Details.prototype.issuer = ""; - Details.prototype.verifiedName = ""; + Details.prototype.serial = null; + Details.prototype.issuer = null; + Details.prototype.verifiedName = null; Details.prototype.localizedNames = $util.emptyArray; - Details.prototype.issueTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Details.prototype.issueTime = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_serial", { + get: $util.oneOfGetter($oneOfFields = ["serial"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_issuer", { + get: $util.oneOfGetter($oneOfFields = ["issuer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_verifiedName", { + get: $util.oneOfGetter($oneOfFields = ["verifiedName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Details.prototype, "_issueTime", { + get: $util.oneOfGetter($oneOfFields = ["issueTime"]), + set: $util.oneOfSetter($oneOfFields) + }); Details.create = function create(properties) { return new Details(properties); @@ -35999,6 +79306,95 @@ export const proto = $root.proto = (() => { return m; }; + Details.fromObject = function fromObject(d) { + if (d instanceof $root.proto.VerifiedNameCertificate.Details) + return d; + var m = new $root.proto.VerifiedNameCertificate.Details(); + if (d.serial != null) { + if ($util.Long) + (m.serial = $util.Long.fromValue(d.serial)).unsigned = true; + else if (typeof d.serial === "string") + m.serial = parseInt(d.serial, 10); + else if (typeof d.serial === "number") + m.serial = d.serial; + else if (typeof d.serial === "object") + m.serial = new $util.LongBits(d.serial.low >>> 0, d.serial.high >>> 0).toNumber(true); + } + if (d.issuer != null) { + m.issuer = String(d.issuer); + } + if (d.verifiedName != null) { + m.verifiedName = String(d.verifiedName); + } + if (d.localizedNames) { + if (!Array.isArray(d.localizedNames)) + throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected"); + m.localizedNames = []; + for (var i = 0; i < d.localizedNames.length; ++i) { + if (typeof d.localizedNames[i] !== "object") + throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: object expected"); + m.localizedNames[i] = $root.proto.LocalizedName.fromObject(d.localizedNames[i]); + } + } + if (d.issueTime != null) { + if ($util.Long) + (m.issueTime = $util.Long.fromValue(d.issueTime)).unsigned = true; + else if (typeof d.issueTime === "string") + m.issueTime = parseInt(d.issueTime, 10); + else if (typeof d.issueTime === "number") + m.issueTime = d.issueTime; + else if (typeof d.issueTime === "object") + m.issueTime = new $util.LongBits(d.issueTime.low >>> 0, d.issueTime.high >>> 0).toNumber(true); + } + return m; + }; + + Details.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.localizedNames = []; + } + if (m.serial != null && m.hasOwnProperty("serial")) { + if (typeof m.serial === "number") + d.serial = o.longs === String ? String(m.serial) : m.serial; + else + d.serial = o.longs === String ? $util.Long.prototype.toString.call(m.serial) : o.longs === Number ? new $util.LongBits(m.serial.low >>> 0, m.serial.high >>> 0).toNumber(true) : m.serial; + if (o.oneofs) + d._serial = "serial"; + } + if (m.issuer != null && m.hasOwnProperty("issuer")) { + d.issuer = m.issuer; + if (o.oneofs) + d._issuer = "issuer"; + } + if (m.verifiedName != null && m.hasOwnProperty("verifiedName")) { + d.verifiedName = m.verifiedName; + if (o.oneofs) + d._verifiedName = "verifiedName"; + } + if (m.localizedNames && m.localizedNames.length) { + d.localizedNames = []; + for (var j = 0; j < m.localizedNames.length; ++j) { + d.localizedNames[j] = $root.proto.LocalizedName.toObject(m.localizedNames[j], o); + } + } + if (m.issueTime != null && m.hasOwnProperty("issueTime")) { + if (typeof m.issueTime === "number") + d.issueTime = o.longs === String ? String(m.issueTime) : m.issueTime; + else + d.issueTime = o.longs === String ? $util.Long.prototype.toString.call(m.issueTime) : o.longs === Number ? new $util.LongBits(m.issueTime.low >>> 0, m.issueTime.high >>> 0).toNumber(true) : m.issueTime; + if (o.oneofs) + d._issueTime = "issueTime"; + } + return d; + }; + + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -36021,8 +79417,22 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WallpaperSettings.prototype.filename = ""; - WallpaperSettings.prototype.opacity = 0; + WallpaperSettings.prototype.filename = null; + WallpaperSettings.prototype.opacity = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WallpaperSettings.prototype, "_filename", { + get: $util.oneOfGetter($oneOfFields = ["filename"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WallpaperSettings.prototype, "_opacity", { + get: $util.oneOfGetter($oneOfFields = ["opacity"]), + set: $util.oneOfSetter($oneOfFields) + }); WallpaperSettings.create = function create(properties) { return new WallpaperSettings(properties); @@ -36063,6 +79473,40 @@ export const proto = $root.proto = (() => { return m; }; + WallpaperSettings.fromObject = function fromObject(d) { + if (d instanceof $root.proto.WallpaperSettings) + return d; + var m = new $root.proto.WallpaperSettings(); + if (d.filename != null) { + m.filename = String(d.filename); + } + if (d.opacity != null) { + m.opacity = d.opacity >>> 0; + } + return m; + }; + + WallpaperSettings.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.filename != null && m.hasOwnProperty("filename")) { + d.filename = m.filename; + if (o.oneofs) + d._filename = "filename"; + } + if (m.opacity != null && m.hasOwnProperty("opacity")) { + d.opacity = m.opacity; + if (o.oneofs) + d._opacity = "opacity"; + } + return d; + }; + + WallpaperSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WallpaperSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -36082,51 +79526,323 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WebFeatures.prototype.labelsDisplay = 0; - WebFeatures.prototype.voipIndividualOutgoing = 0; - WebFeatures.prototype.groupsV3 = 0; - WebFeatures.prototype.groupsV3Create = 0; - WebFeatures.prototype.changeNumberV2 = 0; - WebFeatures.prototype.queryStatusV3Thumbnail = 0; - WebFeatures.prototype.liveLocations = 0; - WebFeatures.prototype.queryVname = 0; - WebFeatures.prototype.voipIndividualIncoming = 0; - WebFeatures.prototype.quickRepliesQuery = 0; - WebFeatures.prototype.payments = 0; - WebFeatures.prototype.stickerPackQuery = 0; - WebFeatures.prototype.liveLocationsFinal = 0; - WebFeatures.prototype.labelsEdit = 0; - WebFeatures.prototype.mediaUpload = 0; - WebFeatures.prototype.mediaUploadRichQuickReplies = 0; - WebFeatures.prototype.vnameV2 = 0; - WebFeatures.prototype.videoPlaybackUrl = 0; - WebFeatures.prototype.statusRanking = 0; - WebFeatures.prototype.voipIndividualVideo = 0; - WebFeatures.prototype.thirdPartyStickers = 0; - WebFeatures.prototype.frequentlyForwardedSetting = 0; - WebFeatures.prototype.groupsV4JoinPermission = 0; - WebFeatures.prototype.recentStickers = 0; - WebFeatures.prototype.catalog = 0; - WebFeatures.prototype.starredStickers = 0; - WebFeatures.prototype.voipGroupCall = 0; - WebFeatures.prototype.templateMessage = 0; - WebFeatures.prototype.templateMessageInteractivity = 0; - WebFeatures.prototype.ephemeralMessages = 0; - WebFeatures.prototype.e2ENotificationSync = 0; - WebFeatures.prototype.recentStickersV2 = 0; - WebFeatures.prototype.recentStickersV3 = 0; - WebFeatures.prototype.userNotice = 0; - WebFeatures.prototype.support = 0; - WebFeatures.prototype.groupUiiCleanup = 0; - WebFeatures.prototype.groupDogfoodingInternalOnly = 0; - WebFeatures.prototype.settingsSync = 0; - WebFeatures.prototype.archiveV2 = 0; - WebFeatures.prototype.ephemeralAllowGroupMembers = 0; - WebFeatures.prototype.ephemeral24HDuration = 0; - WebFeatures.prototype.mdForceUpgrade = 0; - WebFeatures.prototype.disappearingMode = 0; - WebFeatures.prototype.externalMdOptInAvailable = 0; - WebFeatures.prototype.noDeleteMessageTimeLimit = 0; + WebFeatures.prototype.labelsDisplay = null; + WebFeatures.prototype.voipIndividualOutgoing = null; + WebFeatures.prototype.groupsV3 = null; + WebFeatures.prototype.groupsV3Create = null; + WebFeatures.prototype.changeNumberV2 = null; + WebFeatures.prototype.queryStatusV3Thumbnail = null; + WebFeatures.prototype.liveLocations = null; + WebFeatures.prototype.queryVname = null; + WebFeatures.prototype.voipIndividualIncoming = null; + WebFeatures.prototype.quickRepliesQuery = null; + WebFeatures.prototype.payments = null; + WebFeatures.prototype.stickerPackQuery = null; + WebFeatures.prototype.liveLocationsFinal = null; + WebFeatures.prototype.labelsEdit = null; + WebFeatures.prototype.mediaUpload = null; + WebFeatures.prototype.mediaUploadRichQuickReplies = null; + WebFeatures.prototype.vnameV2 = null; + WebFeatures.prototype.videoPlaybackUrl = null; + WebFeatures.prototype.statusRanking = null; + WebFeatures.prototype.voipIndividualVideo = null; + WebFeatures.prototype.thirdPartyStickers = null; + WebFeatures.prototype.frequentlyForwardedSetting = null; + WebFeatures.prototype.groupsV4JoinPermission = null; + WebFeatures.prototype.recentStickers = null; + WebFeatures.prototype.catalog = null; + WebFeatures.prototype.starredStickers = null; + WebFeatures.prototype.voipGroupCall = null; + WebFeatures.prototype.templateMessage = null; + WebFeatures.prototype.templateMessageInteractivity = null; + WebFeatures.prototype.ephemeralMessages = null; + WebFeatures.prototype.e2ENotificationSync = null; + WebFeatures.prototype.recentStickersV2 = null; + WebFeatures.prototype.recentStickersV3 = null; + WebFeatures.prototype.userNotice = null; + WebFeatures.prototype.support = null; + WebFeatures.prototype.groupUiiCleanup = null; + WebFeatures.prototype.groupDogfoodingInternalOnly = null; + WebFeatures.prototype.settingsSync = null; + WebFeatures.prototype.archiveV2 = null; + WebFeatures.prototype.ephemeralAllowGroupMembers = null; + WebFeatures.prototype.ephemeral24HDuration = null; + WebFeatures.prototype.mdForceUpgrade = null; + WebFeatures.prototype.disappearingMode = null; + WebFeatures.prototype.externalMdOptInAvailable = null; + WebFeatures.prototype.noDeleteMessageTimeLimit = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_labelsDisplay", { + get: $util.oneOfGetter($oneOfFields = ["labelsDisplay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_voipIndividualOutgoing", { + get: $util.oneOfGetter($oneOfFields = ["voipIndividualOutgoing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_groupsV3", { + get: $util.oneOfGetter($oneOfFields = ["groupsV3"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_groupsV3Create", { + get: $util.oneOfGetter($oneOfFields = ["groupsV3Create"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_changeNumberV2", { + get: $util.oneOfGetter($oneOfFields = ["changeNumberV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_queryStatusV3Thumbnail", { + get: $util.oneOfGetter($oneOfFields = ["queryStatusV3Thumbnail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_liveLocations", { + get: $util.oneOfGetter($oneOfFields = ["liveLocations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_queryVname", { + get: $util.oneOfGetter($oneOfFields = ["queryVname"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_voipIndividualIncoming", { + get: $util.oneOfGetter($oneOfFields = ["voipIndividualIncoming"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_quickRepliesQuery", { + get: $util.oneOfGetter($oneOfFields = ["quickRepliesQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_payments", { + get: $util.oneOfGetter($oneOfFields = ["payments"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_stickerPackQuery", { + get: $util.oneOfGetter($oneOfFields = ["stickerPackQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_liveLocationsFinal", { + get: $util.oneOfGetter($oneOfFields = ["liveLocationsFinal"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_labelsEdit", { + get: $util.oneOfGetter($oneOfFields = ["labelsEdit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_mediaUpload", { + get: $util.oneOfGetter($oneOfFields = ["mediaUpload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_mediaUploadRichQuickReplies", { + get: $util.oneOfGetter($oneOfFields = ["mediaUploadRichQuickReplies"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_vnameV2", { + get: $util.oneOfGetter($oneOfFields = ["vnameV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_videoPlaybackUrl", { + get: $util.oneOfGetter($oneOfFields = ["videoPlaybackUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_statusRanking", { + get: $util.oneOfGetter($oneOfFields = ["statusRanking"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_voipIndividualVideo", { + get: $util.oneOfGetter($oneOfFields = ["voipIndividualVideo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_thirdPartyStickers", { + get: $util.oneOfGetter($oneOfFields = ["thirdPartyStickers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_frequentlyForwardedSetting", { + get: $util.oneOfGetter($oneOfFields = ["frequentlyForwardedSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_groupsV4JoinPermission", { + get: $util.oneOfGetter($oneOfFields = ["groupsV4JoinPermission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_recentStickers", { + get: $util.oneOfGetter($oneOfFields = ["recentStickers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_catalog", { + get: $util.oneOfGetter($oneOfFields = ["catalog"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_starredStickers", { + get: $util.oneOfGetter($oneOfFields = ["starredStickers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_voipGroupCall", { + get: $util.oneOfGetter($oneOfFields = ["voipGroupCall"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_templateMessage", { + get: $util.oneOfGetter($oneOfFields = ["templateMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_templateMessageInteractivity", { + get: $util.oneOfGetter($oneOfFields = ["templateMessageInteractivity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_ephemeralMessages", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralMessages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_e2ENotificationSync", { + get: $util.oneOfGetter($oneOfFields = ["e2ENotificationSync"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_recentStickersV2", { + get: $util.oneOfGetter($oneOfFields = ["recentStickersV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_recentStickersV3", { + get: $util.oneOfGetter($oneOfFields = ["recentStickersV3"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_userNotice", { + get: $util.oneOfGetter($oneOfFields = ["userNotice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_support", { + get: $util.oneOfGetter($oneOfFields = ["support"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_groupUiiCleanup", { + get: $util.oneOfGetter($oneOfFields = ["groupUiiCleanup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_groupDogfoodingInternalOnly", { + get: $util.oneOfGetter($oneOfFields = ["groupDogfoodingInternalOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_settingsSync", { + get: $util.oneOfGetter($oneOfFields = ["settingsSync"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_archiveV2", { + get: $util.oneOfGetter($oneOfFields = ["archiveV2"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_ephemeralAllowGroupMembers", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralAllowGroupMembers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_ephemeral24HDuration", { + get: $util.oneOfGetter($oneOfFields = ["ephemeral24HDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_mdForceUpgrade", { + get: $util.oneOfGetter($oneOfFields = ["mdForceUpgrade"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_disappearingMode", { + get: $util.oneOfGetter($oneOfFields = ["disappearingMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_externalMdOptInAvailable", { + get: $util.oneOfGetter($oneOfFields = ["externalMdOptInAvailable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebFeatures.prototype, "_noDeleteMessageTimeLimit", { + get: $util.oneOfGetter($oneOfFields = ["noDeleteMessageTimeLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); WebFeatures.create = function create(properties) { return new WebFeatures(properties); @@ -36425,6 +80141,1329 @@ export const proto = $root.proto = (() => { return m; }; + WebFeatures.fromObject = function fromObject(d) { + if (d instanceof $root.proto.WebFeatures) + return d; + var m = new $root.proto.WebFeatures(); + switch (d.labelsDisplay) { + default: + if (typeof d.labelsDisplay === "number") { + m.labelsDisplay = d.labelsDisplay; + break; + } + break; + case "NOT_STARTED": + case 0: + m.labelsDisplay = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.labelsDisplay = 1; + break; + case "DEVELOPMENT": + case 2: + m.labelsDisplay = 2; + break; + case "PRODUCTION": + case 3: + m.labelsDisplay = 3; + break; + } + switch (d.voipIndividualOutgoing) { + default: + if (typeof d.voipIndividualOutgoing === "number") { + m.voipIndividualOutgoing = d.voipIndividualOutgoing; + break; + } + break; + case "NOT_STARTED": + case 0: + m.voipIndividualOutgoing = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.voipIndividualOutgoing = 1; + break; + case "DEVELOPMENT": + case 2: + m.voipIndividualOutgoing = 2; + break; + case "PRODUCTION": + case 3: + m.voipIndividualOutgoing = 3; + break; + } + switch (d.groupsV3) { + default: + if (typeof d.groupsV3 === "number") { + m.groupsV3 = d.groupsV3; + break; + } + break; + case "NOT_STARTED": + case 0: + m.groupsV3 = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.groupsV3 = 1; + break; + case "DEVELOPMENT": + case 2: + m.groupsV3 = 2; + break; + case "PRODUCTION": + case 3: + m.groupsV3 = 3; + break; + } + switch (d.groupsV3Create) { + default: + if (typeof d.groupsV3Create === "number") { + m.groupsV3Create = d.groupsV3Create; + break; + } + break; + case "NOT_STARTED": + case 0: + m.groupsV3Create = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.groupsV3Create = 1; + break; + case "DEVELOPMENT": + case 2: + m.groupsV3Create = 2; + break; + case "PRODUCTION": + case 3: + m.groupsV3Create = 3; + break; + } + switch (d.changeNumberV2) { + default: + if (typeof d.changeNumberV2 === "number") { + m.changeNumberV2 = d.changeNumberV2; + break; + } + break; + case "NOT_STARTED": + case 0: + m.changeNumberV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.changeNumberV2 = 1; + break; + case "DEVELOPMENT": + case 2: + m.changeNumberV2 = 2; + break; + case "PRODUCTION": + case 3: + m.changeNumberV2 = 3; + break; + } + switch (d.queryStatusV3Thumbnail) { + default: + if (typeof d.queryStatusV3Thumbnail === "number") { + m.queryStatusV3Thumbnail = d.queryStatusV3Thumbnail; + break; + } + break; + case "NOT_STARTED": + case 0: + m.queryStatusV3Thumbnail = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.queryStatusV3Thumbnail = 1; + break; + case "DEVELOPMENT": + case 2: + m.queryStatusV3Thumbnail = 2; + break; + case "PRODUCTION": + case 3: + m.queryStatusV3Thumbnail = 3; + break; + } + switch (d.liveLocations) { + default: + if (typeof d.liveLocations === "number") { + m.liveLocations = d.liveLocations; + break; + } + break; + case "NOT_STARTED": + case 0: + m.liveLocations = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.liveLocations = 1; + break; + case "DEVELOPMENT": + case 2: + m.liveLocations = 2; + break; + case "PRODUCTION": + case 3: + m.liveLocations = 3; + break; + } + switch (d.queryVname) { + default: + if (typeof d.queryVname === "number") { + m.queryVname = d.queryVname; + break; + } + break; + case "NOT_STARTED": + case 0: + m.queryVname = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.queryVname = 1; + break; + case "DEVELOPMENT": + case 2: + m.queryVname = 2; + break; + case "PRODUCTION": + case 3: + m.queryVname = 3; + break; + } + switch (d.voipIndividualIncoming) { + default: + if (typeof d.voipIndividualIncoming === "number") { + m.voipIndividualIncoming = d.voipIndividualIncoming; + break; + } + break; + case "NOT_STARTED": + case 0: + m.voipIndividualIncoming = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.voipIndividualIncoming = 1; + break; + case "DEVELOPMENT": + case 2: + m.voipIndividualIncoming = 2; + break; + case "PRODUCTION": + case 3: + m.voipIndividualIncoming = 3; + break; + } + switch (d.quickRepliesQuery) { + default: + if (typeof d.quickRepliesQuery === "number") { + m.quickRepliesQuery = d.quickRepliesQuery; + break; + } + break; + case "NOT_STARTED": + case 0: + m.quickRepliesQuery = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.quickRepliesQuery = 1; + break; + case "DEVELOPMENT": + case 2: + m.quickRepliesQuery = 2; + break; + case "PRODUCTION": + case 3: + m.quickRepliesQuery = 3; + break; + } + switch (d.payments) { + default: + if (typeof d.payments === "number") { + m.payments = d.payments; + break; + } + break; + case "NOT_STARTED": + case 0: + m.payments = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.payments = 1; + break; + case "DEVELOPMENT": + case 2: + m.payments = 2; + break; + case "PRODUCTION": + case 3: + m.payments = 3; + break; + } + switch (d.stickerPackQuery) { + default: + if (typeof d.stickerPackQuery === "number") { + m.stickerPackQuery = d.stickerPackQuery; + break; + } + break; + case "NOT_STARTED": + case 0: + m.stickerPackQuery = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.stickerPackQuery = 1; + break; + case "DEVELOPMENT": + case 2: + m.stickerPackQuery = 2; + break; + case "PRODUCTION": + case 3: + m.stickerPackQuery = 3; + break; + } + switch (d.liveLocationsFinal) { + default: + if (typeof d.liveLocationsFinal === "number") { + m.liveLocationsFinal = d.liveLocationsFinal; + break; + } + break; + case "NOT_STARTED": + case 0: + m.liveLocationsFinal = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.liveLocationsFinal = 1; + break; + case "DEVELOPMENT": + case 2: + m.liveLocationsFinal = 2; + break; + case "PRODUCTION": + case 3: + m.liveLocationsFinal = 3; + break; + } + switch (d.labelsEdit) { + default: + if (typeof d.labelsEdit === "number") { + m.labelsEdit = d.labelsEdit; + break; + } + break; + case "NOT_STARTED": + case 0: + m.labelsEdit = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.labelsEdit = 1; + break; + case "DEVELOPMENT": + case 2: + m.labelsEdit = 2; + break; + case "PRODUCTION": + case 3: + m.labelsEdit = 3; + break; + } + switch (d.mediaUpload) { + default: + if (typeof d.mediaUpload === "number") { + m.mediaUpload = d.mediaUpload; + break; + } + break; + case "NOT_STARTED": + case 0: + m.mediaUpload = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.mediaUpload = 1; + break; + case "DEVELOPMENT": + case 2: + m.mediaUpload = 2; + break; + case "PRODUCTION": + case 3: + m.mediaUpload = 3; + break; + } + switch (d.mediaUploadRichQuickReplies) { + default: + if (typeof d.mediaUploadRichQuickReplies === "number") { + m.mediaUploadRichQuickReplies = d.mediaUploadRichQuickReplies; + break; + } + break; + case "NOT_STARTED": + case 0: + m.mediaUploadRichQuickReplies = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.mediaUploadRichQuickReplies = 1; + break; + case "DEVELOPMENT": + case 2: + m.mediaUploadRichQuickReplies = 2; + break; + case "PRODUCTION": + case 3: + m.mediaUploadRichQuickReplies = 3; + break; + } + switch (d.vnameV2) { + default: + if (typeof d.vnameV2 === "number") { + m.vnameV2 = d.vnameV2; + break; + } + break; + case "NOT_STARTED": + case 0: + m.vnameV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.vnameV2 = 1; + break; + case "DEVELOPMENT": + case 2: + m.vnameV2 = 2; + break; + case "PRODUCTION": + case 3: + m.vnameV2 = 3; + break; + } + switch (d.videoPlaybackUrl) { + default: + if (typeof d.videoPlaybackUrl === "number") { + m.videoPlaybackUrl = d.videoPlaybackUrl; + break; + } + break; + case "NOT_STARTED": + case 0: + m.videoPlaybackUrl = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.videoPlaybackUrl = 1; + break; + case "DEVELOPMENT": + case 2: + m.videoPlaybackUrl = 2; + break; + case "PRODUCTION": + case 3: + m.videoPlaybackUrl = 3; + break; + } + switch (d.statusRanking) { + default: + if (typeof d.statusRanking === "number") { + m.statusRanking = d.statusRanking; + break; + } + break; + case "NOT_STARTED": + case 0: + m.statusRanking = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.statusRanking = 1; + break; + case "DEVELOPMENT": + case 2: + m.statusRanking = 2; + break; + case "PRODUCTION": + case 3: + m.statusRanking = 3; + break; + } + switch (d.voipIndividualVideo) { + default: + if (typeof d.voipIndividualVideo === "number") { + m.voipIndividualVideo = d.voipIndividualVideo; + break; + } + break; + case "NOT_STARTED": + case 0: + m.voipIndividualVideo = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.voipIndividualVideo = 1; + break; + case "DEVELOPMENT": + case 2: + m.voipIndividualVideo = 2; + break; + case "PRODUCTION": + case 3: + m.voipIndividualVideo = 3; + break; + } + switch (d.thirdPartyStickers) { + default: + if (typeof d.thirdPartyStickers === "number") { + m.thirdPartyStickers = d.thirdPartyStickers; + break; + } + break; + case "NOT_STARTED": + case 0: + m.thirdPartyStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.thirdPartyStickers = 1; + break; + case "DEVELOPMENT": + case 2: + m.thirdPartyStickers = 2; + break; + case "PRODUCTION": + case 3: + m.thirdPartyStickers = 3; + break; + } + switch (d.frequentlyForwardedSetting) { + default: + if (typeof d.frequentlyForwardedSetting === "number") { + m.frequentlyForwardedSetting = d.frequentlyForwardedSetting; + break; + } + break; + case "NOT_STARTED": + case 0: + m.frequentlyForwardedSetting = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.frequentlyForwardedSetting = 1; + break; + case "DEVELOPMENT": + case 2: + m.frequentlyForwardedSetting = 2; + break; + case "PRODUCTION": + case 3: + m.frequentlyForwardedSetting = 3; + break; + } + switch (d.groupsV4JoinPermission) { + default: + if (typeof d.groupsV4JoinPermission === "number") { + m.groupsV4JoinPermission = d.groupsV4JoinPermission; + break; + } + break; + case "NOT_STARTED": + case 0: + m.groupsV4JoinPermission = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.groupsV4JoinPermission = 1; + break; + case "DEVELOPMENT": + case 2: + m.groupsV4JoinPermission = 2; + break; + case "PRODUCTION": + case 3: + m.groupsV4JoinPermission = 3; + break; + } + switch (d.recentStickers) { + default: + if (typeof d.recentStickers === "number") { + m.recentStickers = d.recentStickers; + break; + } + break; + case "NOT_STARTED": + case 0: + m.recentStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.recentStickers = 1; + break; + case "DEVELOPMENT": + case 2: + m.recentStickers = 2; + break; + case "PRODUCTION": + case 3: + m.recentStickers = 3; + break; + } + switch (d.catalog) { + default: + if (typeof d.catalog === "number") { + m.catalog = d.catalog; + break; + } + break; + case "NOT_STARTED": + case 0: + m.catalog = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.catalog = 1; + break; + case "DEVELOPMENT": + case 2: + m.catalog = 2; + break; + case "PRODUCTION": + case 3: + m.catalog = 3; + break; + } + switch (d.starredStickers) { + default: + if (typeof d.starredStickers === "number") { + m.starredStickers = d.starredStickers; + break; + } + break; + case "NOT_STARTED": + case 0: + m.starredStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.starredStickers = 1; + break; + case "DEVELOPMENT": + case 2: + m.starredStickers = 2; + break; + case "PRODUCTION": + case 3: + m.starredStickers = 3; + break; + } + switch (d.voipGroupCall) { + default: + if (typeof d.voipGroupCall === "number") { + m.voipGroupCall = d.voipGroupCall; + break; + } + break; + case "NOT_STARTED": + case 0: + m.voipGroupCall = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.voipGroupCall = 1; + break; + case "DEVELOPMENT": + case 2: + m.voipGroupCall = 2; + break; + case "PRODUCTION": + case 3: + m.voipGroupCall = 3; + break; + } + switch (d.templateMessage) { + default: + if (typeof d.templateMessage === "number") { + m.templateMessage = d.templateMessage; + break; + } + break; + case "NOT_STARTED": + case 0: + m.templateMessage = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.templateMessage = 1; + break; + case "DEVELOPMENT": + case 2: + m.templateMessage = 2; + break; + case "PRODUCTION": + case 3: + m.templateMessage = 3; + break; + } + switch (d.templateMessageInteractivity) { + default: + if (typeof d.templateMessageInteractivity === "number") { + m.templateMessageInteractivity = d.templateMessageInteractivity; + break; + } + break; + case "NOT_STARTED": + case 0: + m.templateMessageInteractivity = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.templateMessageInteractivity = 1; + break; + case "DEVELOPMENT": + case 2: + m.templateMessageInteractivity = 2; + break; + case "PRODUCTION": + case 3: + m.templateMessageInteractivity = 3; + break; + } + switch (d.ephemeralMessages) { + default: + if (typeof d.ephemeralMessages === "number") { + m.ephemeralMessages = d.ephemeralMessages; + break; + } + break; + case "NOT_STARTED": + case 0: + m.ephemeralMessages = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.ephemeralMessages = 1; + break; + case "DEVELOPMENT": + case 2: + m.ephemeralMessages = 2; + break; + case "PRODUCTION": + case 3: + m.ephemeralMessages = 3; + break; + } + switch (d.e2ENotificationSync) { + default: + if (typeof d.e2ENotificationSync === "number") { + m.e2ENotificationSync = d.e2ENotificationSync; + break; + } + break; + case "NOT_STARTED": + case 0: + m.e2ENotificationSync = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.e2ENotificationSync = 1; + break; + case "DEVELOPMENT": + case 2: + m.e2ENotificationSync = 2; + break; + case "PRODUCTION": + case 3: + m.e2ENotificationSync = 3; + break; + } + switch (d.recentStickersV2) { + default: + if (typeof d.recentStickersV2 === "number") { + m.recentStickersV2 = d.recentStickersV2; + break; + } + break; + case "NOT_STARTED": + case 0: + m.recentStickersV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.recentStickersV2 = 1; + break; + case "DEVELOPMENT": + case 2: + m.recentStickersV2 = 2; + break; + case "PRODUCTION": + case 3: + m.recentStickersV2 = 3; + break; + } + switch (d.recentStickersV3) { + default: + if (typeof d.recentStickersV3 === "number") { + m.recentStickersV3 = d.recentStickersV3; + break; + } + break; + case "NOT_STARTED": + case 0: + m.recentStickersV3 = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.recentStickersV3 = 1; + break; + case "DEVELOPMENT": + case 2: + m.recentStickersV3 = 2; + break; + case "PRODUCTION": + case 3: + m.recentStickersV3 = 3; + break; + } + switch (d.userNotice) { + default: + if (typeof d.userNotice === "number") { + m.userNotice = d.userNotice; + break; + } + break; + case "NOT_STARTED": + case 0: + m.userNotice = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.userNotice = 1; + break; + case "DEVELOPMENT": + case 2: + m.userNotice = 2; + break; + case "PRODUCTION": + case 3: + m.userNotice = 3; + break; + } + switch (d.support) { + default: + if (typeof d.support === "number") { + m.support = d.support; + break; + } + break; + case "NOT_STARTED": + case 0: + m.support = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.support = 1; + break; + case "DEVELOPMENT": + case 2: + m.support = 2; + break; + case "PRODUCTION": + case 3: + m.support = 3; + break; + } + switch (d.groupUiiCleanup) { + default: + if (typeof d.groupUiiCleanup === "number") { + m.groupUiiCleanup = d.groupUiiCleanup; + break; + } + break; + case "NOT_STARTED": + case 0: + m.groupUiiCleanup = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.groupUiiCleanup = 1; + break; + case "DEVELOPMENT": + case 2: + m.groupUiiCleanup = 2; + break; + case "PRODUCTION": + case 3: + m.groupUiiCleanup = 3; + break; + } + switch (d.groupDogfoodingInternalOnly) { + default: + if (typeof d.groupDogfoodingInternalOnly === "number") { + m.groupDogfoodingInternalOnly = d.groupDogfoodingInternalOnly; + break; + } + break; + case "NOT_STARTED": + case 0: + m.groupDogfoodingInternalOnly = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.groupDogfoodingInternalOnly = 1; + break; + case "DEVELOPMENT": + case 2: + m.groupDogfoodingInternalOnly = 2; + break; + case "PRODUCTION": + case 3: + m.groupDogfoodingInternalOnly = 3; + break; + } + switch (d.settingsSync) { + default: + if (typeof d.settingsSync === "number") { + m.settingsSync = d.settingsSync; + break; + } + break; + case "NOT_STARTED": + case 0: + m.settingsSync = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.settingsSync = 1; + break; + case "DEVELOPMENT": + case 2: + m.settingsSync = 2; + break; + case "PRODUCTION": + case 3: + m.settingsSync = 3; + break; + } + switch (d.archiveV2) { + default: + if (typeof d.archiveV2 === "number") { + m.archiveV2 = d.archiveV2; + break; + } + break; + case "NOT_STARTED": + case 0: + m.archiveV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.archiveV2 = 1; + break; + case "DEVELOPMENT": + case 2: + m.archiveV2 = 2; + break; + case "PRODUCTION": + case 3: + m.archiveV2 = 3; + break; + } + switch (d.ephemeralAllowGroupMembers) { + default: + if (typeof d.ephemeralAllowGroupMembers === "number") { + m.ephemeralAllowGroupMembers = d.ephemeralAllowGroupMembers; + break; + } + break; + case "NOT_STARTED": + case 0: + m.ephemeralAllowGroupMembers = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.ephemeralAllowGroupMembers = 1; + break; + case "DEVELOPMENT": + case 2: + m.ephemeralAllowGroupMembers = 2; + break; + case "PRODUCTION": + case 3: + m.ephemeralAllowGroupMembers = 3; + break; + } + switch (d.ephemeral24HDuration) { + default: + if (typeof d.ephemeral24HDuration === "number") { + m.ephemeral24HDuration = d.ephemeral24HDuration; + break; + } + break; + case "NOT_STARTED": + case 0: + m.ephemeral24HDuration = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.ephemeral24HDuration = 1; + break; + case "DEVELOPMENT": + case 2: + m.ephemeral24HDuration = 2; + break; + case "PRODUCTION": + case 3: + m.ephemeral24HDuration = 3; + break; + } + switch (d.mdForceUpgrade) { + default: + if (typeof d.mdForceUpgrade === "number") { + m.mdForceUpgrade = d.mdForceUpgrade; + break; + } + break; + case "NOT_STARTED": + case 0: + m.mdForceUpgrade = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.mdForceUpgrade = 1; + break; + case "DEVELOPMENT": + case 2: + m.mdForceUpgrade = 2; + break; + case "PRODUCTION": + case 3: + m.mdForceUpgrade = 3; + break; + } + switch (d.disappearingMode) { + default: + if (typeof d.disappearingMode === "number") { + m.disappearingMode = d.disappearingMode; + break; + } + break; + case "NOT_STARTED": + case 0: + m.disappearingMode = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.disappearingMode = 1; + break; + case "DEVELOPMENT": + case 2: + m.disappearingMode = 2; + break; + case "PRODUCTION": + case 3: + m.disappearingMode = 3; + break; + } + switch (d.externalMdOptInAvailable) { + default: + if (typeof d.externalMdOptInAvailable === "number") { + m.externalMdOptInAvailable = d.externalMdOptInAvailable; + break; + } + break; + case "NOT_STARTED": + case 0: + m.externalMdOptInAvailable = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.externalMdOptInAvailable = 1; + break; + case "DEVELOPMENT": + case 2: + m.externalMdOptInAvailable = 2; + break; + case "PRODUCTION": + case 3: + m.externalMdOptInAvailable = 3; + break; + } + switch (d.noDeleteMessageTimeLimit) { + default: + if (typeof d.noDeleteMessageTimeLimit === "number") { + m.noDeleteMessageTimeLimit = d.noDeleteMessageTimeLimit; + break; + } + break; + case "NOT_STARTED": + case 0: + m.noDeleteMessageTimeLimit = 0; + break; + case "FORCE_UPGRADE": + case 1: + m.noDeleteMessageTimeLimit = 1; + break; + case "DEVELOPMENT": + case 2: + m.noDeleteMessageTimeLimit = 2; + break; + case "PRODUCTION": + case 3: + m.noDeleteMessageTimeLimit = 3; + break; + } + return m; + }; + + WebFeatures.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (m.labelsDisplay != null && m.hasOwnProperty("labelsDisplay")) { + d.labelsDisplay = o.enums === String ? $root.proto.WebFeatures.Flag[m.labelsDisplay] === undefined ? m.labelsDisplay : $root.proto.WebFeatures.Flag[m.labelsDisplay] : m.labelsDisplay; + if (o.oneofs) + d._labelsDisplay = "labelsDisplay"; + } + if (m.voipIndividualOutgoing != null && m.hasOwnProperty("voipIndividualOutgoing")) { + d.voipIndividualOutgoing = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipIndividualOutgoing] === undefined ? m.voipIndividualOutgoing : $root.proto.WebFeatures.Flag[m.voipIndividualOutgoing] : m.voipIndividualOutgoing; + if (o.oneofs) + d._voipIndividualOutgoing = "voipIndividualOutgoing"; + } + if (m.groupsV3 != null && m.hasOwnProperty("groupsV3")) { + d.groupsV3 = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupsV3] === undefined ? m.groupsV3 : $root.proto.WebFeatures.Flag[m.groupsV3] : m.groupsV3; + if (o.oneofs) + d._groupsV3 = "groupsV3"; + } + if (m.groupsV3Create != null && m.hasOwnProperty("groupsV3Create")) { + d.groupsV3Create = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupsV3Create] === undefined ? m.groupsV3Create : $root.proto.WebFeatures.Flag[m.groupsV3Create] : m.groupsV3Create; + if (o.oneofs) + d._groupsV3Create = "groupsV3Create"; + } + if (m.changeNumberV2 != null && m.hasOwnProperty("changeNumberV2")) { + d.changeNumberV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.changeNumberV2] === undefined ? m.changeNumberV2 : $root.proto.WebFeatures.Flag[m.changeNumberV2] : m.changeNumberV2; + if (o.oneofs) + d._changeNumberV2 = "changeNumberV2"; + } + if (m.queryStatusV3Thumbnail != null && m.hasOwnProperty("queryStatusV3Thumbnail")) { + d.queryStatusV3Thumbnail = o.enums === String ? $root.proto.WebFeatures.Flag[m.queryStatusV3Thumbnail] === undefined ? m.queryStatusV3Thumbnail : $root.proto.WebFeatures.Flag[m.queryStatusV3Thumbnail] : m.queryStatusV3Thumbnail; + if (o.oneofs) + d._queryStatusV3Thumbnail = "queryStatusV3Thumbnail"; + } + if (m.liveLocations != null && m.hasOwnProperty("liveLocations")) { + d.liveLocations = o.enums === String ? $root.proto.WebFeatures.Flag[m.liveLocations] === undefined ? m.liveLocations : $root.proto.WebFeatures.Flag[m.liveLocations] : m.liveLocations; + if (o.oneofs) + d._liveLocations = "liveLocations"; + } + if (m.queryVname != null && m.hasOwnProperty("queryVname")) { + d.queryVname = o.enums === String ? $root.proto.WebFeatures.Flag[m.queryVname] === undefined ? m.queryVname : $root.proto.WebFeatures.Flag[m.queryVname] : m.queryVname; + if (o.oneofs) + d._queryVname = "queryVname"; + } + if (m.voipIndividualIncoming != null && m.hasOwnProperty("voipIndividualIncoming")) { + d.voipIndividualIncoming = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipIndividualIncoming] === undefined ? m.voipIndividualIncoming : $root.proto.WebFeatures.Flag[m.voipIndividualIncoming] : m.voipIndividualIncoming; + if (o.oneofs) + d._voipIndividualIncoming = "voipIndividualIncoming"; + } + if (m.quickRepliesQuery != null && m.hasOwnProperty("quickRepliesQuery")) { + d.quickRepliesQuery = o.enums === String ? $root.proto.WebFeatures.Flag[m.quickRepliesQuery] === undefined ? m.quickRepliesQuery : $root.proto.WebFeatures.Flag[m.quickRepliesQuery] : m.quickRepliesQuery; + if (o.oneofs) + d._quickRepliesQuery = "quickRepliesQuery"; + } + if (m.payments != null && m.hasOwnProperty("payments")) { + d.payments = o.enums === String ? $root.proto.WebFeatures.Flag[m.payments] === undefined ? m.payments : $root.proto.WebFeatures.Flag[m.payments] : m.payments; + if (o.oneofs) + d._payments = "payments"; + } + if (m.stickerPackQuery != null && m.hasOwnProperty("stickerPackQuery")) { + d.stickerPackQuery = o.enums === String ? $root.proto.WebFeatures.Flag[m.stickerPackQuery] === undefined ? m.stickerPackQuery : $root.proto.WebFeatures.Flag[m.stickerPackQuery] : m.stickerPackQuery; + if (o.oneofs) + d._stickerPackQuery = "stickerPackQuery"; + } + if (m.liveLocationsFinal != null && m.hasOwnProperty("liveLocationsFinal")) { + d.liveLocationsFinal = o.enums === String ? $root.proto.WebFeatures.Flag[m.liveLocationsFinal] === undefined ? m.liveLocationsFinal : $root.proto.WebFeatures.Flag[m.liveLocationsFinal] : m.liveLocationsFinal; + if (o.oneofs) + d._liveLocationsFinal = "liveLocationsFinal"; + } + if (m.labelsEdit != null && m.hasOwnProperty("labelsEdit")) { + d.labelsEdit = o.enums === String ? $root.proto.WebFeatures.Flag[m.labelsEdit] === undefined ? m.labelsEdit : $root.proto.WebFeatures.Flag[m.labelsEdit] : m.labelsEdit; + if (o.oneofs) + d._labelsEdit = "labelsEdit"; + } + if (m.mediaUpload != null && m.hasOwnProperty("mediaUpload")) { + d.mediaUpload = o.enums === String ? $root.proto.WebFeatures.Flag[m.mediaUpload] === undefined ? m.mediaUpload : $root.proto.WebFeatures.Flag[m.mediaUpload] : m.mediaUpload; + if (o.oneofs) + d._mediaUpload = "mediaUpload"; + } + if (m.mediaUploadRichQuickReplies != null && m.hasOwnProperty("mediaUploadRichQuickReplies")) { + d.mediaUploadRichQuickReplies = o.enums === String ? $root.proto.WebFeatures.Flag[m.mediaUploadRichQuickReplies] === undefined ? m.mediaUploadRichQuickReplies : $root.proto.WebFeatures.Flag[m.mediaUploadRichQuickReplies] : m.mediaUploadRichQuickReplies; + if (o.oneofs) + d._mediaUploadRichQuickReplies = "mediaUploadRichQuickReplies"; + } + if (m.vnameV2 != null && m.hasOwnProperty("vnameV2")) { + d.vnameV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.vnameV2] === undefined ? m.vnameV2 : $root.proto.WebFeatures.Flag[m.vnameV2] : m.vnameV2; + if (o.oneofs) + d._vnameV2 = "vnameV2"; + } + if (m.videoPlaybackUrl != null && m.hasOwnProperty("videoPlaybackUrl")) { + d.videoPlaybackUrl = o.enums === String ? $root.proto.WebFeatures.Flag[m.videoPlaybackUrl] === undefined ? m.videoPlaybackUrl : $root.proto.WebFeatures.Flag[m.videoPlaybackUrl] : m.videoPlaybackUrl; + if (o.oneofs) + d._videoPlaybackUrl = "videoPlaybackUrl"; + } + if (m.statusRanking != null && m.hasOwnProperty("statusRanking")) { + d.statusRanking = o.enums === String ? $root.proto.WebFeatures.Flag[m.statusRanking] === undefined ? m.statusRanking : $root.proto.WebFeatures.Flag[m.statusRanking] : m.statusRanking; + if (o.oneofs) + d._statusRanking = "statusRanking"; + } + if (m.voipIndividualVideo != null && m.hasOwnProperty("voipIndividualVideo")) { + d.voipIndividualVideo = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipIndividualVideo] === undefined ? m.voipIndividualVideo : $root.proto.WebFeatures.Flag[m.voipIndividualVideo] : m.voipIndividualVideo; + if (o.oneofs) + d._voipIndividualVideo = "voipIndividualVideo"; + } + if (m.thirdPartyStickers != null && m.hasOwnProperty("thirdPartyStickers")) { + d.thirdPartyStickers = o.enums === String ? $root.proto.WebFeatures.Flag[m.thirdPartyStickers] === undefined ? m.thirdPartyStickers : $root.proto.WebFeatures.Flag[m.thirdPartyStickers] : m.thirdPartyStickers; + if (o.oneofs) + d._thirdPartyStickers = "thirdPartyStickers"; + } + if (m.frequentlyForwardedSetting != null && m.hasOwnProperty("frequentlyForwardedSetting")) { + d.frequentlyForwardedSetting = o.enums === String ? $root.proto.WebFeatures.Flag[m.frequentlyForwardedSetting] === undefined ? m.frequentlyForwardedSetting : $root.proto.WebFeatures.Flag[m.frequentlyForwardedSetting] : m.frequentlyForwardedSetting; + if (o.oneofs) + d._frequentlyForwardedSetting = "frequentlyForwardedSetting"; + } + if (m.groupsV4JoinPermission != null && m.hasOwnProperty("groupsV4JoinPermission")) { + d.groupsV4JoinPermission = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupsV4JoinPermission] === undefined ? m.groupsV4JoinPermission : $root.proto.WebFeatures.Flag[m.groupsV4JoinPermission] : m.groupsV4JoinPermission; + if (o.oneofs) + d._groupsV4JoinPermission = "groupsV4JoinPermission"; + } + if (m.recentStickers != null && m.hasOwnProperty("recentStickers")) { + d.recentStickers = o.enums === String ? $root.proto.WebFeatures.Flag[m.recentStickers] === undefined ? m.recentStickers : $root.proto.WebFeatures.Flag[m.recentStickers] : m.recentStickers; + if (o.oneofs) + d._recentStickers = "recentStickers"; + } + if (m.catalog != null && m.hasOwnProperty("catalog")) { + d.catalog = o.enums === String ? $root.proto.WebFeatures.Flag[m.catalog] === undefined ? m.catalog : $root.proto.WebFeatures.Flag[m.catalog] : m.catalog; + if (o.oneofs) + d._catalog = "catalog"; + } + if (m.starredStickers != null && m.hasOwnProperty("starredStickers")) { + d.starredStickers = o.enums === String ? $root.proto.WebFeatures.Flag[m.starredStickers] === undefined ? m.starredStickers : $root.proto.WebFeatures.Flag[m.starredStickers] : m.starredStickers; + if (o.oneofs) + d._starredStickers = "starredStickers"; + } + if (m.voipGroupCall != null && m.hasOwnProperty("voipGroupCall")) { + d.voipGroupCall = o.enums === String ? $root.proto.WebFeatures.Flag[m.voipGroupCall] === undefined ? m.voipGroupCall : $root.proto.WebFeatures.Flag[m.voipGroupCall] : m.voipGroupCall; + if (o.oneofs) + d._voipGroupCall = "voipGroupCall"; + } + if (m.templateMessage != null && m.hasOwnProperty("templateMessage")) { + d.templateMessage = o.enums === String ? $root.proto.WebFeatures.Flag[m.templateMessage] === undefined ? m.templateMessage : $root.proto.WebFeatures.Flag[m.templateMessage] : m.templateMessage; + if (o.oneofs) + d._templateMessage = "templateMessage"; + } + if (m.templateMessageInteractivity != null && m.hasOwnProperty("templateMessageInteractivity")) { + d.templateMessageInteractivity = o.enums === String ? $root.proto.WebFeatures.Flag[m.templateMessageInteractivity] === undefined ? m.templateMessageInteractivity : $root.proto.WebFeatures.Flag[m.templateMessageInteractivity] : m.templateMessageInteractivity; + if (o.oneofs) + d._templateMessageInteractivity = "templateMessageInteractivity"; + } + if (m.ephemeralMessages != null && m.hasOwnProperty("ephemeralMessages")) { + d.ephemeralMessages = o.enums === String ? $root.proto.WebFeatures.Flag[m.ephemeralMessages] === undefined ? m.ephemeralMessages : $root.proto.WebFeatures.Flag[m.ephemeralMessages] : m.ephemeralMessages; + if (o.oneofs) + d._ephemeralMessages = "ephemeralMessages"; + } + if (m.e2ENotificationSync != null && m.hasOwnProperty("e2ENotificationSync")) { + d.e2ENotificationSync = o.enums === String ? $root.proto.WebFeatures.Flag[m.e2ENotificationSync] === undefined ? m.e2ENotificationSync : $root.proto.WebFeatures.Flag[m.e2ENotificationSync] : m.e2ENotificationSync; + if (o.oneofs) + d._e2ENotificationSync = "e2ENotificationSync"; + } + if (m.recentStickersV2 != null && m.hasOwnProperty("recentStickersV2")) { + d.recentStickersV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.recentStickersV2] === undefined ? m.recentStickersV2 : $root.proto.WebFeatures.Flag[m.recentStickersV2] : m.recentStickersV2; + if (o.oneofs) + d._recentStickersV2 = "recentStickersV2"; + } + if (m.recentStickersV3 != null && m.hasOwnProperty("recentStickersV3")) { + d.recentStickersV3 = o.enums === String ? $root.proto.WebFeatures.Flag[m.recentStickersV3] === undefined ? m.recentStickersV3 : $root.proto.WebFeatures.Flag[m.recentStickersV3] : m.recentStickersV3; + if (o.oneofs) + d._recentStickersV3 = "recentStickersV3"; + } + if (m.userNotice != null && m.hasOwnProperty("userNotice")) { + d.userNotice = o.enums === String ? $root.proto.WebFeatures.Flag[m.userNotice] === undefined ? m.userNotice : $root.proto.WebFeatures.Flag[m.userNotice] : m.userNotice; + if (o.oneofs) + d._userNotice = "userNotice"; + } + if (m.support != null && m.hasOwnProperty("support")) { + d.support = o.enums === String ? $root.proto.WebFeatures.Flag[m.support] === undefined ? m.support : $root.proto.WebFeatures.Flag[m.support] : m.support; + if (o.oneofs) + d._support = "support"; + } + if (m.groupUiiCleanup != null && m.hasOwnProperty("groupUiiCleanup")) { + d.groupUiiCleanup = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupUiiCleanup] === undefined ? m.groupUiiCleanup : $root.proto.WebFeatures.Flag[m.groupUiiCleanup] : m.groupUiiCleanup; + if (o.oneofs) + d._groupUiiCleanup = "groupUiiCleanup"; + } + if (m.groupDogfoodingInternalOnly != null && m.hasOwnProperty("groupDogfoodingInternalOnly")) { + d.groupDogfoodingInternalOnly = o.enums === String ? $root.proto.WebFeatures.Flag[m.groupDogfoodingInternalOnly] === undefined ? m.groupDogfoodingInternalOnly : $root.proto.WebFeatures.Flag[m.groupDogfoodingInternalOnly] : m.groupDogfoodingInternalOnly; + if (o.oneofs) + d._groupDogfoodingInternalOnly = "groupDogfoodingInternalOnly"; + } + if (m.settingsSync != null && m.hasOwnProperty("settingsSync")) { + d.settingsSync = o.enums === String ? $root.proto.WebFeatures.Flag[m.settingsSync] === undefined ? m.settingsSync : $root.proto.WebFeatures.Flag[m.settingsSync] : m.settingsSync; + if (o.oneofs) + d._settingsSync = "settingsSync"; + } + if (m.archiveV2 != null && m.hasOwnProperty("archiveV2")) { + d.archiveV2 = o.enums === String ? $root.proto.WebFeatures.Flag[m.archiveV2] === undefined ? m.archiveV2 : $root.proto.WebFeatures.Flag[m.archiveV2] : m.archiveV2; + if (o.oneofs) + d._archiveV2 = "archiveV2"; + } + if (m.ephemeralAllowGroupMembers != null && m.hasOwnProperty("ephemeralAllowGroupMembers")) { + d.ephemeralAllowGroupMembers = o.enums === String ? $root.proto.WebFeatures.Flag[m.ephemeralAllowGroupMembers] === undefined ? m.ephemeralAllowGroupMembers : $root.proto.WebFeatures.Flag[m.ephemeralAllowGroupMembers] : m.ephemeralAllowGroupMembers; + if (o.oneofs) + d._ephemeralAllowGroupMembers = "ephemeralAllowGroupMembers"; + } + if (m.ephemeral24HDuration != null && m.hasOwnProperty("ephemeral24HDuration")) { + d.ephemeral24HDuration = o.enums === String ? $root.proto.WebFeatures.Flag[m.ephemeral24HDuration] === undefined ? m.ephemeral24HDuration : $root.proto.WebFeatures.Flag[m.ephemeral24HDuration] : m.ephemeral24HDuration; + if (o.oneofs) + d._ephemeral24HDuration = "ephemeral24HDuration"; + } + if (m.mdForceUpgrade != null && m.hasOwnProperty("mdForceUpgrade")) { + d.mdForceUpgrade = o.enums === String ? $root.proto.WebFeatures.Flag[m.mdForceUpgrade] === undefined ? m.mdForceUpgrade : $root.proto.WebFeatures.Flag[m.mdForceUpgrade] : m.mdForceUpgrade; + if (o.oneofs) + d._mdForceUpgrade = "mdForceUpgrade"; + } + if (m.disappearingMode != null && m.hasOwnProperty("disappearingMode")) { + d.disappearingMode = o.enums === String ? $root.proto.WebFeatures.Flag[m.disappearingMode] === undefined ? m.disappearingMode : $root.proto.WebFeatures.Flag[m.disappearingMode] : m.disappearingMode; + if (o.oneofs) + d._disappearingMode = "disappearingMode"; + } + if (m.externalMdOptInAvailable != null && m.hasOwnProperty("externalMdOptInAvailable")) { + d.externalMdOptInAvailable = o.enums === String ? $root.proto.WebFeatures.Flag[m.externalMdOptInAvailable] === undefined ? m.externalMdOptInAvailable : $root.proto.WebFeatures.Flag[m.externalMdOptInAvailable] : m.externalMdOptInAvailable; + if (o.oneofs) + d._externalMdOptInAvailable = "externalMdOptInAvailable"; + } + if (m.noDeleteMessageTimeLimit != null && m.hasOwnProperty("noDeleteMessageTimeLimit")) { + d.noDeleteMessageTimeLimit = o.enums === String ? $root.proto.WebFeatures.Flag[m.noDeleteMessageTimeLimit] === undefined ? m.noDeleteMessageTimeLimit : $root.proto.WebFeatures.Flag[m.noDeleteMessageTimeLimit] : m.noDeleteMessageTimeLimit; + if (o.oneofs) + d._noDeleteMessageTimeLimit = "noDeleteMessageTimeLimit"; + } + return d; + }; + + WebFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WebFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -36465,66 +81504,374 @@ export const proto = $root.proto = (() => { WebMessageInfo.prototype.key = null; WebMessageInfo.prototype.message = null; - WebMessageInfo.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - WebMessageInfo.prototype.status = 0; - WebMessageInfo.prototype.participant = ""; - WebMessageInfo.prototype.messageC2STimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - WebMessageInfo.prototype.ignore = false; - WebMessageInfo.prototype.starred = false; - WebMessageInfo.prototype.broadcast = false; - WebMessageInfo.prototype.pushName = ""; - WebMessageInfo.prototype.mediaCiphertextSha256 = $util.newBuffer([]); - WebMessageInfo.prototype.multicast = false; - WebMessageInfo.prototype.urlText = false; - WebMessageInfo.prototype.urlNumber = false; - WebMessageInfo.prototype.messageStubType = 0; - WebMessageInfo.prototype.clearMedia = false; + WebMessageInfo.prototype.messageTimestamp = null; + WebMessageInfo.prototype.status = null; + WebMessageInfo.prototype.participant = null; + WebMessageInfo.prototype.messageC2STimestamp = null; + WebMessageInfo.prototype.ignore = null; + WebMessageInfo.prototype.starred = null; + WebMessageInfo.prototype.broadcast = null; + WebMessageInfo.prototype.pushName = null; + WebMessageInfo.prototype.mediaCiphertextSha256 = null; + WebMessageInfo.prototype.multicast = null; + WebMessageInfo.prototype.urlText = null; + WebMessageInfo.prototype.urlNumber = null; + WebMessageInfo.prototype.messageStubType = null; + WebMessageInfo.prototype.clearMedia = null; WebMessageInfo.prototype.messageStubParameters = $util.emptyArray; - WebMessageInfo.prototype.duration = 0; + WebMessageInfo.prototype.duration = null; WebMessageInfo.prototype.labels = $util.emptyArray; WebMessageInfo.prototype.paymentInfo = null; WebMessageInfo.prototype.finalLiveLocation = null; WebMessageInfo.prototype.quotedPaymentInfo = null; - WebMessageInfo.prototype.ephemeralStartTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - WebMessageInfo.prototype.ephemeralDuration = 0; - WebMessageInfo.prototype.ephemeralOffToOn = false; - WebMessageInfo.prototype.ephemeralOutOfSync = false; - WebMessageInfo.prototype.bizPrivacyStatus = 0; - WebMessageInfo.prototype.verifiedBizName = ""; + WebMessageInfo.prototype.ephemeralStartTimestamp = null; + WebMessageInfo.prototype.ephemeralDuration = null; + WebMessageInfo.prototype.ephemeralOffToOn = null; + WebMessageInfo.prototype.ephemeralOutOfSync = null; + WebMessageInfo.prototype.bizPrivacyStatus = null; + WebMessageInfo.prototype.verifiedBizName = null; WebMessageInfo.prototype.mediaData = null; WebMessageInfo.prototype.photoChange = null; WebMessageInfo.prototype.userReceipt = $util.emptyArray; WebMessageInfo.prototype.reactions = $util.emptyArray; WebMessageInfo.prototype.quotedStickerData = null; - WebMessageInfo.prototype.futureproofData = $util.newBuffer([]); + WebMessageInfo.prototype.futureproofData = null; WebMessageInfo.prototype.statusPsa = null; WebMessageInfo.prototype.pollUpdates = $util.emptyArray; WebMessageInfo.prototype.pollAdditionalMetadata = null; - WebMessageInfo.prototype.agentId = ""; - WebMessageInfo.prototype.statusAlreadyViewed = false; - WebMessageInfo.prototype.messageSecret = $util.newBuffer([]); + WebMessageInfo.prototype.agentId = null; + WebMessageInfo.prototype.statusAlreadyViewed = null; + WebMessageInfo.prototype.messageSecret = null; WebMessageInfo.prototype.keepInChat = null; - WebMessageInfo.prototype.originalSelfAuthorUserJidString = ""; - WebMessageInfo.prototype.revokeMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + WebMessageInfo.prototype.originalSelfAuthorUserJidString = null; + WebMessageInfo.prototype.revokeMessageTimestamp = null; WebMessageInfo.prototype.pinInChat = null; WebMessageInfo.prototype.premiumMessageInfo = null; - WebMessageInfo.prototype.is1PBizBotMessage = false; - WebMessageInfo.prototype.isGroupHistoryMessage = false; - WebMessageInfo.prototype.botMessageInvokerJid = ""; + WebMessageInfo.prototype.is1PBizBotMessage = null; + WebMessageInfo.prototype.isGroupHistoryMessage = null; + WebMessageInfo.prototype.botMessageInvokerJid = null; WebMessageInfo.prototype.commentMetadata = null; WebMessageInfo.prototype.eventResponses = $util.emptyArray; WebMessageInfo.prototype.reportingTokenInfo = null; - WebMessageInfo.prototype.newsletterServerId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + WebMessageInfo.prototype.newsletterServerId = null; WebMessageInfo.prototype.eventAdditionalMetadata = null; - WebMessageInfo.prototype.isMentionedInStatus = false; + WebMessageInfo.prototype.isMentionedInStatus = null; WebMessageInfo.prototype.statusMentions = $util.emptyArray; WebMessageInfo.prototype.targetMessageId = null; WebMessageInfo.prototype.messageAddOns = $util.emptyArray; WebMessageInfo.prototype.statusMentionMessageInfo = null; - WebMessageInfo.prototype.isSupportAiMessage = false; + WebMessageInfo.prototype.isSupportAiMessage = null; WebMessageInfo.prototype.statusMentionSources = $util.emptyArray; WebMessageInfo.prototype.supportAiCitations = $util.emptyArray; - WebMessageInfo.prototype.botTargetId = ""; + WebMessageInfo.prototype.botTargetId = null; + + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_messageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["messageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_participant", { + get: $util.oneOfGetter($oneOfFields = ["participant"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_messageC2STimestamp", { + get: $util.oneOfGetter($oneOfFields = ["messageC2STimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_ignore", { + get: $util.oneOfGetter($oneOfFields = ["ignore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_starred", { + get: $util.oneOfGetter($oneOfFields = ["starred"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_broadcast", { + get: $util.oneOfGetter($oneOfFields = ["broadcast"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_pushName", { + get: $util.oneOfGetter($oneOfFields = ["pushName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_mediaCiphertextSha256", { + get: $util.oneOfGetter($oneOfFields = ["mediaCiphertextSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_multicast", { + get: $util.oneOfGetter($oneOfFields = ["multicast"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_urlText", { + get: $util.oneOfGetter($oneOfFields = ["urlText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_urlNumber", { + get: $util.oneOfGetter($oneOfFields = ["urlNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_messageStubType", { + get: $util.oneOfGetter($oneOfFields = ["messageStubType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_clearMedia", { + get: $util.oneOfGetter($oneOfFields = ["clearMedia"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_duration", { + get: $util.oneOfGetter($oneOfFields = ["duration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_paymentInfo", { + get: $util.oneOfGetter($oneOfFields = ["paymentInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_finalLiveLocation", { + get: $util.oneOfGetter($oneOfFields = ["finalLiveLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_quotedPaymentInfo", { + get: $util.oneOfGetter($oneOfFields = ["quotedPaymentInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_ephemeralStartTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralStartTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_ephemeralDuration", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_ephemeralOffToOn", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralOffToOn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_ephemeralOutOfSync", { + get: $util.oneOfGetter($oneOfFields = ["ephemeralOutOfSync"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_bizPrivacyStatus", { + get: $util.oneOfGetter($oneOfFields = ["bizPrivacyStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_verifiedBizName", { + get: $util.oneOfGetter($oneOfFields = ["verifiedBizName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_mediaData", { + get: $util.oneOfGetter($oneOfFields = ["mediaData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_photoChange", { + get: $util.oneOfGetter($oneOfFields = ["photoChange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_quotedStickerData", { + get: $util.oneOfGetter($oneOfFields = ["quotedStickerData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_futureproofData", { + get: $util.oneOfGetter($oneOfFields = ["futureproofData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_statusPsa", { + get: $util.oneOfGetter($oneOfFields = ["statusPsa"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_pollAdditionalMetadata", { + get: $util.oneOfGetter($oneOfFields = ["pollAdditionalMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_agentId", { + get: $util.oneOfGetter($oneOfFields = ["agentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_statusAlreadyViewed", { + get: $util.oneOfGetter($oneOfFields = ["statusAlreadyViewed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_messageSecret", { + get: $util.oneOfGetter($oneOfFields = ["messageSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_keepInChat", { + get: $util.oneOfGetter($oneOfFields = ["keepInChat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_originalSelfAuthorUserJidString", { + get: $util.oneOfGetter($oneOfFields = ["originalSelfAuthorUserJidString"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_revokeMessageTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["revokeMessageTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_pinInChat", { + get: $util.oneOfGetter($oneOfFields = ["pinInChat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_premiumMessageInfo", { + get: $util.oneOfGetter($oneOfFields = ["premiumMessageInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_is1PBizBotMessage", { + get: $util.oneOfGetter($oneOfFields = ["is1PBizBotMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_isGroupHistoryMessage", { + get: $util.oneOfGetter($oneOfFields = ["isGroupHistoryMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_botMessageInvokerJid", { + get: $util.oneOfGetter($oneOfFields = ["botMessageInvokerJid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_commentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["commentMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_reportingTokenInfo", { + get: $util.oneOfGetter($oneOfFields = ["reportingTokenInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_newsletterServerId", { + get: $util.oneOfGetter($oneOfFields = ["newsletterServerId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_eventAdditionalMetadata", { + get: $util.oneOfGetter($oneOfFields = ["eventAdditionalMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_isMentionedInStatus", { + get: $util.oneOfGetter($oneOfFields = ["isMentionedInStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_targetMessageId", { + get: $util.oneOfGetter($oneOfFields = ["targetMessageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_statusMentionMessageInfo", { + get: $util.oneOfGetter($oneOfFields = ["statusMentionMessageInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_isSupportAiMessage", { + get: $util.oneOfGetter($oneOfFields = ["isSupportAiMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebMessageInfo.prototype, "_botTargetId", { + get: $util.oneOfGetter($oneOfFields = ["botTargetId"]), + set: $util.oneOfSetter($oneOfFields) + }); WebMessageInfo.create = function create(properties) { return new WebMessageInfo(properties); @@ -36533,7 +81880,8 @@ export const proto = $root.proto = (() => { WebMessageInfo.encode = function encode(m, w) { if (!w) w = $Writer.create(); - $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim(); + if (m.key != null && Object.hasOwnProperty.call(m, "key")) + $root.proto.MessageKey.encode(m.key, w.uint32(10).fork()).ldelim(); if (m.message != null && Object.hasOwnProperty.call(m, "message")) $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim(); if (m.messageTimestamp != null && Object.hasOwnProperty.call(m, "messageTimestamp")) @@ -36961,11 +82309,1634 @@ export const proto = $root.proto = (() => { break; } } - if (!m.hasOwnProperty("key")) - throw $util.ProtocolError("missing required 'key'", { instance: m }); return m; }; + WebMessageInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.WebMessageInfo) + return d; + var m = new $root.proto.WebMessageInfo(); + if (d.key != null) { + if (typeof d.key !== "object") + throw TypeError(".proto.WebMessageInfo.key: object expected"); + m.key = $root.proto.MessageKey.fromObject(d.key); + } + if (d.message != null) { + if (typeof d.message !== "object") + throw TypeError(".proto.WebMessageInfo.message: object expected"); + m.message = $root.proto.Message.fromObject(d.message); + } + if (d.messageTimestamp != null) { + if ($util.Long) + (m.messageTimestamp = $util.Long.fromValue(d.messageTimestamp)).unsigned = true; + else if (typeof d.messageTimestamp === "string") + m.messageTimestamp = parseInt(d.messageTimestamp, 10); + else if (typeof d.messageTimestamp === "number") + m.messageTimestamp = d.messageTimestamp; + else if (typeof d.messageTimestamp === "object") + m.messageTimestamp = new $util.LongBits(d.messageTimestamp.low >>> 0, d.messageTimestamp.high >>> 0).toNumber(true); + } + switch (d.status) { + default: + if (typeof d.status === "number") { + m.status = d.status; + break; + } + break; + case "ERROR": + case 0: + m.status = 0; + break; + case "PENDING": + case 1: + m.status = 1; + break; + case "SERVER_ACK": + case 2: + m.status = 2; + break; + case "DELIVERY_ACK": + case 3: + m.status = 3; + break; + case "READ": + case 4: + m.status = 4; + break; + case "PLAYED": + case 5: + m.status = 5; + break; + } + if (d.participant != null) { + m.participant = String(d.participant); + } + if (d.messageC2STimestamp != null) { + if ($util.Long) + (m.messageC2STimestamp = $util.Long.fromValue(d.messageC2STimestamp)).unsigned = true; + else if (typeof d.messageC2STimestamp === "string") + m.messageC2STimestamp = parseInt(d.messageC2STimestamp, 10); + else if (typeof d.messageC2STimestamp === "number") + m.messageC2STimestamp = d.messageC2STimestamp; + else if (typeof d.messageC2STimestamp === "object") + m.messageC2STimestamp = new $util.LongBits(d.messageC2STimestamp.low >>> 0, d.messageC2STimestamp.high >>> 0).toNumber(true); + } + if (d.ignore != null) { + m.ignore = Boolean(d.ignore); + } + if (d.starred != null) { + m.starred = Boolean(d.starred); + } + if (d.broadcast != null) { + m.broadcast = Boolean(d.broadcast); + } + if (d.pushName != null) { + m.pushName = String(d.pushName); + } + if (d.mediaCiphertextSha256 != null) { + if (typeof d.mediaCiphertextSha256 === "string") + $util.base64.decode(d.mediaCiphertextSha256, m.mediaCiphertextSha256 = $util.newBuffer($util.base64.length(d.mediaCiphertextSha256)), 0); + else if (d.mediaCiphertextSha256.length >= 0) + m.mediaCiphertextSha256 = d.mediaCiphertextSha256; + } + if (d.multicast != null) { + m.multicast = Boolean(d.multicast); + } + if (d.urlText != null) { + m.urlText = Boolean(d.urlText); + } + if (d.urlNumber != null) { + m.urlNumber = Boolean(d.urlNumber); + } + switch (d.messageStubType) { + default: + if (typeof d.messageStubType === "number") { + m.messageStubType = d.messageStubType; + break; + } + break; + case "UNKNOWN": + case 0: + m.messageStubType = 0; + break; + case "REVOKE": + case 1: + m.messageStubType = 1; + break; + case "CIPHERTEXT": + case 2: + m.messageStubType = 2; + break; + case "FUTUREPROOF": + case 3: + m.messageStubType = 3; + break; + case "NON_VERIFIED_TRANSITION": + case 4: + m.messageStubType = 4; + break; + case "UNVERIFIED_TRANSITION": + case 5: + m.messageStubType = 5; + break; + case "VERIFIED_TRANSITION": + case 6: + m.messageStubType = 6; + break; + case "VERIFIED_LOW_UNKNOWN": + case 7: + m.messageStubType = 7; + break; + case "VERIFIED_HIGH": + case 8: + m.messageStubType = 8; + break; + case "VERIFIED_INITIAL_UNKNOWN": + case 9: + m.messageStubType = 9; + break; + case "VERIFIED_INITIAL_LOW": + case 10: + m.messageStubType = 10; + break; + case "VERIFIED_INITIAL_HIGH": + case 11: + m.messageStubType = 11; + break; + case "VERIFIED_TRANSITION_ANY_TO_NONE": + case 12: + m.messageStubType = 12; + break; + case "VERIFIED_TRANSITION_ANY_TO_HIGH": + case 13: + m.messageStubType = 13; + break; + case "VERIFIED_TRANSITION_HIGH_TO_LOW": + case 14: + m.messageStubType = 14; + break; + case "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN": + case 15: + m.messageStubType = 15; + break; + case "VERIFIED_TRANSITION_UNKNOWN_TO_LOW": + case 16: + m.messageStubType = 16; + break; + case "VERIFIED_TRANSITION_LOW_TO_UNKNOWN": + case 17: + m.messageStubType = 17; + break; + case "VERIFIED_TRANSITION_NONE_TO_LOW": + case 18: + m.messageStubType = 18; + break; + case "VERIFIED_TRANSITION_NONE_TO_UNKNOWN": + case 19: + m.messageStubType = 19; + break; + case "GROUP_CREATE": + case 20: + m.messageStubType = 20; + break; + case "GROUP_CHANGE_SUBJECT": + case 21: + m.messageStubType = 21; + break; + case "GROUP_CHANGE_ICON": + case 22: + m.messageStubType = 22; + break; + case "GROUP_CHANGE_INVITE_LINK": + case 23: + m.messageStubType = 23; + break; + case "GROUP_CHANGE_DESCRIPTION": + case 24: + m.messageStubType = 24; + break; + case "GROUP_CHANGE_RESTRICT": + case 25: + m.messageStubType = 25; + break; + case "GROUP_CHANGE_ANNOUNCE": + case 26: + m.messageStubType = 26; + break; + case "GROUP_PARTICIPANT_ADD": + case 27: + m.messageStubType = 27; + break; + case "GROUP_PARTICIPANT_REMOVE": + case 28: + m.messageStubType = 28; + break; + case "GROUP_PARTICIPANT_PROMOTE": + case 29: + m.messageStubType = 29; + break; + case "GROUP_PARTICIPANT_DEMOTE": + case 30: + m.messageStubType = 30; + break; + case "GROUP_PARTICIPANT_INVITE": + case 31: + m.messageStubType = 31; + break; + case "GROUP_PARTICIPANT_LEAVE": + case 32: + m.messageStubType = 32; + break; + case "GROUP_PARTICIPANT_CHANGE_NUMBER": + case 33: + m.messageStubType = 33; + break; + case "BROADCAST_CREATE": + case 34: + m.messageStubType = 34; + break; + case "BROADCAST_ADD": + case 35: + m.messageStubType = 35; + break; + case "BROADCAST_REMOVE": + case 36: + m.messageStubType = 36; + break; + case "GENERIC_NOTIFICATION": + case 37: + m.messageStubType = 37; + break; + case "E2E_IDENTITY_CHANGED": + case 38: + m.messageStubType = 38; + break; + case "E2E_ENCRYPTED": + case 39: + m.messageStubType = 39; + break; + case "CALL_MISSED_VOICE": + case 40: + m.messageStubType = 40; + break; + case "CALL_MISSED_VIDEO": + case 41: + m.messageStubType = 41; + break; + case "INDIVIDUAL_CHANGE_NUMBER": + case 42: + m.messageStubType = 42; + break; + case "GROUP_DELETE": + case 43: + m.messageStubType = 43; + break; + case "GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE": + case 44: + m.messageStubType = 44; + break; + case "CALL_MISSED_GROUP_VOICE": + case 45: + m.messageStubType = 45; + break; + case "CALL_MISSED_GROUP_VIDEO": + case 46: + m.messageStubType = 46; + break; + case "PAYMENT_CIPHERTEXT": + case 47: + m.messageStubType = 47; + break; + case "PAYMENT_FUTUREPROOF": + case 48: + m.messageStubType = 48; + break; + case "PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED": + case 49: + m.messageStubType = 49; + break; + case "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED": + case 50: + m.messageStubType = 50; + break; + case "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED": + case 51: + m.messageStubType = 51; + break; + case "PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP": + case 52: + m.messageStubType = 52; + break; + case "PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP": + case 53: + m.messageStubType = 53; + break; + case "PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER": + case 54: + m.messageStubType = 54; + break; + case "PAYMENT_ACTION_SEND_PAYMENT_REMINDER": + case 55: + m.messageStubType = 55; + break; + case "PAYMENT_ACTION_SEND_PAYMENT_INVITATION": + case 56: + m.messageStubType = 56; + break; + case "PAYMENT_ACTION_REQUEST_DECLINED": + case 57: + m.messageStubType = 57; + break; + case "PAYMENT_ACTION_REQUEST_EXPIRED": + case 58: + m.messageStubType = 58; + break; + case "PAYMENT_ACTION_REQUEST_CANCELLED": + case 59: + m.messageStubType = 59; + break; + case "BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM": + case 60: + m.messageStubType = 60; + break; + case "BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP": + case 61: + m.messageStubType = 61; + break; + case "BIZ_INTRO_TOP": + case 62: + m.messageStubType = 62; + break; + case "BIZ_INTRO_BOTTOM": + case 63: + m.messageStubType = 63; + break; + case "BIZ_NAME_CHANGE": + case 64: + m.messageStubType = 64; + break; + case "BIZ_MOVE_TO_CONSUMER_APP": + case 65: + m.messageStubType = 65; + break; + case "BIZ_TWO_TIER_MIGRATION_TOP": + case 66: + m.messageStubType = 66; + break; + case "BIZ_TWO_TIER_MIGRATION_BOTTOM": + case 67: + m.messageStubType = 67; + break; + case "OVERSIZED": + case 68: + m.messageStubType = 68; + break; + case "GROUP_CHANGE_NO_FREQUENTLY_FORWARDED": + case 69: + m.messageStubType = 69; + break; + case "GROUP_V4_ADD_INVITE_SENT": + case 70: + m.messageStubType = 70; + break; + case "GROUP_PARTICIPANT_ADD_REQUEST_JOIN": + case 71: + m.messageStubType = 71; + break; + case "CHANGE_EPHEMERAL_SETTING": + case 72: + m.messageStubType = 72; + break; + case "E2E_DEVICE_CHANGED": + case 73: + m.messageStubType = 73; + break; + case "VIEWED_ONCE": + case 74: + m.messageStubType = 74; + break; + case "E2E_ENCRYPTED_NOW": + case 75: + m.messageStubType = 75; + break; + case "BLUE_MSG_BSP_FB_TO_BSP_PREMISE": + case 76: + m.messageStubType = 76; + break; + case "BLUE_MSG_BSP_FB_TO_SELF_FB": + case 77: + m.messageStubType = 77; + break; + case "BLUE_MSG_BSP_FB_TO_SELF_PREMISE": + case 78: + m.messageStubType = 78; + break; + case "BLUE_MSG_BSP_FB_UNVERIFIED": + case 79: + m.messageStubType = 79; + break; + case "BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED": + case 80: + m.messageStubType = 80; + break; + case "BLUE_MSG_BSP_FB_VERIFIED": + case 81: + m.messageStubType = 81; + break; + case "BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED": + case 82: + m.messageStubType = 82; + break; + case "BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE": + case 83: + m.messageStubType = 83; + break; + case "BLUE_MSG_BSP_PREMISE_UNVERIFIED": + case 84: + m.messageStubType = 84; + break; + case "BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED": + case 85: + m.messageStubType = 85; + break; + case "BLUE_MSG_BSP_PREMISE_VERIFIED": + case 86: + m.messageStubType = 86; + break; + case "BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED": + case 87: + m.messageStubType = 87; + break; + case "BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED": + case 88: + m.messageStubType = 88; + break; + case "BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED": + case 89: + m.messageStubType = 89; + break; + case "BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED": + case 90: + m.messageStubType = 90; + break; + case "BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED": + case 91: + m.messageStubType = 91; + break; + case "BLUE_MSG_SELF_FB_TO_BSP_PREMISE": + case 92: + m.messageStubType = 92; + break; + case "BLUE_MSG_SELF_FB_TO_SELF_PREMISE": + case 93: + m.messageStubType = 93; + break; + case "BLUE_MSG_SELF_FB_UNVERIFIED": + case 94: + m.messageStubType = 94; + break; + case "BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED": + case 95: + m.messageStubType = 95; + break; + case "BLUE_MSG_SELF_FB_VERIFIED": + case 96: + m.messageStubType = 96; + break; + case "BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED": + case 97: + m.messageStubType = 97; + break; + case "BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE": + case 98: + m.messageStubType = 98; + break; + case "BLUE_MSG_SELF_PREMISE_UNVERIFIED": + case 99: + m.messageStubType = 99; + break; + case "BLUE_MSG_SELF_PREMISE_VERIFIED": + case 100: + m.messageStubType = 100; + break; + case "BLUE_MSG_TO_BSP_FB": + case 101: + m.messageStubType = 101; + break; + case "BLUE_MSG_TO_CONSUMER": + case 102: + m.messageStubType = 102; + break; + case "BLUE_MSG_TO_SELF_FB": + case 103: + m.messageStubType = 103; + break; + case "BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED": + case 104: + m.messageStubType = 104; + break; + case "BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED": + case 105: + m.messageStubType = 105; + break; + case "BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED": + case 106: + m.messageStubType = 106; + break; + case "BLUE_MSG_UNVERIFIED_TO_VERIFIED": + case 107: + m.messageStubType = 107; + break; + case "BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED": + case 108: + m.messageStubType = 108; + break; + case "BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED": + case 109: + m.messageStubType = 109; + break; + case "BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED": + case 110: + m.messageStubType = 110; + break; + case "BLUE_MSG_VERIFIED_TO_UNVERIFIED": + case 111: + m.messageStubType = 111; + break; + case "BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED": + case 112: + m.messageStubType = 112; + break; + case "BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED": + case 113: + m.messageStubType = 113; + break; + case "BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED": + case 114: + m.messageStubType = 114; + break; + case "BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED": + case 115: + m.messageStubType = 115; + break; + case "BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED": + case 116: + m.messageStubType = 116; + break; + case "BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED": + case 117: + m.messageStubType = 117; + break; + case "E2E_IDENTITY_UNAVAILABLE": + case 118: + m.messageStubType = 118; + break; + case "GROUP_CREATING": + case 119: + m.messageStubType = 119; + break; + case "GROUP_CREATE_FAILED": + case 120: + m.messageStubType = 120; + break; + case "GROUP_BOUNCED": + case 121: + m.messageStubType = 121; + break; + case "BLOCK_CONTACT": + case 122: + m.messageStubType = 122; + break; + case "EPHEMERAL_SETTING_NOT_APPLIED": + case 123: + m.messageStubType = 123; + break; + case "SYNC_FAILED": + case 124: + m.messageStubType = 124; + break; + case "SYNCING": + case 125: + m.messageStubType = 125; + break; + case "BIZ_PRIVACY_MODE_INIT_FB": + case 126: + m.messageStubType = 126; + break; + case "BIZ_PRIVACY_MODE_INIT_BSP": + case 127: + m.messageStubType = 127; + break; + case "BIZ_PRIVACY_MODE_TO_FB": + case 128: + m.messageStubType = 128; + break; + case "BIZ_PRIVACY_MODE_TO_BSP": + case 129: + m.messageStubType = 129; + break; + case "DISAPPEARING_MODE": + case 130: + m.messageStubType = 130; + break; + case "E2E_DEVICE_FETCH_FAILED": + case 131: + m.messageStubType = 131; + break; + case "ADMIN_REVOKE": + case 132: + m.messageStubType = 132; + break; + case "GROUP_INVITE_LINK_GROWTH_LOCKED": + case 133: + m.messageStubType = 133; + break; + case "COMMUNITY_LINK_PARENT_GROUP": + case 134: + m.messageStubType = 134; + break; + case "COMMUNITY_LINK_SIBLING_GROUP": + case 135: + m.messageStubType = 135; + break; + case "COMMUNITY_LINK_SUB_GROUP": + case 136: + m.messageStubType = 136; + break; + case "COMMUNITY_UNLINK_PARENT_GROUP": + case 137: + m.messageStubType = 137; + break; + case "COMMUNITY_UNLINK_SIBLING_GROUP": + case 138: + m.messageStubType = 138; + break; + case "COMMUNITY_UNLINK_SUB_GROUP": + case 139: + m.messageStubType = 139; + break; + case "GROUP_PARTICIPANT_ACCEPT": + case 140: + m.messageStubType = 140; + break; + case "GROUP_PARTICIPANT_LINKED_GROUP_JOIN": + case 141: + m.messageStubType = 141; + break; + case "COMMUNITY_CREATE": + case 142: + m.messageStubType = 142; + break; + case "EPHEMERAL_KEEP_IN_CHAT": + case 143: + m.messageStubType = 143; + break; + case "GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST": + case 144: + m.messageStubType = 144; + break; + case "GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE": + case 145: + m.messageStubType = 145; + break; + case "INTEGRITY_UNLINK_PARENT_GROUP": + case 146: + m.messageStubType = 146; + break; + case "COMMUNITY_PARTICIPANT_PROMOTE": + case 147: + m.messageStubType = 147; + break; + case "COMMUNITY_PARTICIPANT_DEMOTE": + case 148: + m.messageStubType = 148; + break; + case "COMMUNITY_PARENT_GROUP_DELETED": + case 149: + m.messageStubType = 149; + break; + case "COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL": + case 150: + m.messageStubType = 150; + break; + case "GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP": + case 151: + m.messageStubType = 151; + break; + case "MASKED_THREAD_CREATED": + case 152: + m.messageStubType = 152; + break; + case "MASKED_THREAD_UNMASKED": + case 153: + m.messageStubType = 153; + break; + case "BIZ_CHAT_ASSIGNMENT": + case 154: + m.messageStubType = 154; + break; + case "CHAT_PSA": + case 155: + m.messageStubType = 155; + break; + case "CHAT_POLL_CREATION_MESSAGE": + case 156: + m.messageStubType = 156; + break; + case "CAG_MASKED_THREAD_CREATED": + case 157: + m.messageStubType = 157; + break; + case "COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED": + case 158: + m.messageStubType = 158; + break; + case "CAG_INVITE_AUTO_ADD": + case 159: + m.messageStubType = 159; + break; + case "BIZ_CHAT_ASSIGNMENT_UNASSIGN": + case 160: + m.messageStubType = 160; + break; + case "CAG_INVITE_AUTO_JOINED": + case 161: + m.messageStubType = 161; + break; + case "SCHEDULED_CALL_START_MESSAGE": + case 162: + m.messageStubType = 162; + break; + case "COMMUNITY_INVITE_RICH": + case 163: + m.messageStubType = 163; + break; + case "COMMUNITY_INVITE_AUTO_ADD_RICH": + case 164: + m.messageStubType = 164; + break; + case "SUB_GROUP_INVITE_RICH": + case 165: + m.messageStubType = 165; + break; + case "SUB_GROUP_PARTICIPANT_ADD_RICH": + case 166: + m.messageStubType = 166; + break; + case "COMMUNITY_LINK_PARENT_GROUP_RICH": + case 167: + m.messageStubType = 167; + break; + case "COMMUNITY_PARTICIPANT_ADD_RICH": + case 168: + m.messageStubType = 168; + break; + case "SILENCED_UNKNOWN_CALLER_AUDIO": + case 169: + m.messageStubType = 169; + break; + case "SILENCED_UNKNOWN_CALLER_VIDEO": + case 170: + m.messageStubType = 170; + break; + case "GROUP_MEMBER_ADD_MODE": + case 171: + m.messageStubType = 171; + break; + case "GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD": + case 172: + m.messageStubType = 172; + break; + case "COMMUNITY_CHANGE_DESCRIPTION": + case 173: + m.messageStubType = 173; + break; + case "SENDER_INVITE": + case 174: + m.messageStubType = 174; + break; + case "RECEIVER_INVITE": + case 175: + m.messageStubType = 175; + break; + case "COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS": + case 176: + m.messageStubType = 176; + break; + case "PINNED_MESSAGE_IN_CHAT": + case 177: + m.messageStubType = 177; + break; + case "PAYMENT_INVITE_SETUP_INVITER": + case 178: + m.messageStubType = 178; + break; + case "PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY": + case 179: + m.messageStubType = 179; + break; + case "PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE": + case 180: + m.messageStubType = 180; + break; + case "LINKED_GROUP_CALL_START": + case 181: + m.messageStubType = 181; + break; + case "REPORT_TO_ADMIN_ENABLED_STATUS": + case 182: + m.messageStubType = 182; + break; + case "EMPTY_SUBGROUP_CREATE": + case 183: + m.messageStubType = 183; + break; + case "SCHEDULED_CALL_CANCEL": + case 184: + m.messageStubType = 184; + break; + case "SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH": + case 185: + m.messageStubType = 185; + break; + case "GROUP_CHANGE_RECENT_HISTORY_SHARING": + case 186: + m.messageStubType = 186; + break; + case "PAID_MESSAGE_SERVER_CAMPAIGN_ID": + case 187: + m.messageStubType = 187; + break; + case "GENERAL_CHAT_CREATE": + case 188: + m.messageStubType = 188; + break; + case "GENERAL_CHAT_ADD": + case 189: + m.messageStubType = 189; + break; + case "GENERAL_CHAT_AUTO_ADD_DISABLED": + case 190: + m.messageStubType = 190; + break; + case "SUGGESTED_SUBGROUP_ANNOUNCE": + case 191: + m.messageStubType = 191; + break; + case "BIZ_BOT_1P_MESSAGING_ENABLED": + case 192: + m.messageStubType = 192; + break; + case "CHANGE_USERNAME": + case 193: + m.messageStubType = 193; + break; + case "BIZ_COEX_PRIVACY_INIT_SELF": + case 194: + m.messageStubType = 194; + break; + case "BIZ_COEX_PRIVACY_TRANSITION_SELF": + case 195: + m.messageStubType = 195; + break; + case "SUPPORT_AI_EDUCATION": + case 196: + m.messageStubType = 196; + break; + case "BIZ_BOT_3P_MESSAGING_ENABLED": + case 197: + m.messageStubType = 197; + break; + case "REMINDER_SETUP_MESSAGE": + case 198: + m.messageStubType = 198; + break; + case "REMINDER_SENT_MESSAGE": + case 199: + m.messageStubType = 199; + break; + case "REMINDER_CANCEL_MESSAGE": + case 200: + m.messageStubType = 200; + break; + case "BIZ_COEX_PRIVACY_INIT": + case 201: + m.messageStubType = 201; + break; + case "BIZ_COEX_PRIVACY_TRANSITION": + case 202: + m.messageStubType = 202; + break; + case "GROUP_DEACTIVATED": + case 203: + m.messageStubType = 203; + break; + case "COMMUNITY_DEACTIVATE_SIBLING_GROUP": + case 204: + m.messageStubType = 204; + break; + case "EVENT_UPDATED": + case 205: + m.messageStubType = 205; + break; + case "EVENT_CANCELED": + case 206: + m.messageStubType = 206; + break; + case "COMMUNITY_OWNER_UPDATED": + case 207: + m.messageStubType = 207; + break; + case "COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN": + case 208: + m.messageStubType = 208; + break; + case "CAPI_GROUP_NE2EE_SYSTEM_MESSAGE": + case 209: + m.messageStubType = 209; + break; + case "STATUS_MENTION": + case 210: + m.messageStubType = 210; + break; + case "USER_CONTROLS_SYSTEM_MESSAGE": + case 211: + m.messageStubType = 211; + break; + case "SUPPORT_SYSTEM_MESSAGE": + case 212: + m.messageStubType = 212; + break; + case "CHANGE_LID": + case 213: + m.messageStubType = 213; + break; + case "BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE": + case 214: + m.messageStubType = 214; + break; + case "BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE": + case 215: + m.messageStubType = 215; + break; + case "CHANGE_LIMIT_SHARING": + case 216: + m.messageStubType = 216; + break; + case "GROUP_MEMBER_LINK_MODE": + case 217: + m.messageStubType = 217; + break; + case "BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE": + case 218: + m.messageStubType = 218; + break; + } + if (d.clearMedia != null) { + m.clearMedia = Boolean(d.clearMedia); + } + if (d.messageStubParameters) { + if (!Array.isArray(d.messageStubParameters)) + throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected"); + m.messageStubParameters = []; + for (var i = 0; i < d.messageStubParameters.length; ++i) { + m.messageStubParameters[i] = String(d.messageStubParameters[i]); + } + } + if (d.duration != null) { + m.duration = d.duration >>> 0; + } + if (d.labels) { + if (!Array.isArray(d.labels)) + throw TypeError(".proto.WebMessageInfo.labels: array expected"); + m.labels = []; + for (var i = 0; i < d.labels.length; ++i) { + m.labels[i] = String(d.labels[i]); + } + } + if (d.paymentInfo != null) { + if (typeof d.paymentInfo !== "object") + throw TypeError(".proto.WebMessageInfo.paymentInfo: object expected"); + m.paymentInfo = $root.proto.PaymentInfo.fromObject(d.paymentInfo); + } + if (d.finalLiveLocation != null) { + if (typeof d.finalLiveLocation !== "object") + throw TypeError(".proto.WebMessageInfo.finalLiveLocation: object expected"); + m.finalLiveLocation = $root.proto.Message.LiveLocationMessage.fromObject(d.finalLiveLocation); + } + if (d.quotedPaymentInfo != null) { + if (typeof d.quotedPaymentInfo !== "object") + throw TypeError(".proto.WebMessageInfo.quotedPaymentInfo: object expected"); + m.quotedPaymentInfo = $root.proto.PaymentInfo.fromObject(d.quotedPaymentInfo); + } + if (d.ephemeralStartTimestamp != null) { + if ($util.Long) + (m.ephemeralStartTimestamp = $util.Long.fromValue(d.ephemeralStartTimestamp)).unsigned = true; + else if (typeof d.ephemeralStartTimestamp === "string") + m.ephemeralStartTimestamp = parseInt(d.ephemeralStartTimestamp, 10); + else if (typeof d.ephemeralStartTimestamp === "number") + m.ephemeralStartTimestamp = d.ephemeralStartTimestamp; + else if (typeof d.ephemeralStartTimestamp === "object") + m.ephemeralStartTimestamp = new $util.LongBits(d.ephemeralStartTimestamp.low >>> 0, d.ephemeralStartTimestamp.high >>> 0).toNumber(true); + } + if (d.ephemeralDuration != null) { + m.ephemeralDuration = d.ephemeralDuration >>> 0; + } + if (d.ephemeralOffToOn != null) { + m.ephemeralOffToOn = Boolean(d.ephemeralOffToOn); + } + if (d.ephemeralOutOfSync != null) { + m.ephemeralOutOfSync = Boolean(d.ephemeralOutOfSync); + } + switch (d.bizPrivacyStatus) { + default: + if (typeof d.bizPrivacyStatus === "number") { + m.bizPrivacyStatus = d.bizPrivacyStatus; + break; + } + break; + case "E2EE": + case 0: + m.bizPrivacyStatus = 0; + break; + case "FB": + case 2: + m.bizPrivacyStatus = 2; + break; + case "BSP": + case 1: + m.bizPrivacyStatus = 1; + break; + case "BSP_AND_FB": + case 3: + m.bizPrivacyStatus = 3; + break; + } + if (d.verifiedBizName != null) { + m.verifiedBizName = String(d.verifiedBizName); + } + if (d.mediaData != null) { + if (typeof d.mediaData !== "object") + throw TypeError(".proto.WebMessageInfo.mediaData: object expected"); + m.mediaData = $root.proto.MediaData.fromObject(d.mediaData); + } + if (d.photoChange != null) { + if (typeof d.photoChange !== "object") + throw TypeError(".proto.WebMessageInfo.photoChange: object expected"); + m.photoChange = $root.proto.PhotoChange.fromObject(d.photoChange); + } + if (d.userReceipt) { + if (!Array.isArray(d.userReceipt)) + throw TypeError(".proto.WebMessageInfo.userReceipt: array expected"); + m.userReceipt = []; + for (var i = 0; i < d.userReceipt.length; ++i) { + if (typeof d.userReceipt[i] !== "object") + throw TypeError(".proto.WebMessageInfo.userReceipt: object expected"); + m.userReceipt[i] = $root.proto.UserReceipt.fromObject(d.userReceipt[i]); + } + } + if (d.reactions) { + if (!Array.isArray(d.reactions)) + throw TypeError(".proto.WebMessageInfo.reactions: array expected"); + m.reactions = []; + for (var i = 0; i < d.reactions.length; ++i) { + if (typeof d.reactions[i] !== "object") + throw TypeError(".proto.WebMessageInfo.reactions: object expected"); + m.reactions[i] = $root.proto.Reaction.fromObject(d.reactions[i]); + } + } + if (d.quotedStickerData != null) { + if (typeof d.quotedStickerData !== "object") + throw TypeError(".proto.WebMessageInfo.quotedStickerData: object expected"); + m.quotedStickerData = $root.proto.MediaData.fromObject(d.quotedStickerData); + } + if (d.futureproofData != null) { + if (typeof d.futureproofData === "string") + $util.base64.decode(d.futureproofData, m.futureproofData = $util.newBuffer($util.base64.length(d.futureproofData)), 0); + else if (d.futureproofData.length >= 0) + m.futureproofData = d.futureproofData; + } + if (d.statusPsa != null) { + if (typeof d.statusPsa !== "object") + throw TypeError(".proto.WebMessageInfo.statusPsa: object expected"); + m.statusPsa = $root.proto.StatusPSA.fromObject(d.statusPsa); + } + if (d.pollUpdates) { + if (!Array.isArray(d.pollUpdates)) + throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected"); + m.pollUpdates = []; + for (var i = 0; i < d.pollUpdates.length; ++i) { + if (typeof d.pollUpdates[i] !== "object") + throw TypeError(".proto.WebMessageInfo.pollUpdates: object expected"); + m.pollUpdates[i] = $root.proto.PollUpdate.fromObject(d.pollUpdates[i]); + } + } + if (d.pollAdditionalMetadata != null) { + if (typeof d.pollAdditionalMetadata !== "object") + throw TypeError(".proto.WebMessageInfo.pollAdditionalMetadata: object expected"); + m.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.fromObject(d.pollAdditionalMetadata); + } + if (d.agentId != null) { + m.agentId = String(d.agentId); + } + if (d.statusAlreadyViewed != null) { + m.statusAlreadyViewed = Boolean(d.statusAlreadyViewed); + } + if (d.messageSecret != null) { + if (typeof d.messageSecret === "string") + $util.base64.decode(d.messageSecret, m.messageSecret = $util.newBuffer($util.base64.length(d.messageSecret)), 0); + else if (d.messageSecret.length >= 0) + m.messageSecret = d.messageSecret; + } + if (d.keepInChat != null) { + if (typeof d.keepInChat !== "object") + throw TypeError(".proto.WebMessageInfo.keepInChat: object expected"); + m.keepInChat = $root.proto.KeepInChat.fromObject(d.keepInChat); + } + if (d.originalSelfAuthorUserJidString != null) { + m.originalSelfAuthorUserJidString = String(d.originalSelfAuthorUserJidString); + } + if (d.revokeMessageTimestamp != null) { + if ($util.Long) + (m.revokeMessageTimestamp = $util.Long.fromValue(d.revokeMessageTimestamp)).unsigned = true; + else if (typeof d.revokeMessageTimestamp === "string") + m.revokeMessageTimestamp = parseInt(d.revokeMessageTimestamp, 10); + else if (typeof d.revokeMessageTimestamp === "number") + m.revokeMessageTimestamp = d.revokeMessageTimestamp; + else if (typeof d.revokeMessageTimestamp === "object") + m.revokeMessageTimestamp = new $util.LongBits(d.revokeMessageTimestamp.low >>> 0, d.revokeMessageTimestamp.high >>> 0).toNumber(true); + } + if (d.pinInChat != null) { + if (typeof d.pinInChat !== "object") + throw TypeError(".proto.WebMessageInfo.pinInChat: object expected"); + m.pinInChat = $root.proto.PinInChat.fromObject(d.pinInChat); + } + if (d.premiumMessageInfo != null) { + if (typeof d.premiumMessageInfo !== "object") + throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected"); + m.premiumMessageInfo = $root.proto.PremiumMessageInfo.fromObject(d.premiumMessageInfo); + } + if (d.is1PBizBotMessage != null) { + m.is1PBizBotMessage = Boolean(d.is1PBizBotMessage); + } + if (d.isGroupHistoryMessage != null) { + m.isGroupHistoryMessage = Boolean(d.isGroupHistoryMessage); + } + if (d.botMessageInvokerJid != null) { + m.botMessageInvokerJid = String(d.botMessageInvokerJid); + } + if (d.commentMetadata != null) { + if (typeof d.commentMetadata !== "object") + throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected"); + m.commentMetadata = $root.proto.CommentMetadata.fromObject(d.commentMetadata); + } + if (d.eventResponses) { + if (!Array.isArray(d.eventResponses)) + throw TypeError(".proto.WebMessageInfo.eventResponses: array expected"); + m.eventResponses = []; + for (var i = 0; i < d.eventResponses.length; ++i) { + if (typeof d.eventResponses[i] !== "object") + throw TypeError(".proto.WebMessageInfo.eventResponses: object expected"); + m.eventResponses[i] = $root.proto.EventResponse.fromObject(d.eventResponses[i]); + } + } + if (d.reportingTokenInfo != null) { + if (typeof d.reportingTokenInfo !== "object") + throw TypeError(".proto.WebMessageInfo.reportingTokenInfo: object expected"); + m.reportingTokenInfo = $root.proto.ReportingTokenInfo.fromObject(d.reportingTokenInfo); + } + if (d.newsletterServerId != null) { + if ($util.Long) + (m.newsletterServerId = $util.Long.fromValue(d.newsletterServerId)).unsigned = true; + else if (typeof d.newsletterServerId === "string") + m.newsletterServerId = parseInt(d.newsletterServerId, 10); + else if (typeof d.newsletterServerId === "number") + m.newsletterServerId = d.newsletterServerId; + else if (typeof d.newsletterServerId === "object") + m.newsletterServerId = new $util.LongBits(d.newsletterServerId.low >>> 0, d.newsletterServerId.high >>> 0).toNumber(true); + } + if (d.eventAdditionalMetadata != null) { + if (typeof d.eventAdditionalMetadata !== "object") + throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected"); + m.eventAdditionalMetadata = $root.proto.EventAdditionalMetadata.fromObject(d.eventAdditionalMetadata); + } + if (d.isMentionedInStatus != null) { + m.isMentionedInStatus = Boolean(d.isMentionedInStatus); + } + if (d.statusMentions) { + if (!Array.isArray(d.statusMentions)) + throw TypeError(".proto.WebMessageInfo.statusMentions: array expected"); + m.statusMentions = []; + for (var i = 0; i < d.statusMentions.length; ++i) { + m.statusMentions[i] = String(d.statusMentions[i]); + } + } + if (d.targetMessageId != null) { + if (typeof d.targetMessageId !== "object") + throw TypeError(".proto.WebMessageInfo.targetMessageId: object expected"); + m.targetMessageId = $root.proto.MessageKey.fromObject(d.targetMessageId); + } + if (d.messageAddOns) { + if (!Array.isArray(d.messageAddOns)) + throw TypeError(".proto.WebMessageInfo.messageAddOns: array expected"); + m.messageAddOns = []; + for (var i = 0; i < d.messageAddOns.length; ++i) { + if (typeof d.messageAddOns[i] !== "object") + throw TypeError(".proto.WebMessageInfo.messageAddOns: object expected"); + m.messageAddOns[i] = $root.proto.MessageAddOn.fromObject(d.messageAddOns[i]); + } + } + if (d.statusMentionMessageInfo != null) { + if (typeof d.statusMentionMessageInfo !== "object") + throw TypeError(".proto.WebMessageInfo.statusMentionMessageInfo: object expected"); + m.statusMentionMessageInfo = $root.proto.StatusMentionMessage.fromObject(d.statusMentionMessageInfo); + } + if (d.isSupportAiMessage != null) { + m.isSupportAiMessage = Boolean(d.isSupportAiMessage); + } + if (d.statusMentionSources) { + if (!Array.isArray(d.statusMentionSources)) + throw TypeError(".proto.WebMessageInfo.statusMentionSources: array expected"); + m.statusMentionSources = []; + for (var i = 0; i < d.statusMentionSources.length; ++i) { + m.statusMentionSources[i] = String(d.statusMentionSources[i]); + } + } + if (d.supportAiCitations) { + if (!Array.isArray(d.supportAiCitations)) + throw TypeError(".proto.WebMessageInfo.supportAiCitations: array expected"); + m.supportAiCitations = []; + for (var i = 0; i < d.supportAiCitations.length; ++i) { + if (typeof d.supportAiCitations[i] !== "object") + throw TypeError(".proto.WebMessageInfo.supportAiCitations: object expected"); + m.supportAiCitations[i] = $root.proto.Citation.fromObject(d.supportAiCitations[i]); + } + } + if (d.botTargetId != null) { + m.botTargetId = String(d.botTargetId); + } + return m; + }; + + WebMessageInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.messageStubParameters = []; + d.labels = []; + d.userReceipt = []; + d.reactions = []; + d.pollUpdates = []; + d.eventResponses = []; + d.statusMentions = []; + d.messageAddOns = []; + d.statusMentionSources = []; + d.supportAiCitations = []; + } + if (o.defaults) { + d.key = null; + } + if (m.key != null && m.hasOwnProperty("key")) { + d.key = $root.proto.MessageKey.toObject(m.key, o); + } + if (m.message != null && m.hasOwnProperty("message")) { + d.message = $root.proto.Message.toObject(m.message, o); + if (o.oneofs) + d._message = "message"; + } + if (m.messageTimestamp != null && m.hasOwnProperty("messageTimestamp")) { + if (typeof m.messageTimestamp === "number") + d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp; + else + d.messageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageTimestamp) : o.longs === Number ? new $util.LongBits(m.messageTimestamp.low >>> 0, m.messageTimestamp.high >>> 0).toNumber(true) : m.messageTimestamp; + if (o.oneofs) + d._messageTimestamp = "messageTimestamp"; + } + if (m.status != null && m.hasOwnProperty("status")) { + d.status = o.enums === String ? $root.proto.WebMessageInfo.Status[m.status] === undefined ? m.status : $root.proto.WebMessageInfo.Status[m.status] : m.status; + if (o.oneofs) + d._status = "status"; + } + if (m.participant != null && m.hasOwnProperty("participant")) { + d.participant = m.participant; + if (o.oneofs) + d._participant = "participant"; + } + if (m.messageC2STimestamp != null && m.hasOwnProperty("messageC2STimestamp")) { + if (typeof m.messageC2STimestamp === "number") + d.messageC2STimestamp = o.longs === String ? String(m.messageC2STimestamp) : m.messageC2STimestamp; + else + d.messageC2STimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageC2STimestamp) : o.longs === Number ? new $util.LongBits(m.messageC2STimestamp.low >>> 0, m.messageC2STimestamp.high >>> 0).toNumber(true) : m.messageC2STimestamp; + if (o.oneofs) + d._messageC2STimestamp = "messageC2STimestamp"; + } + if (m.ignore != null && m.hasOwnProperty("ignore")) { + d.ignore = m.ignore; + if (o.oneofs) + d._ignore = "ignore"; + } + if (m.starred != null && m.hasOwnProperty("starred")) { + d.starred = m.starred; + if (o.oneofs) + d._starred = "starred"; + } + if (m.broadcast != null && m.hasOwnProperty("broadcast")) { + d.broadcast = m.broadcast; + if (o.oneofs) + d._broadcast = "broadcast"; + } + if (m.pushName != null && m.hasOwnProperty("pushName")) { + d.pushName = m.pushName; + if (o.oneofs) + d._pushName = "pushName"; + } + if (m.mediaCiphertextSha256 != null && m.hasOwnProperty("mediaCiphertextSha256")) { + d.mediaCiphertextSha256 = o.bytes === String ? $util.base64.encode(m.mediaCiphertextSha256, 0, m.mediaCiphertextSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaCiphertextSha256) : m.mediaCiphertextSha256; + if (o.oneofs) + d._mediaCiphertextSha256 = "mediaCiphertextSha256"; + } + if (m.multicast != null && m.hasOwnProperty("multicast")) { + d.multicast = m.multicast; + if (o.oneofs) + d._multicast = "multicast"; + } + if (m.urlText != null && m.hasOwnProperty("urlText")) { + d.urlText = m.urlText; + if (o.oneofs) + d._urlText = "urlText"; + } + if (m.urlNumber != null && m.hasOwnProperty("urlNumber")) { + d.urlNumber = m.urlNumber; + if (o.oneofs) + d._urlNumber = "urlNumber"; + } + if (m.messageStubType != null && m.hasOwnProperty("messageStubType")) { + d.messageStubType = o.enums === String ? $root.proto.WebMessageInfo.StubType[m.messageStubType] === undefined ? m.messageStubType : $root.proto.WebMessageInfo.StubType[m.messageStubType] : m.messageStubType; + if (o.oneofs) + d._messageStubType = "messageStubType"; + } + if (m.clearMedia != null && m.hasOwnProperty("clearMedia")) { + d.clearMedia = m.clearMedia; + if (o.oneofs) + d._clearMedia = "clearMedia"; + } + if (m.messageStubParameters && m.messageStubParameters.length) { + d.messageStubParameters = []; + for (var j = 0; j < m.messageStubParameters.length; ++j) { + d.messageStubParameters[j] = m.messageStubParameters[j]; + } + } + if (m.duration != null && m.hasOwnProperty("duration")) { + d.duration = m.duration; + if (o.oneofs) + d._duration = "duration"; + } + if (m.labels && m.labels.length) { + d.labels = []; + for (var j = 0; j < m.labels.length; ++j) { + d.labels[j] = m.labels[j]; + } + } + if (m.paymentInfo != null && m.hasOwnProperty("paymentInfo")) { + d.paymentInfo = $root.proto.PaymentInfo.toObject(m.paymentInfo, o); + if (o.oneofs) + d._paymentInfo = "paymentInfo"; + } + if (m.finalLiveLocation != null && m.hasOwnProperty("finalLiveLocation")) { + d.finalLiveLocation = $root.proto.Message.LiveLocationMessage.toObject(m.finalLiveLocation, o); + if (o.oneofs) + d._finalLiveLocation = "finalLiveLocation"; + } + if (m.quotedPaymentInfo != null && m.hasOwnProperty("quotedPaymentInfo")) { + d.quotedPaymentInfo = $root.proto.PaymentInfo.toObject(m.quotedPaymentInfo, o); + if (o.oneofs) + d._quotedPaymentInfo = "quotedPaymentInfo"; + } + if (m.ephemeralStartTimestamp != null && m.hasOwnProperty("ephemeralStartTimestamp")) { + if (typeof m.ephemeralStartTimestamp === "number") + d.ephemeralStartTimestamp = o.longs === String ? String(m.ephemeralStartTimestamp) : m.ephemeralStartTimestamp; + else + d.ephemeralStartTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralStartTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralStartTimestamp.low >>> 0, m.ephemeralStartTimestamp.high >>> 0).toNumber(true) : m.ephemeralStartTimestamp; + if (o.oneofs) + d._ephemeralStartTimestamp = "ephemeralStartTimestamp"; + } + if (m.ephemeralDuration != null && m.hasOwnProperty("ephemeralDuration")) { + d.ephemeralDuration = m.ephemeralDuration; + if (o.oneofs) + d._ephemeralDuration = "ephemeralDuration"; + } + if (m.ephemeralOffToOn != null && m.hasOwnProperty("ephemeralOffToOn")) { + d.ephemeralOffToOn = m.ephemeralOffToOn; + if (o.oneofs) + d._ephemeralOffToOn = "ephemeralOffToOn"; + } + if (m.ephemeralOutOfSync != null && m.hasOwnProperty("ephemeralOutOfSync")) { + d.ephemeralOutOfSync = m.ephemeralOutOfSync; + if (o.oneofs) + d._ephemeralOutOfSync = "ephemeralOutOfSync"; + } + if (m.bizPrivacyStatus != null && m.hasOwnProperty("bizPrivacyStatus")) { + d.bizPrivacyStatus = o.enums === String ? $root.proto.WebMessageInfo.BizPrivacyStatus[m.bizPrivacyStatus] === undefined ? m.bizPrivacyStatus : $root.proto.WebMessageInfo.BizPrivacyStatus[m.bizPrivacyStatus] : m.bizPrivacyStatus; + if (o.oneofs) + d._bizPrivacyStatus = "bizPrivacyStatus"; + } + if (m.verifiedBizName != null && m.hasOwnProperty("verifiedBizName")) { + d.verifiedBizName = m.verifiedBizName; + if (o.oneofs) + d._verifiedBizName = "verifiedBizName"; + } + if (m.mediaData != null && m.hasOwnProperty("mediaData")) { + d.mediaData = $root.proto.MediaData.toObject(m.mediaData, o); + if (o.oneofs) + d._mediaData = "mediaData"; + } + if (m.photoChange != null && m.hasOwnProperty("photoChange")) { + d.photoChange = $root.proto.PhotoChange.toObject(m.photoChange, o); + if (o.oneofs) + d._photoChange = "photoChange"; + } + if (m.userReceipt && m.userReceipt.length) { + d.userReceipt = []; + for (var j = 0; j < m.userReceipt.length; ++j) { + d.userReceipt[j] = $root.proto.UserReceipt.toObject(m.userReceipt[j], o); + } + } + if (m.reactions && m.reactions.length) { + d.reactions = []; + for (var j = 0; j < m.reactions.length; ++j) { + d.reactions[j] = $root.proto.Reaction.toObject(m.reactions[j], o); + } + } + if (m.quotedStickerData != null && m.hasOwnProperty("quotedStickerData")) { + d.quotedStickerData = $root.proto.MediaData.toObject(m.quotedStickerData, o); + if (o.oneofs) + d._quotedStickerData = "quotedStickerData"; + } + if (m.futureproofData != null && m.hasOwnProperty("futureproofData")) { + d.futureproofData = o.bytes === String ? $util.base64.encode(m.futureproofData, 0, m.futureproofData.length) : o.bytes === Array ? Array.prototype.slice.call(m.futureproofData) : m.futureproofData; + if (o.oneofs) + d._futureproofData = "futureproofData"; + } + if (m.statusPsa != null && m.hasOwnProperty("statusPsa")) { + d.statusPsa = $root.proto.StatusPSA.toObject(m.statusPsa, o); + if (o.oneofs) + d._statusPsa = "statusPsa"; + } + if (m.pollUpdates && m.pollUpdates.length) { + d.pollUpdates = []; + for (var j = 0; j < m.pollUpdates.length; ++j) { + d.pollUpdates[j] = $root.proto.PollUpdate.toObject(m.pollUpdates[j], o); + } + } + if (m.pollAdditionalMetadata != null && m.hasOwnProperty("pollAdditionalMetadata")) { + d.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.toObject(m.pollAdditionalMetadata, o); + if (o.oneofs) + d._pollAdditionalMetadata = "pollAdditionalMetadata"; + } + if (m.agentId != null && m.hasOwnProperty("agentId")) { + d.agentId = m.agentId; + if (o.oneofs) + d._agentId = "agentId"; + } + if (m.statusAlreadyViewed != null && m.hasOwnProperty("statusAlreadyViewed")) { + d.statusAlreadyViewed = m.statusAlreadyViewed; + if (o.oneofs) + d._statusAlreadyViewed = "statusAlreadyViewed"; + } + if (m.messageSecret != null && m.hasOwnProperty("messageSecret")) { + d.messageSecret = o.bytes === String ? $util.base64.encode(m.messageSecret, 0, m.messageSecret.length) : o.bytes === Array ? Array.prototype.slice.call(m.messageSecret) : m.messageSecret; + if (o.oneofs) + d._messageSecret = "messageSecret"; + } + if (m.keepInChat != null && m.hasOwnProperty("keepInChat")) { + d.keepInChat = $root.proto.KeepInChat.toObject(m.keepInChat, o); + if (o.oneofs) + d._keepInChat = "keepInChat"; + } + if (m.originalSelfAuthorUserJidString != null && m.hasOwnProperty("originalSelfAuthorUserJidString")) { + d.originalSelfAuthorUserJidString = m.originalSelfAuthorUserJidString; + if (o.oneofs) + d._originalSelfAuthorUserJidString = "originalSelfAuthorUserJidString"; + } + if (m.revokeMessageTimestamp != null && m.hasOwnProperty("revokeMessageTimestamp")) { + if (typeof m.revokeMessageTimestamp === "number") + d.revokeMessageTimestamp = o.longs === String ? String(m.revokeMessageTimestamp) : m.revokeMessageTimestamp; + else + d.revokeMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.revokeMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.revokeMessageTimestamp.low >>> 0, m.revokeMessageTimestamp.high >>> 0).toNumber(true) : m.revokeMessageTimestamp; + if (o.oneofs) + d._revokeMessageTimestamp = "revokeMessageTimestamp"; + } + if (m.pinInChat != null && m.hasOwnProperty("pinInChat")) { + d.pinInChat = $root.proto.PinInChat.toObject(m.pinInChat, o); + if (o.oneofs) + d._pinInChat = "pinInChat"; + } + if (m.premiumMessageInfo != null && m.hasOwnProperty("premiumMessageInfo")) { + d.premiumMessageInfo = $root.proto.PremiumMessageInfo.toObject(m.premiumMessageInfo, o); + if (o.oneofs) + d._premiumMessageInfo = "premiumMessageInfo"; + } + if (m.is1PBizBotMessage != null && m.hasOwnProperty("is1PBizBotMessage")) { + d.is1PBizBotMessage = m.is1PBizBotMessage; + if (o.oneofs) + d._is1PBizBotMessage = "is1PBizBotMessage"; + } + if (m.isGroupHistoryMessage != null && m.hasOwnProperty("isGroupHistoryMessage")) { + d.isGroupHistoryMessage = m.isGroupHistoryMessage; + if (o.oneofs) + d._isGroupHistoryMessage = "isGroupHistoryMessage"; + } + if (m.botMessageInvokerJid != null && m.hasOwnProperty("botMessageInvokerJid")) { + d.botMessageInvokerJid = m.botMessageInvokerJid; + if (o.oneofs) + d._botMessageInvokerJid = "botMessageInvokerJid"; + } + if (m.commentMetadata != null && m.hasOwnProperty("commentMetadata")) { + d.commentMetadata = $root.proto.CommentMetadata.toObject(m.commentMetadata, o); + if (o.oneofs) + d._commentMetadata = "commentMetadata"; + } + if (m.eventResponses && m.eventResponses.length) { + d.eventResponses = []; + for (var j = 0; j < m.eventResponses.length; ++j) { + d.eventResponses[j] = $root.proto.EventResponse.toObject(m.eventResponses[j], o); + } + } + if (m.reportingTokenInfo != null && m.hasOwnProperty("reportingTokenInfo")) { + d.reportingTokenInfo = $root.proto.ReportingTokenInfo.toObject(m.reportingTokenInfo, o); + if (o.oneofs) + d._reportingTokenInfo = "reportingTokenInfo"; + } + if (m.newsletterServerId != null && m.hasOwnProperty("newsletterServerId")) { + if (typeof m.newsletterServerId === "number") + d.newsletterServerId = o.longs === String ? String(m.newsletterServerId) : m.newsletterServerId; + else + d.newsletterServerId = o.longs === String ? $util.Long.prototype.toString.call(m.newsletterServerId) : o.longs === Number ? new $util.LongBits(m.newsletterServerId.low >>> 0, m.newsletterServerId.high >>> 0).toNumber(true) : m.newsletterServerId; + if (o.oneofs) + d._newsletterServerId = "newsletterServerId"; + } + if (m.eventAdditionalMetadata != null && m.hasOwnProperty("eventAdditionalMetadata")) { + d.eventAdditionalMetadata = $root.proto.EventAdditionalMetadata.toObject(m.eventAdditionalMetadata, o); + if (o.oneofs) + d._eventAdditionalMetadata = "eventAdditionalMetadata"; + } + if (m.isMentionedInStatus != null && m.hasOwnProperty("isMentionedInStatus")) { + d.isMentionedInStatus = m.isMentionedInStatus; + if (o.oneofs) + d._isMentionedInStatus = "isMentionedInStatus"; + } + if (m.statusMentions && m.statusMentions.length) { + d.statusMentions = []; + for (var j = 0; j < m.statusMentions.length; ++j) { + d.statusMentions[j] = m.statusMentions[j]; + } + } + if (m.targetMessageId != null && m.hasOwnProperty("targetMessageId")) { + d.targetMessageId = $root.proto.MessageKey.toObject(m.targetMessageId, o); + if (o.oneofs) + d._targetMessageId = "targetMessageId"; + } + if (m.messageAddOns && m.messageAddOns.length) { + d.messageAddOns = []; + for (var j = 0; j < m.messageAddOns.length; ++j) { + d.messageAddOns[j] = $root.proto.MessageAddOn.toObject(m.messageAddOns[j], o); + } + } + if (m.statusMentionMessageInfo != null && m.hasOwnProperty("statusMentionMessageInfo")) { + d.statusMentionMessageInfo = $root.proto.StatusMentionMessage.toObject(m.statusMentionMessageInfo, o); + if (o.oneofs) + d._statusMentionMessageInfo = "statusMentionMessageInfo"; + } + if (m.isSupportAiMessage != null && m.hasOwnProperty("isSupportAiMessage")) { + d.isSupportAiMessage = m.isSupportAiMessage; + if (o.oneofs) + d._isSupportAiMessage = "isSupportAiMessage"; + } + if (m.statusMentionSources && m.statusMentionSources.length) { + d.statusMentionSources = []; + for (var j = 0; j < m.statusMentionSources.length; ++j) { + d.statusMentionSources[j] = m.statusMentionSources[j]; + } + } + if (m.supportAiCitations && m.supportAiCitations.length) { + d.supportAiCitations = []; + for (var j = 0; j < m.supportAiCitations.length; ++j) { + d.supportAiCitations[j] = $root.proto.Citation.toObject(m.supportAiCitations[j], o); + } + } + if (m.botTargetId != null && m.hasOwnProperty("botTargetId")) { + d.botTargetId = m.botTargetId; + if (o.oneofs) + d._botTargetId = "botTargetId"; + } + return d; + }; + + WebMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WebMessageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; @@ -37230,11 +84201,31 @@ export const proto = $root.proto = (() => { this[ks[i]] = p[ks[i]]; } - WebNotificationsInfo.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - WebNotificationsInfo.prototype.unreadChats = 0; - WebNotificationsInfo.prototype.notifyMessageCount = 0; + WebNotificationsInfo.prototype.timestamp = null; + WebNotificationsInfo.prototype.unreadChats = null; + WebNotificationsInfo.prototype.notifyMessageCount = null; WebNotificationsInfo.prototype.notifyMessages = $util.emptyArray; + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebNotificationsInfo.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebNotificationsInfo.prototype, "_unreadChats", { + get: $util.oneOfGetter($oneOfFields = ["unreadChats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WebNotificationsInfo.prototype, "_notifyMessageCount", { + get: $util.oneOfGetter($oneOfFields = ["notifyMessageCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + WebNotificationsInfo.create = function create(properties) { return new WebNotificationsInfo(properties); }; @@ -37290,6 +84281,77 @@ export const proto = $root.proto = (() => { return m; }; + WebNotificationsInfo.fromObject = function fromObject(d) { + if (d instanceof $root.proto.WebNotificationsInfo) + return d; + var m = new $root.proto.WebNotificationsInfo(); + if (d.timestamp != null) { + if ($util.Long) + (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true; + else if (typeof d.timestamp === "string") + m.timestamp = parseInt(d.timestamp, 10); + else if (typeof d.timestamp === "number") + m.timestamp = d.timestamp; + else if (typeof d.timestamp === "object") + m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true); + } + if (d.unreadChats != null) { + m.unreadChats = d.unreadChats >>> 0; + } + if (d.notifyMessageCount != null) { + m.notifyMessageCount = d.notifyMessageCount >>> 0; + } + if (d.notifyMessages) { + if (!Array.isArray(d.notifyMessages)) + throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected"); + m.notifyMessages = []; + for (var i = 0; i < d.notifyMessages.length; ++i) { + if (typeof d.notifyMessages[i] !== "object") + throw TypeError(".proto.WebNotificationsInfo.notifyMessages: object expected"); + m.notifyMessages[i] = $root.proto.WebMessageInfo.fromObject(d.notifyMessages[i]); + } + } + return m; + }; + + WebNotificationsInfo.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.notifyMessages = []; + } + if (m.timestamp != null && m.hasOwnProperty("timestamp")) { + if (typeof m.timestamp === "number") + d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; + else + d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; + if (o.oneofs) + d._timestamp = "timestamp"; + } + if (m.unreadChats != null && m.hasOwnProperty("unreadChats")) { + d.unreadChats = m.unreadChats; + if (o.oneofs) + d._unreadChats = "unreadChats"; + } + if (m.notifyMessageCount != null && m.hasOwnProperty("notifyMessageCount")) { + d.notifyMessageCount = m.notifyMessageCount; + if (o.oneofs) + d._notifyMessageCount = "notifyMessageCount"; + } + if (m.notifyMessages && m.notifyMessages.length) { + d.notifyMessages = []; + for (var j = 0; j < m.notifyMessages.length; ++j) { + d.notifyMessages[j] = $root.proto.WebMessageInfo.toObject(m.notifyMessages[j], o); + } + } + return d; + }; + + WebNotificationsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + WebNotificationsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; diff --git a/src/Signal/Group/sender-key-distribution-message.ts b/src/Signal/Group/sender-key-distribution-message.ts index a14e3f34..7f9f3cd4 100644 --- a/src/Signal/Group/sender-key-distribution-message.ts +++ b/src/Signal/Group/sender-key-distribution-message.ts @@ -1,7 +1,13 @@ import { proto } from '../../../WAProto/index.js' -import { decodeAndHydrate } from '../../Utils/proto-utils' import { CiphertextMessage } from './ciphertext-message' +interface SenderKeyDistributionMessageStructure { + id: number + iteration: number + chainKey: Uint8Array + signingKey: Uint8Array +} + export class SenderKeyDistributionMessage extends CiphertextMessage { private readonly id: number private readonly iteration: number @@ -21,7 +27,9 @@ export class SenderKeyDistributionMessage extends CiphertextMessage { if (serialized) { try { const message = serialized.slice(1) - const distributionMessage = decodeAndHydrate(proto.SenderKeyDistributionMessage, message) + const distributionMessage = proto.SenderKeyDistributionMessage.decode( + message + ).toJSON() as SenderKeyDistributionMessageStructure this.serialized = serialized this.id = distributionMessage.id diff --git a/src/Signal/Group/sender-key-message.ts b/src/Signal/Group/sender-key-message.ts index 7be40a2b..7cbf7048 100644 --- a/src/Signal/Group/sender-key-message.ts +++ b/src/Signal/Group/sender-key-message.ts @@ -1,8 +1,13 @@ import { calculateSignature, verifySignature } from 'libsignal/src/curve' import { proto } from '../../../WAProto/index.js' -import { decodeAndHydrate } from '../../Utils/proto-utils' import { CiphertextMessage } from './ciphertext-message' +interface SenderKeyMessageStructure { + id: number + iteration: number + ciphertext: Buffer +} + export class SenderKeyMessage extends CiphertextMessage { private readonly SIGNATURE_LENGTH = 64 private readonly messageVersion: number @@ -25,7 +30,7 @@ export class SenderKeyMessage extends CiphertextMessage { const version = serialized[0]! const message = serialized.slice(1, serialized.length - this.SIGNATURE_LENGTH) const signature = serialized.slice(-1 * this.SIGNATURE_LENGTH) - const senderKeyMessage = decodeAndHydrate(proto.SenderKeyMessage, message) + const senderKeyMessage = proto.SenderKeyMessage.decode(message).toJSON() as SenderKeyMessageStructure this.serialized = serialized this.messageVersion = (version & 0xff) >> 4 diff --git a/src/Socket/communities.ts b/src/Socket/communities.ts index 9a553976..6d58a8f2 100644 --- a/src/Socket/communities.ts +++ b/src/Socket/communities.ts @@ -368,7 +368,7 @@ export const makeCommunitiesSocket = (config: SocketConfig) => { // update the invite message to be expired if (key.id) { // create new invite message that is expired - inviteMessage = proto.Message.GroupInviteMessage.create(inviteMessage) + inviteMessage = proto.Message.GroupInviteMessage.fromObject(inviteMessage) inviteMessage.inviteExpiration = 0 inviteMessage.inviteCode = '' ev.emit('messages.update', [ diff --git a/src/Socket/groups.ts b/src/Socket/groups.ts index 1c67e386..4ff1a99b 100644 --- a/src/Socket/groups.ts +++ b/src/Socket/groups.ts @@ -239,7 +239,7 @@ export const makeGroupsSocket = (config: SocketConfig) => { // update the invite message to be expired if (key.id) { // create new invite message that is expired - inviteMessage = proto.Message.GroupInviteMessage.create(inviteMessage) + inviteMessage = proto.Message.GroupInviteMessage.fromObject(inviteMessage) inviteMessage.inviteExpiration = 0 inviteMessage.inviteCode = '' ev.emit('messages.update', [ diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 49d14e52..6e08b7dc 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -11,6 +11,7 @@ import type { SocketConfig, WACallEvent, WACallUpdateType, + WAMessage, WAMessageKey, WAPatchName } from '../Types' @@ -39,7 +40,6 @@ import { xmppSignedPreKey } from '../Utils' import { makeMutex } from '../Utils/make-mutex' -import { decodeAndHydrate } from '../Utils/proto-utils' import { areJidsSameUser, type BinaryNode, @@ -294,8 +294,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { typeof plaintextNode.content === 'string' ? Buffer.from(plaintextNode.content, 'binary') : Buffer.from(plaintextNode.content as Uint8Array) - const messageProto = decodeAndHydrate(proto.Message, contentBuf) - const fullMessage = proto.WebMessageInfo.create({ + const messageProto = proto.Message.decode(contentBuf).toJSON() + const fullMessage = proto.WebMessageInfo.fromObject({ key: { remoteJid: from, id: child.attrs.message_id || child.attrs.server_id, @@ -303,7 +303,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { }, message: messageProto, messageTimestamp: +child.attrs.t! - }) + }).toJSON() as WAMessage await upsertMessage(fullMessage, 'append') logger.info('Processed plaintext newsletter message') } catch (error) { @@ -546,7 +546,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { } } - const handleGroupNotification = (participant: string, child: BinaryNode, msg: Partial) => { + const handleGroupNotification = (participant: string, child: BinaryNode, msg: Partial) => { const participantJid = getBinaryNodeChild(child, 'participant')?.attrs?.jid || participant // TODO: Add participant LID switch (child?.tag) { @@ -658,7 +658,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { } const processNotification = async (node: BinaryNode) => { - const result: Partial = {} + const result: Partial = {} const [child] = getAllBinaryNodeChildren(node) const nodeType = node.attrs.type const from = jidNormalizedUser(node.attrs.from) @@ -874,7 +874,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { await msgRetryCache.set(key, newValue) } - const sendMessagesAgain = async (key: proto.IMessageKey, ids: string[], retryNode: BinaryNode) => { + const sendMessagesAgain = async (key: WAMessageKey, ids: string[], retryNode: BinaryNode) => { const remoteJid = key.remoteJid! const participant = key.participant || remoteJid @@ -1089,7 +1089,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { msg.participant ??= node.attrs.participant msg.messageTimestamp = +node.attrs.t! - const fullMsg = proto.WebMessageInfo.create(msg as proto.IWebMessageInfo) + const fullMsg = proto.WebMessageInfo.fromObject(msg) as WAMessage await upsertMessage(fullMsg, 'append') } }) @@ -1445,7 +1445,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { // missed call + group call notification message generation if (call.status === 'timeout' || (call.status === 'offer' && call.isGroup)) { - const msg: proto.IWebMessageInfo = { + const msg: WAMessage = { key: { remoteJid: call.chatId, id: call.id, @@ -1465,7 +1465,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { msg.message = { call: { callKey: Buffer.from(call.id) } } } - const protoMsg = proto.WebMessageInfo.create(msg) + const protoMsg = proto.WebMessageInfo.fromObject(msg) as WAMessage upsertMessage(protoMsg, call.offline ? 'append' : 'notify') } }) diff --git a/src/Socket/messages-send.ts b/src/Socket/messages-send.ts index cb2a2f2a..d93c57af 100644 --- a/src/Socket/messages-send.ts +++ b/src/Socket/messages-send.ts @@ -9,6 +9,7 @@ import type { MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, + WAMessage, WAMessageKey } from '../Types' import { @@ -1018,7 +1019,7 @@ export const makeMessagesSocket = (config: SocketConfig) => { createParticipantNodes, getUSyncDevices, messageRetryManager, - updateMediaMessage: async (message: proto.IWebMessageInfo) => { + updateMediaMessage: async (message: WAMessage) => { const content = assertMediaContent(message.message) const mediaKey = content.mediaKey! const meId = authState.creds.me!.id @@ -1036,15 +1037,15 @@ export const makeMessagesSocket = (config: SocketConfig) => { try { const media = await decryptMediaRetryData(result.media!, mediaKey, result.key.id!) if (media.result !== proto.MediaRetryNotification.ResultType.SUCCESS) { - const resultStr = proto.MediaRetryNotification.ResultType[media.result] + const resultStr = proto.MediaRetryNotification.ResultType[media.result!] throw new Boom(`Media re-upload failed by device (${resultStr})`, { data: media, - statusCode: getStatusCodeForMediaRetry(media.result) || 404 + statusCode: getStatusCodeForMediaRetry(media.result!) || 404 }) } content.directPath = media.directPath - content.url = getUrlFromDirectPath(content.directPath) + content.url = getUrlFromDirectPath(content.directPath!) logger.debug({ directPath: media.directPath, key: result.key }, 'media update successful') } catch (err: any) { diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index 689558bc..0cdc2648 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -33,7 +33,6 @@ import { promiseTimeout } from '../Utils' import { getPlatformId } from '../Utils/browser-utils' -import { decodeAndHydrate } from '../Utils/proto-utils' import { assertNodeErrorFree, type BinaryNode, @@ -366,14 +365,14 @@ export const makeSocket = (config: SocketConfig) => { let helloMsg: proto.IHandshakeMessage = { clientHello: { ephemeral: ephemeralKeyPair.public } } - helloMsg = proto.HandshakeMessage.create(helloMsg) + helloMsg = proto.HandshakeMessage.fromObject(helloMsg) logger.info({ browser, helloMsg }, 'connected to WA') const init = proto.HandshakeMessage.encode(helloMsg).finish() const result = await awaitNextMessage(init) - const handshake = decodeAndHydrate(proto.HandshakeMessage, result) + const handshake = proto.HandshakeMessage.decode(result) logger.trace({ handshake }, 'handshake recv from WA') diff --git a/src/Types/Events.ts b/src/Types/Events.ts index 0158fbc1..b66eb5b3 100644 --- a/src/Types/Events.ts +++ b/src/Types/Events.ts @@ -23,7 +23,7 @@ export type BaileysEventMap = { messages: WAMessage[] isLatest?: boolean progress?: number | null - syncType?: proto.HistorySync.HistorySyncType + syncType?: proto.HistorySync.HistorySyncType | null peerDataRequestSessionId?: string | null } /** upsert chats */ diff --git a/src/Types/Message.ts b/src/Types/Message.ts index bba8a3f5..5485fe68 100644 --- a/src/Types/Message.ts +++ b/src/Types/Message.ts @@ -357,11 +357,11 @@ export type MessageUpsertType = 'append' | 'notify' export type MessageUserReceipt = proto.IUserReceipt -export type WAMessageUpdate = { update: Partial; key: proto.IMessageKey } +export type WAMessageUpdate = { update: Partial; key: WAMessageKey } export type WAMessageCursor = { before: WAMessageKey | undefined } | { after: WAMessageKey | undefined } -export type MessageUserReceiptUpdate = { key: proto.IMessageKey; receipt: MessageUserReceipt } +export type MessageUserReceiptUpdate = { key: WAMessageKey; receipt: MessageUserReceipt } export type MediaDecryptionKeyInfo = { iv: Buffer @@ -369,4 +369,4 @@ export type MediaDecryptionKeyInfo = { macKey?: Buffer } -export type MinimalMessage = Pick +export type MinimalMessage = Pick diff --git a/src/Types/Socket.ts b/src/Types/Socket.ts index da68db01..eba8779c 100644 --- a/src/Types/Socket.ts +++ b/src/Types/Socket.ts @@ -4,7 +4,7 @@ import { proto } from '../../WAProto/index.js' import type { ILogger } from '../Utils/logger' import type { AuthenticationState, LIDMapping, SignalAuthState, TransactionCapabilityOptions } from './Auth' import type { GroupMetadata } from './GroupMetadata' -import { type MediaConnInfo } from './Message' +import { type MediaConnInfo, type WAMessageKey } from './Message' import type { SignalRepositoryWithLIDStore } from './Signal' export type WAVersion = [number, number, number] @@ -137,7 +137,7 @@ export type SocketConfig = { * implement this so that messages failed to send * (solves the "this message can take a while" issue) can be retried * */ - getMessage: (key: proto.IMessageKey) => Promise + getMessage: (key: WAMessageKey) => Promise /** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */ cachedGroupMetadata: (jid: string) => Promise diff --git a/src/Utils/chat-utils.ts b/src/Utils/chat-utils.ts index bb1a8d05..6e31aa64 100644 --- a/src/Utils/chat-utils.ts +++ b/src/Utils/chat-utils.ts @@ -24,7 +24,6 @@ import { toNumber } from './generics' import type { ILogger } from './logger' import { LT_HASH_ANTI_TAMPERING } from './lt-hash' import { downloadContentFromMessage } from './messages-media' -import { decodeAndHydrate } from './proto-utils' type FetchAppStateSyncKey = (keyId: string) => Promise @@ -154,7 +153,7 @@ export const encodeSyncdPatch = async ( state = { ...state, indexValueMap: { ...state.indexValueMap } } const indexBuffer = Buffer.from(JSON.stringify(index)) - const dataProto = proto.SyncActionData.create({ + const dataProto = proto.SyncActionData.fromObject({ index: indexBuffer, value: syncAction, padding: new Uint8Array(0), @@ -233,16 +232,16 @@ export const decodeSyncdMutations = async ( } const result = aesDecrypt(encContent, key.valueEncryptionKey) - const syncAction = decodeAndHydrate(proto.SyncActionData, result) + const syncAction = proto.SyncActionData.decode(result) if (validateMacs) { - const hmac = hmacSign(syncAction.index, key.indexKey) + const hmac = hmacSign(syncAction.index!, key.indexKey) if (Buffer.compare(hmac, record.index!.blob!) !== 0) { throw new Boom('HMAC index verification failed') } } - const indexStr = Buffer.from(syncAction.index).toString() + const indexStr = Buffer.from(syncAction.index!).toString() onMutation({ syncAction, index: JSON.parse(indexStr) }) ltGenerator.mix({ @@ -327,9 +326,9 @@ export const extractSyncdPatches = async (result: BinaryNode, options: RequestIn snapshotNode.content = Buffer.from(Object.values(snapshotNode.content)) } - const blobRef = decodeAndHydrate(proto.ExternalBlobReference, snapshotNode.content as Buffer) + const blobRef = proto.ExternalBlobReference.decode(snapshotNode.content as Buffer) const data = await downloadExternalBlob(blobRef, options) - snapshot = decodeAndHydrate(proto.SyncdSnapshot, data) + snapshot = proto.SyncdSnapshot.decode(data) } for (let { content } of patches) { @@ -338,7 +337,7 @@ export const extractSyncdPatches = async (result: BinaryNode, options: RequestIn content = Buffer.from(Object.values(content)) } - const syncd = decodeAndHydrate(proto.SyncdPatch, content as Uint8Array) + const syncd = proto.SyncdPatch.decode(content as Uint8Array) if (!syncd.version) { syncd.version = { version: +collectionNode.attrs.version! + 1 } } @@ -366,7 +365,7 @@ export const downloadExternalBlob = async (blob: proto.IExternalBlobReference, o export const downloadExternalPatch = async (blob: proto.IExternalBlobReference, options: RequestInit) => { const buffer = await downloadExternalBlob(blob, options) - const syncData = decodeAndHydrate(proto.SyncdMutations, buffer) + const syncData = proto.SyncdMutations.decode(buffer) return syncData } diff --git a/src/Utils/decode-wa-message.ts b/src/Utils/decode-wa-message.ts index 46c675c9..d4eb2d61 100644 --- a/src/Utils/decode-wa-message.ts +++ b/src/Utils/decode-wa-message.ts @@ -18,7 +18,6 @@ import { } from '../WABinary' import { unpadRandomMax16 } from './generics' import type { ILogger } from './logger' -import { decodeAndHydrate } from './proto-utils' const getDecryptionJid = async (sender: string, repository: SignalRepositoryWithLIDStore): Promise => { if (sender.includes('@lid')) { @@ -239,8 +238,8 @@ export const decryptMessageNode = ( if (Array.isArray(stanza.content)) { for (const { tag, attrs, content } of stanza.content) { if (tag === 'verified_name' && content instanceof Uint8Array) { - const cert = decodeAndHydrate(proto.VerifiedNameCertificate, content) - const details = proto.VerifiedNameCertificate.Details.decode(cert.details) + const cert = proto.VerifiedNameCertificate.decode(content) + const details = proto.VerifiedNameCertificate.Details.decode(cert.details!) fullMessage.verifiedBizName = details.verifiedName } @@ -294,8 +293,7 @@ export const decryptMessageNode = ( throw new Error(`Unknown e2e type: ${e2eType}`) } - let msg: proto.IMessage = decodeAndHydrate( - proto.Message, + let msg: proto.IMessage = proto.Message.decode( e2eType !== 'plaintext' ? unpadRandomMax16(msgBuffer) : msgBuffer ) msg = msg.deviceSentMessage?.message || msg diff --git a/src/Utils/event-buffer.ts b/src/Utils/event-buffer.ts index cd63640d..20ca7da8 100644 --- a/src/Utils/event-buffer.ts +++ b/src/Utils/event-buffer.ts @@ -1,5 +1,4 @@ import EventEmitter from 'events' -import { proto } from '../../WAProto/index.js' import type { BaileysEvent, BaileysEventEmitter, @@ -8,7 +7,8 @@ import type { Chat, ChatUpdate, Contact, - WAMessage + WAMessage, + WAMessageKey } from '../Types' import { WAMessageStatus } from '../Types' import { trimUndefined } from './generics' @@ -241,14 +241,15 @@ function append( switch (event) { case 'messaging-history.set': for (const chat of eventData.chats as Chat[]) { - const existingChat = data.historySets.chats[chat.id] + const id = chat.id || '' + const existingChat = data.historySets.chats[id] if (existingChat) { existingChat.endOfHistoryTransferType = chat.endOfHistoryTransferType } - if (!existingChat && !historyCache.has(chat.id)) { - data.historySets.chats[chat.id] = chat - historyCache.add(chat.id) + if (!existingChat && !historyCache.has(id)) { + data.historySets.chats[id] = chat + historyCache.add(id) absorbingChatUpdate(chat) } @@ -286,11 +287,12 @@ function append( break case 'chats.upsert': for (const chat of eventData as Chat[]) { - let upsert = data.chatUpserts[chat.id] - if (!upsert) { - upsert = data.historySets.chats[chat.id] + const id = chat.id || '' + let upsert = data.chatUpserts[id] + if (id && !upsert) { + upsert = data.historySets.chats[id] if (upsert) { - logger.debug({ chatId: chat.id }, 'absorbed chat upsert in chat set') + logger.debug({ chatId: id }, 'absorbed chat upsert in chat set') } } @@ -298,13 +300,13 @@ function append( upsert = concatChats(upsert, chat) } else { upsert = chat - data.chatUpserts[chat.id] = upsert + data.chatUpserts[id] = upsert } absorbingChatUpdate(upsert) - if (data.chatDeletes.has(chat.id)) { - data.chatDeletes.delete(chat.id) + if (data.chatDeletes.has(id)) { + data.chatDeletes.delete(id) } } @@ -521,7 +523,7 @@ function append( } function absorbingChatUpdate(existing: Chat) { - const chatId = existing.id + const chatId = existing.id || '' const update = data.chatUpdates[chatId] if (update) { const conditionMatches = update.conditional ? update.conditional(data) : true @@ -657,4 +659,4 @@ function concatChats>(a: C, b: Partial) { return Object.assign(a, b) } -const stringifyMessageKey = (key: proto.IMessageKey) => `${key.remoteJid},${key.id},${key.fromMe ? '1' : '0'}` +const stringifyMessageKey = (key: WAMessageKey) => `${key.remoteJid},${key.id},${key.fromMe ? '1' : '0'}` diff --git a/src/Utils/generics.ts b/src/Utils/generics.ts index 26b874a7..569d3218 100644 --- a/src/Utils/generics.ts +++ b/src/Utils/generics.ts @@ -2,7 +2,14 @@ import { Boom } from '@hapi/boom' import { createHash, randomBytes } from 'crypto' import { proto } from '../../WAProto/index.js' const baileysVersion = [2, 3000, 1023223821] -import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAVersion } from '../Types' +import type { + BaileysEventEmitter, + BaileysEventMap, + ConnectionState, + WACallUpdateType, + WAMessageKey, + WAVersion +} from '../Types' import { DisconnectReason } from '../Types' import { type BinaryNode, getAllBinaryNodeChildren, jidDecode } from '../WABinary' import { sha256 } from './crypto' @@ -37,7 +44,7 @@ export const BufferJSON = { } } -export const getKeyAuthor = (key: proto.IMessageKey | undefined | null, meId = 'me') => +export const getKeyAuthor = (key: WAMessageKey | undefined | null, meId = 'me') => (key?.fromMe ? meId : key?.participant || key?.remoteJid) || '' export const writeRandomPadMax16 = (msg: Uint8Array) => { diff --git a/src/Utils/history.ts b/src/Utils/history.ts index bfac2ff6..b2557a80 100644 --- a/src/Utils/history.ts +++ b/src/Utils/history.ts @@ -1,12 +1,11 @@ import { promisify } from 'util' import { inflate } from 'zlib' import { proto } from '../../WAProto/index.js' -import type { Chat, Contact } from '../Types' +import type { Chat, Contact, WAMessage } from '../Types' import { WAMessageStubType } from '../Types' import { toNumber } from './generics' import { normalizeMessageContent } from './messages' import { downloadContentFromMessage } from './messages-media' -import { decodeAndHydrate } from './proto-utils' const inflatePromise = promisify(inflate) @@ -22,12 +21,12 @@ export const downloadHistory = async (msg: proto.Message.IHistorySyncNotificatio // decompress buffer buffer = await inflatePromise(buffer) - const syncData = decodeAndHydrate(proto.HistorySync, buffer) + const syncData = proto.HistorySync.decode(buffer) return syncData } export const processHistoryMessage = (item: proto.IHistorySync) => { - const messages: proto.IWebMessageInfo[] = [] + const messages: WAMessage[] = [] const contacts: Contact[] = [] const chats: Chat[] = [] @@ -38,7 +37,7 @@ export const processHistoryMessage = (item: proto.IHistorySync) => { case proto.HistorySync.HistorySyncType.ON_DEMAND: for (const chat of item.conversations! as Chat[]) { contacts.push({ - id: chat.id, + id: chat.id!, name: chat.name || undefined, lid: chat.lidJid || undefined, phoneNumber: chat.pnJid || undefined @@ -48,7 +47,7 @@ export const processHistoryMessage = (item: proto.IHistorySync) => { delete chat.messages for (const item of msgs) { - const message = item.message! + const message = item.message! as WAMessage messages.push(message) if (!chat.messages?.length) { @@ -103,7 +102,7 @@ export const downloadAndProcessHistorySyncNotification = async ( export const getHistoryMsg = (message: proto.IMessage) => { const normalizedContent = !!message ? normalizeMessageContent(message) : undefined - const anyHistoryMsg = normalizedContent?.protocolMessage?.historySyncNotification + const anyHistoryMsg = normalizedContent?.protocolMessage?.historySyncNotification! return anyHistoryMsg } diff --git a/src/Utils/index.ts b/src/Utils/index.ts index 3b86b59e..0f45a06e 100644 --- a/src/Utils/index.ts +++ b/src/Utils/index.ts @@ -17,4 +17,3 @@ export * from './event-buffer' export * from './process-message' export * from './message-retry-manager' export * from './browser-utils' -export * from './proto-utils' diff --git a/src/Utils/messages-media.ts b/src/Utils/messages-media.ts index b071c512..d95fafd0 100644 --- a/src/Utils/messages-media.ts +++ b/src/Utils/messages-media.ts @@ -20,13 +20,13 @@ import type { WAGenericMediaMessage, WAMediaUpload, WAMediaUploadFunction, - WAMessageContent + WAMessageContent, + WAMessageKey } from '../Types' import { type BinaryNode, getBinaryNodeChild, getBinaryNodeChildBuffer, jidNormalizedUser } from '../WABinary' import { aesDecryptGCM, aesEncryptGCM, hkdf } from './crypto' import { generateMessageIDV2 } from './generics' import type { ILogger } from './logger' -import { decodeAndHydrate } from './proto-utils' const getTmpFilesDirectory = () => tmpdir() @@ -724,7 +724,7 @@ const getMediaRetryKey = (mediaKey: Buffer | Uint8Array) => { /** * Generate a binary node that will request the phone to re-upload the media & return the newly uploaded URL */ -export const encryptMediaRetryRequest = async (key: proto.IMessageKey, mediaKey: Buffer | Uint8Array, meId: string) => { +export const encryptMediaRetryRequest = async (key: WAMessageKey, mediaKey: Buffer | Uint8Array, meId: string) => { const recp: proto.IServerErrorReceipt = { stanzaId: key.id } const recpBuffer = proto.ServerErrorReceipt.encode(recp).finish() @@ -806,7 +806,7 @@ export const decryptMediaRetryData = async ( ) => { const retryKey = await getMediaRetryKey(mediaKey) const plaintext = aesDecryptGCM(ciphertext, retryKey, iv, Buffer.from(msgId)) - return decodeAndHydrate(proto.MediaRetryNotification, plaintext) + return proto.MediaRetryNotification.decode(plaintext) } export const getStatusCodeForMediaRetry = (code: number) => diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index 04ea8f1b..aff8bebf 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -23,6 +23,7 @@ import type { WAMediaUpload, WAMessage, WAMessageContent, + WAMessageKey, WATextMessage } from '../Types' import { WAMessageStatus, WAProto } from '../Types' @@ -39,7 +40,6 @@ import { getRawMediaUploadData, type MediaDownloadOptions } from './messages-media' -import { decodeAndHydrate } from './proto-utils' type MediaUploadData = { media: WAMediaUpload @@ -156,7 +156,7 @@ export const prepareWAMessageMedia = async ( if (mediaBuff) { logger?.debug({ cacheableKey }, 'got media cache hit') - const obj = decodeAndHydrate(proto.Message, mediaBuff) + const obj = proto.Message.decode(mediaBuff) const key = `${mediaType}Message` Object.assign(obj[key as keyof proto.Message]!, { ...uploadData, media: undefined }) @@ -183,9 +183,9 @@ export const prepareWAMessageMedia = async ( await fs.unlink(filePath) - const obj = WAProto.Message.create({ + const obj = WAProto.Message.fromObject({ // todo: add more support here - [`${mediaType}Message`]: (MessageTypeProto as any)[mediaType].create({ + [`${mediaType}Message`]: (MessageTypeProto as any)[mediaType].fromObject({ url: mediaUrl, directPath, fileSha256, @@ -288,8 +288,8 @@ export const prepareWAMessageMedia = async ( } }) - const obj = WAProto.Message.create({ - [`${mediaType}Message`]: MessageTypeProto[mediaType as keyof typeof MessageTypeProto].create({ + const obj = WAProto.Message.fromObject({ + [`${mediaType}Message`]: MessageTypeProto[mediaType as keyof typeof MessageTypeProto].fromObject({ url: mediaUrl, directPath, mediaKey, @@ -327,7 +327,7 @@ export const prepareDisappearingMessageSettingContent = (ephemeralExpiration?: n } } } - return WAProto.Message.create(content) + return WAProto.Message.fromObject(content) } /** @@ -343,7 +343,7 @@ export const generateForwardMessageContent = (message: WAMessage, forceForward?: // hacky copy content = normalizeMessageContent(content) - content = decodeAndHydrate(proto.Message, proto.Message.encode(content!).finish()) + content = proto.Message.decode(proto.Message.encode(content!).finish()) let key = Object.keys(content)[0] as keyof proto.IMessage @@ -691,7 +691,7 @@ export const generateWAMessageFromContent = ( participant: isJidGroup(jid) || isJidStatusBroadcast(jid) ? userJid : undefined, // TODO: Add support for LIDs status: WAMessageStatus.PENDING } - return WAProto.WebMessageInfo.create(messageJSON) + return WAProto.WebMessageInfo.fromObject(messageJSON) as WAMessage } export const generateWAMessage = async (jid: string, content: AnyMessageContent, options: MessageGenerationOptions) => { @@ -894,7 +894,7 @@ export function getAggregateVotesInPollMessage( } /** Given a list of message keys, aggregates them by chat & sender. Useful for sending read receipts in bulk */ -export const aggregateMessageKeysNotFromMe = (keys: proto.IMessageKey[]) => { +export const aggregateMessageKeysNotFromMe = (keys: WAMessageKey[]) => { const keyMap: { [id: string]: { jid: string; participant: string | undefined; messageIds: string[] } } = {} for (const { remoteJid, id, participant, fromMe } of keys) { if (!fromMe) { diff --git a/src/Utils/noise-handler.ts b/src/Utils/noise-handler.ts index 7fd4b3e4..d0f5e1c1 100644 --- a/src/Utils/noise-handler.ts +++ b/src/Utils/noise-handler.ts @@ -6,7 +6,6 @@ import type { BinaryNode } from '../WABinary' import { decodeBinaryNode } from '../WABinary' import { aesDecryptGCM, aesEncryptGCM, Curve, hkdf, sha256 } from './crypto' import type { ILogger } from './logger' -import { decodeAndHydrate } from './proto-utils' const generateIV = (counter: number) => { const iv = new ArrayBuffer(12) @@ -113,7 +112,7 @@ export const makeNoiseHandler = ({ const certDecoded = decrypt(serverHello!.payload!) - const { intermediate: certIntermediate } = decodeAndHydrate(proto.CertChain, certDecoded) + const { intermediate: certIntermediate } = proto.CertChain.decode(certDecoded) const { issuerSerial } = proto.CertChain.NoiseCertificate.Details.decode(certIntermediate!.details!) diff --git a/src/Utils/process-message.ts b/src/Utils/process-message.ts index 3384c24c..a3f16010 100644 --- a/src/Utils/process-message.ts +++ b/src/Utils/process-message.ts @@ -9,7 +9,9 @@ import type { RequestJoinAction, RequestJoinMethod, SignalKeyStoreWithTransaction, - SignalRepositoryWithLIDStore + SignalRepositoryWithLIDStore, + WAMessage, + WAMessageKey } from '../Types' import { WAMessageStubType } from '../Types' import { getContentType, normalizeMessageContent } from '../Utils/messages' @@ -27,7 +29,6 @@ import { aesDecryptGCM, hmacSign } from './crypto' import { toNumber } from './generics' import { downloadAndProcessHistorySyncNotification } from './history' import type { ILogger } from './logger' -import { decodeAndHydrate } from './proto-utils' type ProcessMessageContext = { shouldProcessHistoryMsg: boolean @@ -50,11 +51,11 @@ const REAL_MSG_STUB_TYPES = new Set([ const REAL_MSG_REQ_ME_STUB_TYPES = new Set([WAMessageStubType.GROUP_PARTICIPANT_ADD]) /** Cleans a received message to further processing */ -export const cleanMessage = (message: proto.IWebMessageInfo, meId: string) => { +export const cleanMessage = (message: WAMessage, meId: string) => { // ensure remoteJid and participant doesn't have device or agent in it if (isJidHostedPnUser(message.key.remoteJid!) || isJidHostedLidUser(message.key.remoteJid!)) { message.key.remoteJid = jidEncode( - jidDecode(message.key.remoteJid!)?.user!, + jidDecode(message.key?.remoteJid!)?.user!, isJidHostedPnUser(message.key.remoteJid!) ? 's.whatsapp.net' : 'lid' ) } else { @@ -80,7 +81,7 @@ export const cleanMessage = (message: proto.IWebMessageInfo, meId: string) => { normaliseKey(content.pollUpdateMessage.pollCreationMessageKey!) } - function normaliseKey(msgKey: proto.IMessageKey) { + function normaliseKey(msgKey: WAMessageKey) { // if the reaction is from another user // we've to correctly map the key to this user's perspective if (!message.key.fromMe) { @@ -100,7 +101,7 @@ export const cleanMessage = (message: proto.IWebMessageInfo, meId: string) => { } } -export const isRealMessage = (message: proto.IWebMessageInfo, meId: string) => { +export const isRealMessage = (message: WAMessage, meId: string) => { const normalizedContent = normalizeMessageContent(message.message) const hasSomeContent = !!getContentType(normalizedContent) return ( @@ -115,14 +116,13 @@ export const isRealMessage = (message: proto.IWebMessageInfo, meId: string) => { ) } -export const shouldIncrementChatUnread = (message: proto.IWebMessageInfo) => - !message.key.fromMe && !message.messageStubType +export const shouldIncrementChatUnread = (message: WAMessage) => !message.key.fromMe && !message.messageStubType /** * Get the ID of the chat from the given key. * Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant */ -export const getChatId = ({ remoteJid, participant, fromMe }: proto.IMessageKey) => { +export const getChatId = ({ remoteJid, participant, fromMe }: WAMessageKey) => { if (isJidBroadcast(remoteJid!) && !isJidStatusBroadcast(remoteJid!) && !fromMe) { return participant! } @@ -172,7 +172,7 @@ export function decryptPollVote( } const processMessage = async ( - message: proto.IWebMessageInfo, + message: WAMessage, { shouldProcessHistoryMsg, placeholderResendCache, @@ -297,11 +297,12 @@ const processMessage = async ( const { placeholderMessageResendResponse: retryResponse } = result //eslint-disable-next-line max-depth if (retryResponse) { - const webMessageInfo = decodeAndHydrate(proto.WebMessageInfo, retryResponse.webMessageInfoBytes!) + const webMessageInfo = proto.WebMessageInfo.decode(retryResponse.webMessageInfoBytes!) // wait till another upsert event is available, don't want it to be part of the PDO response message + // TODO: parse through proper message handling utilities (to add relevant key fields) setTimeout(() => { ev.emit('messages.upsert', { - messages: [webMessageInfo], + messages: [webMessageInfo as WAMessage], type: 'notify', requestId: response.stanzaId! }) @@ -331,10 +332,8 @@ const processMessage = async ( break case proto.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC: const encodedPayload = protocolMsg.lidMigrationMappingSyncMessage?.encodedMappingPayload! - const { pnToLidMappings, chatDbMigrationTimestamp } = decodeAndHydrate( - proto.LIDMigrationMappingSyncPayload, - encodedPayload - ) + const { pnToLidMappings, chatDbMigrationTimestamp } = + proto.LIDMigrationMappingSyncPayload.decode(encodedPayload) logger?.debug({ pnToLidMappings, chatDbMigrationTimestamp }, 'got lid mappings and chat db migration timestamp') const pairs = [] for (const { pn, latestLid, assignedLid } of pnToLidMappings) { diff --git a/src/Utils/proto-utils.ts b/src/Utils/proto-utils.ts deleted file mode 100644 index cfe53b04..00000000 --- a/src/Utils/proto-utils.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { BufferJSON } from './generics' - -type ProtoMessageClass = { - new (...args: any[]): T - decode(buffer: Uint8Array | Buffer): T -} - -export function decodeAndHydrate(MessageType: ProtoMessageClass, buffer: Uint8Array | Buffer): T { - const decoded = MessageType.decode(buffer) - const hydrated = JSON.parse(JSON.stringify(decoded, BufferJSON.replacer), BufferJSON.reviver) - return hydrated as T -} diff --git a/src/Utils/use-multi-file-auth-state.ts b/src/Utils/use-multi-file-auth-state.ts index 5db4fe8c..b2377eb2 100644 --- a/src/Utils/use-multi-file-auth-state.ts +++ b/src/Utils/use-multi-file-auth-state.ts @@ -106,7 +106,7 @@ export const useMultiFileAuthState = async ( ids.map(async id => { let value = await readData(`${type}-${id}.json`) if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.create(value) + value = proto.Message.AppStateSyncKeyData.fromObject(value) } data[id] = value diff --git a/src/Utils/validate-connection.ts b/src/Utils/validate-connection.ts index b134b2ba..ea4aacd8 100644 --- a/src/Utils/validate-connection.ts +++ b/src/Utils/validate-connection.ts @@ -11,7 +11,6 @@ import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types' import { type BinaryNode, getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary' import { Curve, hmacSign } from './crypto' import { encodeBigEndian } from './generics' -import { decodeAndHydrate } from './proto-utils' import { createSignalIdentity } from './signal' const getUserAgent = (config: SocketConfig): proto.ClientPayload.IUserAgent => { @@ -68,7 +67,7 @@ export const generateLoginNode = (userJid: string, config: SocketConfig): proto. username: +user, device: device } - return proto.ClientPayload.create(payload) + return proto.ClientPayload.fromObject(payload) } const getPlatformType = (platform: string): proto.DeviceProps.PlatformType => { @@ -113,7 +112,7 @@ export const generateRegistrationNode = ( } } - return proto.ClientPayload.create(registerPayload) + return proto.ClientPayload.fromObject(registerPayload) } export const configureSuccessfulPairing = ( @@ -141,44 +140,41 @@ export const configureSuccessfulPairing = ( const jid = deviceNode.attrs.jid const lid = deviceNode.attrs.lid - const { details, hmac, accountType } = decodeAndHydrate( - proto.ADVSignedDeviceIdentityHMAC, - deviceIdentityNode.content as Buffer - ) + const { details, hmac, accountType } = proto.ADVSignedDeviceIdentityHMAC.decode(deviceIdentityNode.content as Buffer) let hmacPrefix = Buffer.from([]) if (accountType !== undefined && accountType === proto.ADVEncryptionType.HOSTED) { hmacPrefix = WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } - const advSign = hmacSign(Buffer.concat([hmacPrefix, details]), Buffer.from(advSecretKey, 'base64')) - if (Buffer.compare(hmac, advSign) !== 0) { + const advSign = hmacSign(Buffer.concat([hmacPrefix, details!]), Buffer.from(advSecretKey, 'base64')) + if (Buffer.compare(hmac!, advSign) !== 0) { throw new Boom('Invalid account signature') } - const account = decodeAndHydrate(proto.ADVSignedDeviceIdentity, details) + const account = proto.ADVSignedDeviceIdentity.decode(details!) const { accountSignatureKey, accountSignature, details: deviceDetails } = account - const deviceIdentity = decodeAndHydrate(proto.ADVDeviceIdentity, deviceDetails) + const deviceIdentity = proto.ADVDeviceIdentity.decode(deviceDetails!) const accountSignaturePrefix = deviceIdentity.deviceType === proto.ADVEncryptionType.HOSTED ? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX : WA_ADV_ACCOUNT_SIG_PREFIX - const accountMsg = Buffer.concat([accountSignaturePrefix, deviceDetails, signedIdentityKey.public]) - if (!Curve.verify(accountSignatureKey, accountMsg, accountSignature)) { + const accountMsg = Buffer.concat([accountSignaturePrefix, deviceDetails!, signedIdentityKey.public]) + if (!Curve.verify(accountSignatureKey!, accountMsg, accountSignature!)) { throw new Boom('Failed to verify account signature') } const deviceMsg = Buffer.concat([ WA_ADV_DEVICE_SIG_PREFIX, - deviceDetails, + deviceDetails!, signedIdentityKey.public, - accountSignatureKey + accountSignatureKey! ]) account.deviceSignature = Curve.sign(signedIdentityKey.private, deviceMsg) - const identity = createSignalIdentity(lid!, accountSignatureKey) + const identity = createSignalIdentity(lid!, accountSignatureKey!) const accountEnc = encodeSignedDeviceIdentity(account, false) const reply: BinaryNode = { @@ -195,7 +191,7 @@ export const configureSuccessfulPairing = ( content: [ { tag: 'device-identity', - attrs: { 'key-index': deviceIdentity.keyIndex.toString() }, + attrs: { 'key-index': deviceIdentity.keyIndex!.toString() }, content: accountEnc } ] diff --git a/src/WABinary/generic-utils.ts b/src/WABinary/generic-utils.ts index 780debf8..0085f661 100644 --- a/src/WABinary/generic-utils.ts +++ b/src/WABinary/generic-utils.ts @@ -1,6 +1,5 @@ import { Boom } from '@hapi/boom' import { proto } from '../../WAProto/index.js' -import { decodeAndHydrate } from '../Utils/proto-utils' import { type BinaryNode } from './types' // some extra useful utilities @@ -79,7 +78,7 @@ export const getBinaryNodeMessages = ({ content }: BinaryNode) => { if (Array.isArray(content)) { for (const item of content) { if (item.tag === 'message') { - msgs.push(decodeAndHydrate(proto.WebMessageInfo, item.content as Buffer)) + msgs.push(proto.WebMessageInfo.decode(item.content as Buffer).toJSON() as proto.WebMessageInfo) } } } diff --git a/src/__tests__/binary/connection-deadlock.test.ts b/src/__tests__/binary/connection-deadlock.test.ts index 0c6bc6bd..9cd82614 100644 --- a/src/__tests__/binary/connection-deadlock.test.ts +++ b/src/__tests__/binary/connection-deadlock.test.ts @@ -1,5 +1,5 @@ import { jest } from '@jest/globals' -import { proto } from '../..' +import { proto, type WAMessage } from '../..' import { DEFAULT_CONNECTION_CONFIG } from '../../Defaults' import makeWASocket from '../../Socket' import { makeSession, mockWebSocket } from '../TestUtils/session' @@ -26,11 +26,11 @@ describe('Connection Deadlock Test', () => { // 2. Now, emit a regular message. Because the previous step should have // flushed the buffer, this message should be processed immediately. - const regularMessage = proto.WebMessageInfo.create({ + const regularMessage = proto.WebMessageInfo.fromObject({ key: { remoteJid: '1234567890@s.whatsapp.net', fromMe: false, id: 'REGULAR_MSG_1' }, messageTimestamp: Date.now() / 1000, message: { conversation: 'Hello, world!' } - }) + }) as WAMessage sock.ev.emit('messages.upsert', { messages: [regularMessage], type: 'notify' }) // Wait for the event loop to process any final events. await new Promise(resolve => setTimeout(resolve, 50))