diff --git a/example/src/main/java/org/xmtp/android/example/MainViewModel.kt b/example/src/main/java/org/xmtp/android/example/MainViewModel.kt index e5e6dd66..4a62ef9c 100644 --- a/example/src/main/java/org/xmtp/android/example/MainViewModel.kt +++ b/example/src/main/java/org/xmtp/android/example/MainViewModel.kt @@ -21,6 +21,7 @@ import org.xmtp.android.example.extension.stateFlow import org.xmtp.android.example.pushnotifications.PushNotificationTokenManager import org.xmtp.android.library.Conversation import org.xmtp.android.library.DecodedMessage +import org.xmtp.android.library.push.Service class MainViewModel : ViewModel() { @@ -44,7 +45,24 @@ class MainViewModel : ViewModel() { val listItems = mutableListOf() try { val conversations = ClientManager.client.conversations.list(includeGroups = true) - PushNotificationTokenManager.xmtpPush.subscribe(conversations.map { it.topic }) + val subscriptions = conversations.map { + val hmacKeysResult = ClientManager.client.conversations.getHmacKeys() + val hmacKeys = hmacKeysResult.hmacKeysMap + val result = hmacKeys[it.topic]?.valuesList?.map { hmacKey -> + Service.Subscription.HmacKey.newBuilder().also { sub_key -> + sub_key.key = hmacKey.hmacKey + sub_key.thirtyDayPeriodsSinceEpoch = hmacKey.thirtyDayPeriodsSinceEpoch + }.build() + } + + Service.Subscription.newBuilder().also { sub -> + sub.addAllHmacKeys(result) + sub.topic = it.topic + sub.isSilent = it.version == Conversation.Version.V1 + }.build() + } + + PushNotificationTokenManager.xmtpPush.subscribeWithMetadata(subscriptions) listItems.addAll( conversations.map { conversation -> val lastMessage = fetchMostRecentMessage(conversation) diff --git a/library/src/main/java/org/xmtp/android/library/push/NotificationsGrpc.java b/library/src/main/java/org/xmtp/android/library/push/NotificationsGrpc.java index b3187404..1600bd51 100644 --- a/library/src/main/java/org/xmtp/android/library/push/NotificationsGrpc.java +++ b/library/src/main/java/org/xmtp/android/library/push/NotificationsGrpc.java @@ -3,16 +3,14 @@ import static io.grpc.MethodDescriptor.generateFullMethodName; /** - * */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.45.1)", - comments = "Source: service.proto") + comments = "Source: notifications/v1/service.proto") @io.grpc.stub.annotations.GrpcGenerated public final class NotificationsGrpc { - private NotificationsGrpc() { - } + private NotificationsGrpc() {} public static final String SERVICE_NAME = "notifications.v1.Notifications"; @@ -107,6 +105,36 @@ com.google.protobuf.Empty> getSubscribeMethod() { return getSubscribeMethod; } + private static volatile io.grpc.MethodDescriptor getSubscribeWithMetadataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SubscribeWithMetadata", + requestType = org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSubscribeWithMetadataMethod() { + io.grpc.MethodDescriptor getSubscribeWithMetadataMethod; + if ((getSubscribeWithMetadataMethod = NotificationsGrpc.getSubscribeWithMetadataMethod) == null) { + synchronized (NotificationsGrpc.class) { + if ((getSubscribeWithMetadataMethod = NotificationsGrpc.getSubscribeWithMetadataMethod) == null) { + NotificationsGrpc.getSubscribeWithMetadataMethod = getSubscribeWithMetadataMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SubscribeWithMetadata")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .build(); + } + } + } + return getSubscribeWithMetadataMethod; + } + private static volatile io.grpc.MethodDescriptor getUnsubscribeMethod; @@ -182,12 +210,10 @@ public NotificationsFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpti } /** - * */ public static abstract class NotificationsImplBase implements io.grpc.BindableService { /** - * */ public void registerInstallation(org.xmtp.android.library.push.Service.RegisterInstallationRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -195,7 +221,6 @@ public void registerInstallation(org.xmtp.android.library.push.Service.RegisterI } /** - * */ public void deleteInstallation(org.xmtp.android.library.push.Service.DeleteInstallationRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -203,7 +228,6 @@ public void deleteInstallation(org.xmtp.android.library.push.Service.DeleteInsta } /** - * */ public void subscribe(org.xmtp.android.library.push.Service.SubscribeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -211,15 +235,20 @@ public void subscribe(org.xmtp.android.library.push.Service.SubscribeRequest req } /** - * + */ + public void subscribeWithMetadata(org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubscribeWithMetadataMethod(), responseObserver); + } + + /** */ public void unsubscribe(org.xmtp.android.library.push.Service.UnsubscribeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnsubscribeMethod(), responseObserver); } - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getRegisterInstallationMethod(), @@ -242,6 +271,13 @@ public final io.grpc.ServerServiceDefinition bindService() { org.xmtp.android.library.push.Service.SubscribeRequest, com.google.protobuf.Empty>( this, METHODID_SUBSCRIBE))) + .addMethod( + getSubscribeWithMetadataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest, + com.google.protobuf.Empty>( + this, METHODID_SUBSCRIBE_WITH_METADATA))) .addMethod( getUnsubscribeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -254,7 +290,6 @@ public final io.grpc.ServerServiceDefinition bindService() { } /** - * */ public static final class NotificationsStub extends io.grpc.stub.AbstractAsyncStub { private NotificationsStub( @@ -269,7 +304,6 @@ protected NotificationsStub build( } /** - * */ public void registerInstallation(org.xmtp.android.library.push.Service.RegisterInstallationRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -278,7 +312,6 @@ public void registerInstallation(org.xmtp.android.library.push.Service.RegisterI } /** - * */ public void deleteInstallation(org.xmtp.android.library.push.Service.DeleteInstallationRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -287,7 +320,6 @@ public void deleteInstallation(org.xmtp.android.library.push.Service.DeleteInsta } /** - * */ public void subscribe(org.xmtp.android.library.push.Service.SubscribeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -296,7 +328,14 @@ public void subscribe(org.xmtp.android.library.push.Service.SubscribeRequest req } /** - * + */ + public void subscribeWithMetadata(org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSubscribeWithMetadataMethod(), getCallOptions()), request, responseObserver); + } + + /** */ public void unsubscribe(org.xmtp.android.library.push.Service.UnsubscribeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -306,7 +345,6 @@ public void unsubscribe(org.xmtp.android.library.push.Service.UnsubscribeRequest } /** - * */ public static final class NotificationsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private NotificationsBlockingStub( @@ -321,7 +359,6 @@ protected NotificationsBlockingStub build( } /** - * */ public org.xmtp.android.library.push.Service.RegisterInstallationResponse registerInstallation(org.xmtp.android.library.push.Service.RegisterInstallationRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -329,7 +366,6 @@ public org.xmtp.android.library.push.Service.RegisterInstallationResponse regist } /** - * */ public com.google.protobuf.Empty deleteInstallation(org.xmtp.android.library.push.Service.DeleteInstallationRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -337,7 +373,6 @@ public com.google.protobuf.Empty deleteInstallation(org.xmtp.android.library.pus } /** - * */ public com.google.protobuf.Empty subscribe(org.xmtp.android.library.push.Service.SubscribeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -345,7 +380,13 @@ public com.google.protobuf.Empty subscribe(org.xmtp.android.library.push.Service } /** - * + */ + public com.google.protobuf.Empty subscribeWithMetadata(org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSubscribeWithMetadataMethod(), getCallOptions(), request); + } + + /** */ public com.google.protobuf.Empty unsubscribe(org.xmtp.android.library.push.Service.UnsubscribeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -354,7 +395,6 @@ public com.google.protobuf.Empty unsubscribe(org.xmtp.android.library.push.Servi } /** - * */ public static final class NotificationsFutureStub extends io.grpc.stub.AbstractFutureStub { private NotificationsFutureStub( @@ -369,7 +409,6 @@ protected NotificationsFutureStub build( } /** - * */ public com.google.common.util.concurrent.ListenableFuture registerInstallation( org.xmtp.android.library.push.Service.RegisterInstallationRequest request) { @@ -378,7 +417,6 @@ public com.google.common.util.concurrent.ListenableFuture deleteInstallation( org.xmtp.android.library.push.Service.DeleteInstallationRequest request) { @@ -387,7 +425,6 @@ public com.google.common.util.concurrent.ListenableFuture subscribe( org.xmtp.android.library.push.Service.SubscribeRequest request) { @@ -396,7 +433,14 @@ public com.google.common.util.concurrent.ListenableFuture subscribeWithMetadata( + org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSubscribeWithMetadataMethod(), getCallOptions()), request); + } + + /** */ public com.google.common.util.concurrent.ListenableFuture unsubscribe( org.xmtp.android.library.push.Service.UnsubscribeRequest request) { @@ -408,7 +452,8 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -439,6 +484,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.subscribe((org.xmtp.android.library.push.Service.SubscribeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_SUBSCRIBE_WITH_METADATA: + serviceImpl.subscribeWithMetadata((org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_UNSUBSCRIBE: serviceImpl.unsubscribe((org.xmtp.android.library.push.Service.UnsubscribeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -471,6 +520,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getRegisterInstallationMethod()) .addMethod(getDeleteInstallationMethod()) .addMethod(getSubscribeMethod()) + .addMethod(getSubscribeWithMetadataMethod()) .addMethod(getUnsubscribeMethod()) .build(); } diff --git a/library/src/main/java/org/xmtp/android/library/push/Service.java b/library/src/main/java/org/xmtp/android/library/push/Service.java index 21324db8..cec88108 100644 --- a/library/src/main/java/org/xmtp/android/library/push/Service.java +++ b/library/src/main/java/org/xmtp/android/library/push/Service.java @@ -1,37 +1,29 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: service.proto +// source: notifications/v1/service.proto package org.xmtp.android.library.push; public final class Service { - private Service() { - } - + private Service() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } - public interface DeliveryMechanismOrBuilder extends // @@protoc_insertion_point(interface_extends:notifications.v1.DeliveryMechanism) com.google.protobuf.MessageLiteOrBuilder { /** * string apns_device_token = 1; - * * @return Whether the apnsDeviceToken field is set. */ boolean hasApnsDeviceToken(); - /** * string apns_device_token = 1; - * * @return The apnsDeviceToken. */ java.lang.String getApnsDeviceToken(); - /** * string apns_device_token = 1; - * * @return The bytes for apnsDeviceToken. */ com.google.protobuf.ByteString @@ -39,53 +31,65 @@ public interface DeliveryMechanismOrBuilder extends /** * string firebase_device_token = 2; - * * @return Whether the firebaseDeviceToken field is set. */ boolean hasFirebaseDeviceToken(); - /** * string firebase_device_token = 2; - * * @return The firebaseDeviceToken. */ java.lang.String getFirebaseDeviceToken(); - /** * string firebase_device_token = 2; - * * @return The bytes for firebaseDeviceToken. */ com.google.protobuf.ByteString getFirebaseDeviceTokenBytes(); + /** + * string custom_token = 3; + * @return Whether the customToken field is set. + */ + boolean hasCustomToken(); + /** + * string custom_token = 3; + * @return The customToken. + */ + java.lang.String getCustomToken(); + /** + * string custom_token = 3; + * @return The bytes for customToken. + */ + com.google.protobuf.ByteString + getCustomTokenBytes(); + public org.xmtp.android.library.push.Service.DeliveryMechanism.DeliveryMechanismTypeCase getDeliveryMechanismTypeCase(); } - /** + *
+     * An union of possible delibery mechanisms
+     * 
+ * * Protobuf type {@code notifications.v1.DeliveryMechanism} */ - public static final class DeliveryMechanism extends + public static final class DeliveryMechanism extends com.google.protobuf.GeneratedMessageLite< DeliveryMechanism, DeliveryMechanism.Builder> implements // @@protoc_insertion_point(message_implements:notifications.v1.DeliveryMechanism) DeliveryMechanismOrBuilder { private DeliveryMechanism() { } - private int deliveryMechanismTypeCase_ = 0; private java.lang.Object deliveryMechanismType_; - public enum DeliveryMechanismTypeCase { APNS_DEVICE_TOKEN(1), FIREBASE_DEVICE_TOKEN(2), + CUSTOM_TOKEN(3), DELIVERYMECHANISMTYPE_NOT_SET(0); private final int value; - private DeliveryMechanismTypeCase(int value) { this.value = value; } - /** * @deprecated Use {@link #forNumber(int)} instead. */ @@ -96,23 +100,17 @@ public static DeliveryMechanismTypeCase valueOf(int value) { public static DeliveryMechanismTypeCase forNumber(int value) { switch (value) { - case 1: - return APNS_DEVICE_TOKEN; - case 2: - return FIREBASE_DEVICE_TOKEN; - case 0: - return DELIVERYMECHANISMTYPE_NOT_SET; - default: - return null; + case 1: return APNS_DEVICE_TOKEN; + case 2: return FIREBASE_DEVICE_TOKEN; + case 3: return CUSTOM_TOKEN; + case 0: return DELIVERYMECHANISMTYPE_NOT_SET; + default: return null; } } - public int getNumber() { return this.value; } - } - - ; + }; @java.lang.Override public DeliveryMechanismTypeCase @@ -127,20 +125,16 @@ private void clearDeliveryMechanismType() { } public static final int APNS_DEVICE_TOKEN_FIELD_NUMBER = 1; - /** * string apns_device_token = 1; - * * @return Whether the apnsDeviceToken field is set. */ @java.lang.Override public boolean hasApnsDeviceToken() { return deliveryMechanismTypeCase_ == 1; } - /** * string apns_device_token = 1; - * * @return The apnsDeviceToken. */ @java.lang.Override @@ -151,10 +145,8 @@ public java.lang.String getApnsDeviceToken() { } return ref; } - /** * string apns_device_token = 1; - * * @return The bytes for apnsDeviceToken. */ @java.lang.Override @@ -166,10 +158,8 @@ public java.lang.String getApnsDeviceToken() { } return com.google.protobuf.ByteString.copyFromUtf8(ref); } - /** * string apns_device_token = 1; - * * @param value The apnsDeviceToken to set. */ private void setApnsDeviceToken( @@ -178,7 +168,6 @@ private void setApnsDeviceToken( deliveryMechanismTypeCase_ = 1; deliveryMechanismType_ = value; } - /** * string apns_device_token = 1; */ @@ -188,10 +177,8 @@ private void clearApnsDeviceToken() { deliveryMechanismType_ = null; } } - /** * string apns_device_token = 1; - * * @param value The bytes for apnsDeviceToken to set. */ private void setApnsDeviceTokenBytes( @@ -202,20 +189,16 @@ private void setApnsDeviceTokenBytes( } public static final int FIREBASE_DEVICE_TOKEN_FIELD_NUMBER = 2; - /** * string firebase_device_token = 2; - * * @return Whether the firebaseDeviceToken field is set. */ @java.lang.Override public boolean hasFirebaseDeviceToken() { return deliveryMechanismTypeCase_ == 2; } - /** * string firebase_device_token = 2; - * * @return The firebaseDeviceToken. */ @java.lang.Override @@ -226,10 +209,8 @@ public java.lang.String getFirebaseDeviceToken() { } return ref; } - /** * string firebase_device_token = 2; - * * @return The bytes for firebaseDeviceToken. */ @java.lang.Override @@ -241,10 +222,8 @@ public java.lang.String getFirebaseDeviceToken() { } return com.google.protobuf.ByteString.copyFromUtf8(ref); } - /** * string firebase_device_token = 2; - * * @param value The firebaseDeviceToken to set. */ private void setFirebaseDeviceToken( @@ -253,7 +232,6 @@ private void setFirebaseDeviceToken( deliveryMechanismTypeCase_ = 2; deliveryMechanismType_ = value; } - /** * string firebase_device_token = 2; */ @@ -263,10 +241,8 @@ private void clearFirebaseDeviceToken() { deliveryMechanismType_ = null; } } - /** * string firebase_device_token = 2; - * * @param value The bytes for firebaseDeviceToken to set. */ private void setFirebaseDeviceTokenBytes( @@ -276,13 +252,76 @@ private void setFirebaseDeviceTokenBytes( deliveryMechanismTypeCase_ = 2; } + public static final int CUSTOM_TOKEN_FIELD_NUMBER = 3; + /** + * string custom_token = 3; + * @return Whether the customToken field is set. + */ + @java.lang.Override + public boolean hasCustomToken() { + return deliveryMechanismTypeCase_ == 3; + } + /** + * string custom_token = 3; + * @return The customToken. + */ + @java.lang.Override + public java.lang.String getCustomToken() { + java.lang.String ref = ""; + if (deliveryMechanismTypeCase_ == 3) { + ref = (java.lang.String) deliveryMechanismType_; + } + return ref; + } + /** + * string custom_token = 3; + * @return The bytes for customToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCustomTokenBytes() { + java.lang.String ref = ""; + if (deliveryMechanismTypeCase_ == 3) { + ref = (java.lang.String) deliveryMechanismType_; + } + return com.google.protobuf.ByteString.copyFromUtf8(ref); + } + /** + * string custom_token = 3; + * @param value The customToken to set. + */ + private void setCustomToken( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + deliveryMechanismTypeCase_ = 3; + deliveryMechanismType_ = value; + } + /** + * string custom_token = 3; + */ + private void clearCustomToken() { + if (deliveryMechanismTypeCase_ == 3) { + deliveryMechanismTypeCase_ = 0; + deliveryMechanismType_ = null; + } + } + /** + * string custom_token = 3; + * @param value The bytes for customToken to set. + */ + private void setCustomTokenBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deliveryMechanismType_ = value.toStringUtf8(); + deliveryMechanismTypeCase_ = 3; + } + public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -290,14 +329,12 @@ public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -305,13 +342,11 @@ public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -319,13 +354,11 @@ public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -333,26 +366,22 @@ public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -364,12 +393,15 @@ public static org.xmtp.android.library.push.Service.DeliveryMechanism parseFrom( public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(org.xmtp.android.library.push.Service.DeliveryMechanism prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** + *
+         * An union of possible delibery mechanisms
+         * 
+ * * Protobuf type {@code notifications.v1.DeliveryMechanism} */ public static final class Builder extends @@ -397,27 +429,22 @@ public Builder clearDeliveryMechanismType() { /** * string apns_device_token = 1; - * * @return Whether the apnsDeviceToken field is set. */ @java.lang.Override public boolean hasApnsDeviceToken() { return instance.hasApnsDeviceToken(); } - /** * string apns_device_token = 1; - * * @return The apnsDeviceToken. */ @java.lang.Override public java.lang.String getApnsDeviceToken() { return instance.getApnsDeviceToken(); } - /** * string apns_device_token = 1; - * * @return The bytes for apnsDeviceToken. */ @java.lang.Override @@ -425,10 +452,8 @@ public java.lang.String getApnsDeviceToken() { getApnsDeviceTokenBytes() { return instance.getApnsDeviceTokenBytes(); } - /** * string apns_device_token = 1; - * * @param value The apnsDeviceToken to set. * @return This builder for chaining. */ @@ -438,10 +463,8 @@ public Builder setApnsDeviceToken( instance.setApnsDeviceToken(value); return this; } - /** * string apns_device_token = 1; - * * @return This builder for chaining. */ public Builder clearApnsDeviceToken() { @@ -449,10 +472,8 @@ public Builder clearApnsDeviceToken() { instance.clearApnsDeviceToken(); return this; } - /** * string apns_device_token = 1; - * * @param value The bytes for apnsDeviceToken to set. * @return This builder for chaining. */ @@ -465,27 +486,22 @@ public Builder setApnsDeviceTokenBytes( /** * string firebase_device_token = 2; - * * @return Whether the firebaseDeviceToken field is set. */ @java.lang.Override public boolean hasFirebaseDeviceToken() { return instance.hasFirebaseDeviceToken(); } - /** * string firebase_device_token = 2; - * * @return The firebaseDeviceToken. */ @java.lang.Override public java.lang.String getFirebaseDeviceToken() { return instance.getFirebaseDeviceToken(); } - /** * string firebase_device_token = 2; - * * @return The bytes for firebaseDeviceToken. */ @java.lang.Override @@ -493,10 +509,8 @@ public java.lang.String getFirebaseDeviceToken() { getFirebaseDeviceTokenBytes() { return instance.getFirebaseDeviceTokenBytes(); } - /** * string firebase_device_token = 2; - * * @param value The firebaseDeviceToken to set. * @return This builder for chaining. */ @@ -506,10 +520,8 @@ public Builder setFirebaseDeviceToken( instance.setFirebaseDeviceToken(value); return this; } - /** * string firebase_device_token = 2; - * * @return This builder for chaining. */ public Builder clearFirebaseDeviceToken() { @@ -517,10 +529,8 @@ public Builder clearFirebaseDeviceToken() { instance.clearFirebaseDeviceToken(); return this; } - /** * string firebase_device_token = 2; - * * @param value The bytes for firebaseDeviceToken to set. * @return This builder for chaining. */ @@ -531,9 +541,65 @@ public Builder setFirebaseDeviceTokenBytes( return this; } + /** + * string custom_token = 3; + * @return Whether the customToken field is set. + */ + @java.lang.Override + public boolean hasCustomToken() { + return instance.hasCustomToken(); + } + /** + * string custom_token = 3; + * @return The customToken. + */ + @java.lang.Override + public java.lang.String getCustomToken() { + return instance.getCustomToken(); + } + /** + * string custom_token = 3; + * @return The bytes for customToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCustomTokenBytes() { + return instance.getCustomTokenBytes(); + } + /** + * string custom_token = 3; + * @param value The customToken to set. + * @return This builder for chaining. + */ + public Builder setCustomToken( + java.lang.String value) { + copyOnWrite(); + instance.setCustomToken(value); + return this; + } + /** + * string custom_token = 3; + * @return This builder for chaining. + */ + public Builder clearCustomToken() { + copyOnWrite(); + instance.clearCustomToken(); + return this; + } + /** + * string custom_token = 3; + * @param value The bytes for customToken to set. + * @return This builder for chaining. + */ + public Builder setCustomTokenBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setCustomTokenBytes(value); + return this; + } + // @@protoc_insertion_point(builder_scope:notifications.v1.DeliveryMechanism) } - @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) protected final java.lang.Object dynamicMethod( @@ -547,13 +613,13 @@ protected final java.lang.Object dynamicMethod( return new Builder(); } case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[]{ + java.lang.Object[] objects = new java.lang.Object[] { "deliveryMechanismType_", "deliveryMechanismTypeCase_", }; java.lang.String info = - "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u023b\u0000\u0002" + - "\u023b\u0000"; + "\u0000\u0003\u0001\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u023b\u0000\u0002" + + "\u023b\u0000\u0003\u023b\u0000"; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -588,7 +654,6 @@ protected final java.lang.Object dynamicMethod( // @@protoc_insertion_point(class_scope:notifications.v1.DeliveryMechanism) private static final org.xmtp.android.library.push.Service.DeliveryMechanism DEFAULT_INSTANCE; - static { DeliveryMechanism defaultInstance = new DeliveryMechanism(); // New instances are implicitly immutable so no need to make @@ -615,14 +680,11 @@ public interface RegisterInstallationRequestOrBuilder extends /** * string installation_id = 1; - * * @return The installationId. */ java.lang.String getInstallationId(); - /** * string installation_id = 1; - * * @return The bytes for installationId. */ com.google.protobuf.ByteString @@ -630,23 +692,23 @@ public interface RegisterInstallationRequestOrBuilder extends /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; - * * @return Whether the deliveryMechanism field is set. */ boolean hasDeliveryMechanism(); - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; - * * @return The deliveryMechanism. */ org.xmtp.android.library.push.Service.DeliveryMechanism getDeliveryMechanism(); } - /** + *
+     * A request to register an installation with the service
+     * 
+ * * Protobuf type {@code notifications.v1.RegisterInstallationRequest} */ - public static final class RegisterInstallationRequest extends + public static final class RegisterInstallationRequest extends com.google.protobuf.GeneratedMessageLite< RegisterInstallationRequest, RegisterInstallationRequest.Builder> implements // @@protoc_insertion_point(message_implements:notifications.v1.RegisterInstallationRequest) @@ -654,23 +716,18 @@ public static final class RegisterInstallationRequest extends private RegisterInstallationRequest() { installationId_ = ""; } - public static final int INSTALLATION_ID_FIELD_NUMBER = 1; private java.lang.String installationId_; - /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return installationId_; } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -678,10 +735,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return com.google.protobuf.ByteString.copyFromUtf8(installationId_); } - /** * string installation_id = 1; - * * @param value The installationId to set. */ private void setInstallationId( @@ -690,7 +745,6 @@ private void setInstallationId( installationId_ = value; } - /** * string installation_id = 1; */ @@ -698,10 +752,8 @@ private void clearInstallationId() { installationId_ = getDefaultInstance().getInstallationId(); } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. */ private void setInstallationIdBytes( @@ -713,7 +765,6 @@ private void setInstallationIdBytes( public static final int DELIVERY_MECHANISM_FIELD_NUMBER = 2; private org.xmtp.android.library.push.Service.DeliveryMechanism deliveryMechanism_; - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -721,7 +772,6 @@ private void setInstallationIdBytes( public boolean hasDeliveryMechanism() { return deliveryMechanism_ != null; } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -729,7 +779,6 @@ public boolean hasDeliveryMechanism() { public org.xmtp.android.library.push.Service.DeliveryMechanism getDeliveryMechanism() { return deliveryMechanism_ == null ? org.xmtp.android.library.push.Service.DeliveryMechanism.getDefaultInstance() : deliveryMechanism_; } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -738,7 +787,6 @@ private void setDeliveryMechanism(org.xmtp.android.library.push.Service.Delivery deliveryMechanism_ = value; } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -754,12 +802,10 @@ private void mergeDeliveryMechanism(org.xmtp.android.library.push.Service.Delive } } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ - private void clearDeliveryMechanism() { - deliveryMechanism_ = null; + private void clearDeliveryMechanism() { deliveryMechanism_ = null; } @@ -769,7 +815,6 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationRequest return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -777,14 +822,12 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationRequest return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -792,13 +835,11 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationRequest return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -806,13 +847,11 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationRequest return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -820,26 +859,22 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationRequest return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.RegisterInstallationRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -851,12 +886,15 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationRequest public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(org.xmtp.android.library.push.Service.RegisterInstallationRequest prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** + *
+         * A request to register an installation with the service
+         * 
+ * * Protobuf type {@code notifications.v1.RegisterInstallationRequest} */ public static final class Builder extends @@ -872,17 +910,14 @@ private Builder() { /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return instance.getInstallationId(); } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -890,10 +925,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return instance.getInstallationIdBytes(); } - /** * string installation_id = 1; - * * @param value The installationId to set. * @return This builder for chaining. */ @@ -903,10 +936,8 @@ public Builder setInstallationId( instance.setInstallationId(value); return this; } - /** * string installation_id = 1; - * * @return This builder for chaining. */ public Builder clearInstallationId() { @@ -914,10 +945,8 @@ public Builder clearInstallationId() { instance.clearInstallationId(); return this; } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. * @return This builder for chaining. */ @@ -935,7 +964,6 @@ public Builder setInstallationIdBytes( public boolean hasDeliveryMechanism() { return instance.hasDeliveryMechanism(); } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -943,7 +971,6 @@ public boolean hasDeliveryMechanism() { public org.xmtp.android.library.push.Service.DeliveryMechanism getDeliveryMechanism() { return instance.getDeliveryMechanism(); } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -952,7 +979,6 @@ public Builder setDeliveryMechanism(org.xmtp.android.library.push.Service.Delive instance.setDeliveryMechanism(value); return this; } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -962,7 +988,6 @@ public Builder setDeliveryMechanism( instance.setDeliveryMechanism(builderForValue.build()); return this; } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ @@ -971,19 +996,16 @@ public Builder mergeDeliveryMechanism(org.xmtp.android.library.push.Service.Deli instance.mergeDeliveryMechanism(value); return this; } - /** * .notifications.v1.DeliveryMechanism delivery_mechanism = 2; */ - public Builder clearDeliveryMechanism() { - copyOnWrite(); + public Builder clearDeliveryMechanism() { copyOnWrite(); instance.clearDeliveryMechanism(); return this; } // @@protoc_insertion_point(builder_scope:notifications.v1.RegisterInstallationRequest) } - @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) protected final java.lang.Object dynamicMethod( @@ -997,7 +1019,7 @@ protected final java.lang.Object dynamicMethod( return new Builder(); } case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[]{ + java.lang.Object[] objects = new java.lang.Object[] { "installationId_", "deliveryMechanism_", }; @@ -1038,7 +1060,6 @@ protected final java.lang.Object dynamicMethod( // @@protoc_insertion_point(class_scope:notifications.v1.RegisterInstallationRequest) private static final org.xmtp.android.library.push.Service.RegisterInstallationRequest DEFAULT_INSTANCE; - static { RegisterInstallationRequest defaultInstance = new RegisterInstallationRequest(); // New instances are implicitly immutable so no need to make @@ -1065,14 +1086,11 @@ public interface RegisterInstallationResponseOrBuilder extends /** * string installation_id = 1; - * * @return The installationId. */ java.lang.String getInstallationId(); - /** * string installation_id = 1; - * * @return The bytes for installationId. */ com.google.protobuf.ByteString @@ -1080,16 +1098,18 @@ public interface RegisterInstallationResponseOrBuilder extends /** * uint64 valid_until = 2; - * * @return The validUntil. */ long getValidUntil(); } - /** + *
+     * Response to RegisterInstallationRequest
+     * 
+ * * Protobuf type {@code notifications.v1.RegisterInstallationResponse} */ - public static final class RegisterInstallationResponse extends + public static final class RegisterInstallationResponse extends com.google.protobuf.GeneratedMessageLite< RegisterInstallationResponse, RegisterInstallationResponse.Builder> implements // @@protoc_insertion_point(message_implements:notifications.v1.RegisterInstallationResponse) @@ -1097,23 +1117,18 @@ public static final class RegisterInstallationResponse extends private RegisterInstallationResponse() { installationId_ = ""; } - public static final int INSTALLATION_ID_FIELD_NUMBER = 1; private java.lang.String installationId_; - /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return installationId_; } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -1121,10 +1136,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return com.google.protobuf.ByteString.copyFromUtf8(installationId_); } - /** * string installation_id = 1; - * * @param value The installationId to set. */ private void setInstallationId( @@ -1133,7 +1146,6 @@ private void setInstallationId( installationId_ = value; } - /** * string installation_id = 1; */ @@ -1141,10 +1153,8 @@ private void clearInstallationId() { installationId_ = getDefaultInstance().getInstallationId(); } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. */ private void setInstallationIdBytes( @@ -1156,27 +1166,22 @@ private void setInstallationIdBytes( public static final int VALID_UNTIL_FIELD_NUMBER = 2; private long validUntil_; - /** * uint64 valid_until = 2; - * * @return The validUntil. */ @java.lang.Override public long getValidUntil() { return validUntil_; } - /** * uint64 valid_until = 2; - * * @param value The validUntil to set. */ private void setValidUntil(long value) { validUntil_ = value; } - /** * uint64 valid_until = 2; */ @@ -1191,7 +1196,6 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationResponse return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1199,14 +1203,12 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationResponse return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1214,13 +1216,11 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationResponse return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1228,13 +1228,11 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationResponse return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1242,26 +1240,22 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationResponse return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.RegisterInstallationResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1273,12 +1267,15 @@ public static org.xmtp.android.library.push.Service.RegisterInstallationResponse public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(org.xmtp.android.library.push.Service.RegisterInstallationResponse prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** + *
+         * Response to RegisterInstallationRequest
+         * 
+ * * Protobuf type {@code notifications.v1.RegisterInstallationResponse} */ public static final class Builder extends @@ -1294,17 +1291,14 @@ private Builder() { /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return instance.getInstallationId(); } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -1312,10 +1306,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return instance.getInstallationIdBytes(); } - /** * string installation_id = 1; - * * @param value The installationId to set. * @return This builder for chaining. */ @@ -1325,10 +1317,8 @@ public Builder setInstallationId( instance.setInstallationId(value); return this; } - /** * string installation_id = 1; - * * @return This builder for chaining. */ public Builder clearInstallationId() { @@ -1336,10 +1326,8 @@ public Builder clearInstallationId() { instance.clearInstallationId(); return this; } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. * @return This builder for chaining. */ @@ -1352,17 +1340,14 @@ public Builder setInstallationIdBytes( /** * uint64 valid_until = 2; - * * @return The validUntil. */ @java.lang.Override public long getValidUntil() { return instance.getValidUntil(); } - /** * uint64 valid_until = 2; - * * @param value The validUntil to set. * @return This builder for chaining. */ @@ -1371,10 +1356,8 @@ public Builder setValidUntil(long value) { instance.setValidUntil(value); return this; } - /** * uint64 valid_until = 2; - * * @return This builder for chaining. */ public Builder clearValidUntil() { @@ -1385,7 +1368,6 @@ public Builder clearValidUntil() { // @@protoc_insertion_point(builder_scope:notifications.v1.RegisterInstallationResponse) } - @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) protected final java.lang.Object dynamicMethod( @@ -1399,7 +1381,7 @@ protected final java.lang.Object dynamicMethod( return new Builder(); } case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[]{ + java.lang.Object[] objects = new java.lang.Object[] { "installationId_", "validUntil_", }; @@ -1440,7 +1422,6 @@ protected final java.lang.Object dynamicMethod( // @@protoc_insertion_point(class_scope:notifications.v1.RegisterInstallationResponse) private static final org.xmtp.android.library.push.Service.RegisterInstallationResponse DEFAULT_INSTANCE; - static { RegisterInstallationResponse defaultInstance = new RegisterInstallationResponse(); // New instances are implicitly immutable so no need to make @@ -1467,24 +1448,24 @@ public interface DeleteInstallationRequestOrBuilder extends /** * string installation_id = 1; - * * @return The installationId. */ java.lang.String getInstallationId(); - /** * string installation_id = 1; - * * @return The bytes for installationId. */ com.google.protobuf.ByteString getInstallationIdBytes(); } - /** + *
+     * Delete an installation from the service
+     * 
+ * * Protobuf type {@code notifications.v1.DeleteInstallationRequest} */ - public static final class DeleteInstallationRequest extends + public static final class DeleteInstallationRequest extends com.google.protobuf.GeneratedMessageLite< DeleteInstallationRequest, DeleteInstallationRequest.Builder> implements // @@protoc_insertion_point(message_implements:notifications.v1.DeleteInstallationRequest) @@ -1492,23 +1473,18 @@ public static final class DeleteInstallationRequest extends private DeleteInstallationRequest() { installationId_ = ""; } - public static final int INSTALLATION_ID_FIELD_NUMBER = 1; private java.lang.String installationId_; - /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return installationId_; } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -1516,10 +1492,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return com.google.protobuf.ByteString.copyFromUtf8(installationId_); } - /** * string installation_id = 1; - * * @param value The installationId to set. */ private void setInstallationId( @@ -1528,7 +1502,6 @@ private void setInstallationId( installationId_ = value; } - /** * string installation_id = 1; */ @@ -1536,10 +1509,8 @@ private void clearInstallationId() { installationId_ = getDefaultInstance().getInstallationId(); } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. */ private void setInstallationIdBytes( @@ -1555,7 +1526,6 @@ public static org.xmtp.android.library.push.Service.DeleteInstallationRequest pa return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1563,14 +1533,12 @@ public static org.xmtp.android.library.push.Service.DeleteInstallationRequest pa return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1578,55 +1546,1338 @@ public static org.xmtp.android.library.push.Service.DeleteInstallationRequest pa return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(org.xmtp.android.library.push.Service.DeleteInstallationRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+         * Delete an installation from the service
+         * 
+ * + * Protobuf type {@code notifications.v1.DeleteInstallationRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.xmtp.android.library.push.Service.DeleteInstallationRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:notifications.v1.DeleteInstallationRequest) + org.xmtp.android.library.push.Service.DeleteInstallationRequestOrBuilder { + // Construct using org.xmtp.android.library.push.Service.DeleteInstallationRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string installation_id = 1; + * @return The installationId. + */ + @java.lang.Override + public java.lang.String getInstallationId() { + return instance.getInstallationId(); + } + /** + * string installation_id = 1; + * @return The bytes for installationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInstallationIdBytes() { + return instance.getInstallationIdBytes(); + } + /** + * string installation_id = 1; + * @param value The installationId to set. + * @return This builder for chaining. + */ + public Builder setInstallationId( + java.lang.String value) { + copyOnWrite(); + instance.setInstallationId(value); + return this; + } + /** + * string installation_id = 1; + * @return This builder for chaining. + */ + public Builder clearInstallationId() { + copyOnWrite(); + instance.clearInstallationId(); + return this; + } + /** + * string installation_id = 1; + * @param value The bytes for installationId to set. + * @return This builder for chaining. + */ + public Builder setInstallationIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setInstallationIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:notifications.v1.DeleteInstallationRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new org.xmtp.android.library.push.Service.DeleteInstallationRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "installationId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (org.xmtp.android.library.push.Service.DeleteInstallationRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:notifications.v1.DeleteInstallationRequest) + private static final org.xmtp.android.library.push.Service.DeleteInstallationRequest DEFAULT_INSTANCE; + static { + DeleteInstallationRequest defaultInstance = new DeleteInstallationRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + DeleteInstallationRequest.class, defaultInstance); + } + + public static org.xmtp.android.library.push.Service.DeleteInstallationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface SubscriptionOrBuilder extends + // @@protoc_insertion_point(interface_extends:notifications.v1.Subscription) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string topic = 1; + * @return The topic. + */ + java.lang.String getTopic(); + /** + * string topic = 1; + * @return The bytes for topic. + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + java.util.List + getHmacKeysList(); + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + org.xmtp.android.library.push.Service.Subscription.HmacKey getHmacKeys(int index); + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + int getHmacKeysCount(); + + /** + * bool is_silent = 3; + * @return The isSilent. + */ + boolean getIsSilent(); + } + /** + *
+     * A subscription with associated metadata
+     * 
+ * + * Protobuf type {@code notifications.v1.Subscription} + */ + public static final class Subscription extends + com.google.protobuf.GeneratedMessageLite< + Subscription, Subscription.Builder> implements + // @@protoc_insertion_point(message_implements:notifications.v1.Subscription) + SubscriptionOrBuilder { + private Subscription() { + topic_ = ""; + hmacKeys_ = emptyProtobufList(); + } + public interface HmacKeyOrBuilder extends + // @@protoc_insertion_point(interface_extends:notifications.v1.Subscription.HmacKey) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint32 thirty_day_periods_since_epoch = 1; + * @return The thirtyDayPeriodsSinceEpoch. + */ + int getThirtyDayPeriodsSinceEpoch(); + + /** + * bytes key = 2; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + } + /** + * Protobuf type {@code notifications.v1.Subscription.HmacKey} + */ + public static final class HmacKey extends + com.google.protobuf.GeneratedMessageLite< + HmacKey, HmacKey.Builder> implements + // @@protoc_insertion_point(message_implements:notifications.v1.Subscription.HmacKey) + HmacKeyOrBuilder { + private HmacKey() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int THIRTY_DAY_PERIODS_SINCE_EPOCH_FIELD_NUMBER = 1; + private int thirtyDayPeriodsSinceEpoch_; + /** + * uint32 thirty_day_periods_since_epoch = 1; + * @return The thirtyDayPeriodsSinceEpoch. + */ + @java.lang.Override + public int getThirtyDayPeriodsSinceEpoch() { + return thirtyDayPeriodsSinceEpoch_; + } + /** + * uint32 thirty_day_periods_since_epoch = 1; + * @param value The thirtyDayPeriodsSinceEpoch to set. + */ + private void setThirtyDayPeriodsSinceEpoch(int value) { + + thirtyDayPeriodsSinceEpoch_ = value; + } + /** + * uint32 thirty_day_periods_since_epoch = 1; + */ + private void clearThirtyDayPeriodsSinceEpoch() { + + thirtyDayPeriodsSinceEpoch_ = 0; + } + + public static final int KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString key_; + /** + * bytes key = 2; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + * bytes key = 2; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * bytes key = 2; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.Subscription.HmacKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(org.xmtp.android.library.push.Service.Subscription.HmacKey prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code notifications.v1.Subscription.HmacKey} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.xmtp.android.library.push.Service.Subscription.HmacKey, Builder> implements + // @@protoc_insertion_point(builder_implements:notifications.v1.Subscription.HmacKey) + org.xmtp.android.library.push.Service.Subscription.HmacKeyOrBuilder { + // Construct using org.xmtp.android.library.push.Service.Subscription.HmacKey.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint32 thirty_day_periods_since_epoch = 1; + * @return The thirtyDayPeriodsSinceEpoch. + */ + @java.lang.Override + public int getThirtyDayPeriodsSinceEpoch() { + return instance.getThirtyDayPeriodsSinceEpoch(); + } + /** + * uint32 thirty_day_periods_since_epoch = 1; + * @param value The thirtyDayPeriodsSinceEpoch to set. + * @return This builder for chaining. + */ + public Builder setThirtyDayPeriodsSinceEpoch(int value) { + copyOnWrite(); + instance.setThirtyDayPeriodsSinceEpoch(value); + return this; + } + /** + * uint32 thirty_day_periods_since_epoch = 1; + * @return This builder for chaining. + */ + public Builder clearThirtyDayPeriodsSinceEpoch() { + copyOnWrite(); + instance.clearThirtyDayPeriodsSinceEpoch(); + return this; + } + + /** + * bytes key = 2; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + * bytes key = 2; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * bytes key = 2; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + // @@protoc_insertion_point(builder_scope:notifications.v1.Subscription.HmacKey) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new org.xmtp.android.library.push.Service.Subscription.HmacKey(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "thirtyDayPeriodsSinceEpoch_", + "key_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u000b\u0002\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (org.xmtp.android.library.push.Service.Subscription.HmacKey.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:notifications.v1.Subscription.HmacKey) + private static final org.xmtp.android.library.push.Service.Subscription.HmacKey DEFAULT_INSTANCE; + static { + HmacKey defaultInstance = new HmacKey(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + HmacKey.class, defaultInstance); + } + + public static org.xmtp.android.library.push.Service.Subscription.HmacKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private java.lang.String topic_; + /** + * string topic = 1; + * @return The topic. + */ + @java.lang.Override + public java.lang.String getTopic() { + return topic_; + } + /** + * string topic = 1; + * @return The bytes for topic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTopicBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(topic_); + } + /** + * string topic = 1; + * @param value The topic to set. + */ + private void setTopic( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + topic_ = value; + } + /** + * string topic = 1; + */ + private void clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + } + /** + * string topic = 1; + * @param value The bytes for topic to set. + */ + private void setTopicBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + topic_ = value.toStringUtf8(); + + } + + public static final int HMAC_KEYS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList hmacKeys_; + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + @java.lang.Override + public java.util.List getHmacKeysList() { + return hmacKeys_; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public java.util.List + getHmacKeysOrBuilderList() { + return hmacKeys_; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + @java.lang.Override + public int getHmacKeysCount() { + return hmacKeys_.size(); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + @java.lang.Override + public org.xmtp.android.library.push.Service.Subscription.HmacKey getHmacKeys(int index) { + return hmacKeys_.get(index); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public org.xmtp.android.library.push.Service.Subscription.HmacKeyOrBuilder getHmacKeysOrBuilder( + int index) { + return hmacKeys_.get(index); + } + private void ensureHmacKeysIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = hmacKeys_; + if (!tmp.isModifiable()) { + hmacKeys_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + private void setHmacKeys( + int index, org.xmtp.android.library.push.Service.Subscription.HmacKey value) { + value.getClass(); + ensureHmacKeysIsMutable(); + hmacKeys_.set(index, value); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + private void addHmacKeys(org.xmtp.android.library.push.Service.Subscription.HmacKey value) { + value.getClass(); + ensureHmacKeysIsMutable(); + hmacKeys_.add(value); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + private void addHmacKeys( + int index, org.xmtp.android.library.push.Service.Subscription.HmacKey value) { + value.getClass(); + ensureHmacKeysIsMutable(); + hmacKeys_.add(index, value); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + private void addAllHmacKeys( + java.lang.Iterable values) { + ensureHmacKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, hmacKeys_); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + private void clearHmacKeys() { + hmacKeys_ = emptyProtobufList(); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + private void removeHmacKeys(int index) { + ensureHmacKeysIsMutable(); + hmacKeys_.remove(index); + } + + public static final int IS_SILENT_FIELD_NUMBER = 3; + private boolean isSilent_; + /** + * bool is_silent = 3; + * @return The isSilent. + */ + @java.lang.Override + public boolean getIsSilent() { + return isSilent_; + } + /** + * bool is_silent = 3; + * @param value The isSilent to set. + */ + private void setIsSilent(boolean value) { + + isSilent_ = value; + } + /** + * bool is_silent = 3; + */ + private void clearIsSilent() { + + isSilent_ = false; + } + + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.Subscription parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static org.xmtp.android.library.push.Service.Subscription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(org.xmtp.android.library.push.Service.Subscription prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+         * A subscription with associated metadata
+         * 
+ * + * Protobuf type {@code notifications.v1.Subscription} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.xmtp.android.library.push.Service.Subscription, Builder> implements + // @@protoc_insertion_point(builder_implements:notifications.v1.Subscription) + org.xmtp.android.library.push.Service.SubscriptionOrBuilder { + // Construct using org.xmtp.android.library.push.Service.Subscription.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string topic = 1; + * @return The topic. + */ + @java.lang.Override + public java.lang.String getTopic() { + return instance.getTopic(); + } + /** + * string topic = 1; + * @return The bytes for topic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTopicBytes() { + return instance.getTopicBytes(); + } + /** + * string topic = 1; + * @param value The topic to set. + * @return This builder for chaining. + */ + public Builder setTopic( + java.lang.String value) { + copyOnWrite(); + instance.setTopic(value); + return this; + } + /** + * string topic = 1; + * @return This builder for chaining. + */ + public Builder clearTopic() { + copyOnWrite(); + instance.clearTopic(); + return this; + } + /** + * string topic = 1; + * @param value The bytes for topic to set. + * @return This builder for chaining. + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTopicBytes(value); + return this; + } + + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + @java.lang.Override + public java.util.List getHmacKeysList() { + return java.util.Collections.unmodifiableList( + instance.getHmacKeysList()); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + @java.lang.Override + public int getHmacKeysCount() { + return instance.getHmacKeysCount(); + }/** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + @java.lang.Override + public org.xmtp.android.library.push.Service.Subscription.HmacKey getHmacKeys(int index) { + return instance.getHmacKeys(index); + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder setHmacKeys( + int index, org.xmtp.android.library.push.Service.Subscription.HmacKey value) { + copyOnWrite(); + instance.setHmacKeys(index, value); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder setHmacKeys( + int index, org.xmtp.android.library.push.Service.Subscription.HmacKey.Builder builderForValue) { + copyOnWrite(); + instance.setHmacKeys(index, + builderForValue.build()); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder addHmacKeys(org.xmtp.android.library.push.Service.Subscription.HmacKey value) { + copyOnWrite(); + instance.addHmacKeys(value); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder addHmacKeys( + int index, org.xmtp.android.library.push.Service.Subscription.HmacKey value) { + copyOnWrite(); + instance.addHmacKeys(index, value); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder addHmacKeys( + org.xmtp.android.library.push.Service.Subscription.HmacKey.Builder builderForValue) { + copyOnWrite(); + instance.addHmacKeys(builderForValue.build()); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder addHmacKeys( + int index, org.xmtp.android.library.push.Service.Subscription.HmacKey.Builder builderForValue) { + copyOnWrite(); + instance.addHmacKeys(index, + builderForValue.build()); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder addAllHmacKeys( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllHmacKeys(values); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder clearHmacKeys() { + copyOnWrite(); + instance.clearHmacKeys(); + return this; + } + /** + * repeated .notifications.v1.Subscription.HmacKey hmac_keys = 2; + */ + public Builder removeHmacKeys(int index) { + copyOnWrite(); + instance.removeHmacKeys(index); + return this; + } + + /** + * bool is_silent = 3; + * @return The isSilent. + */ + @java.lang.Override + public boolean getIsSilent() { + return instance.getIsSilent(); + } + /** + * bool is_silent = 3; + * @param value The isSilent to set. + * @return This builder for chaining. + */ + public Builder setIsSilent(boolean value) { + copyOnWrite(); + instance.setIsSilent(value); + return this; + } + /** + * bool is_silent = 3; + * @return This builder for chaining. + */ + public Builder clearIsSilent() { + copyOnWrite(); + instance.clearIsSilent(); + return this; + } + + // @@protoc_insertion_point(builder_scope:notifications.v1.Subscription) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new org.xmtp.android.library.push.Service.Subscription(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "topic_", + "hmacKeys_", + org.xmtp.android.library.push.Service.Subscription.HmacKey.class, + "isSilent_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u0208\u0002\u001b" + + "\u0003\u0007"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (org.xmtp.android.library.push.Service.Subscription.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:notifications.v1.Subscription) + private static final org.xmtp.android.library.push.Service.Subscription DEFAULT_INSTANCE; + static { + Subscription defaultInstance = new Subscription(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Subscription.class, defaultInstance); + } + + public static org.xmtp.android.library.push.Service.Subscription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface SubscribeWithMetadataRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:notifications.v1.SubscribeWithMetadataRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string installation_id = 1; + * @return The installationId. + */ + java.lang.String getInstallationId(); + /** + * string installation_id = 1; + * @return The bytes for installationId. + */ + com.google.protobuf.ByteString + getInstallationIdBytes(); + + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + java.util.List + getSubscriptionsList(); + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + org.xmtp.android.library.push.Service.Subscription getSubscriptions(int index); + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + int getSubscriptionsCount(); + } + /** + *
+     * A request to subscribe to a list of topics and update the associated metadata
+     * 
+ * + * Protobuf type {@code notifications.v1.SubscribeWithMetadataRequest} + */ + public static final class SubscribeWithMetadataRequest extends + com.google.protobuf.GeneratedMessageLite< + SubscribeWithMetadataRequest, SubscribeWithMetadataRequest.Builder> implements + // @@protoc_insertion_point(message_implements:notifications.v1.SubscribeWithMetadataRequest) + SubscribeWithMetadataRequestOrBuilder { + private SubscribeWithMetadataRequest() { + installationId_ = ""; + subscriptions_ = emptyProtobufList(); + } + public static final int INSTALLATION_ID_FIELD_NUMBER = 1; + private java.lang.String installationId_; + /** + * string installation_id = 1; + * @return The installationId. + */ + @java.lang.Override + public java.lang.String getInstallationId() { + return installationId_; + } + /** + * string installation_id = 1; + * @return The bytes for installationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInstallationIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(installationId_); + } + /** + * string installation_id = 1; + * @param value The installationId to set. + */ + private void setInstallationId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + installationId_ = value; + } + /** + * string installation_id = 1; + */ + private void clearInstallationId() { + + installationId_ = getDefaultInstance().getInstallationId(); + } + /** + * string installation_id = 1; + * @param value The bytes for installationId to set. + */ + private void setInstallationIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + installationId_ = value.toStringUtf8(); + + } + + public static final int SUBSCRIPTIONS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList subscriptions_; + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + @java.lang.Override + public java.util.List getSubscriptionsList() { + return subscriptions_; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public java.util.List + getSubscriptionsOrBuilderList() { + return subscriptions_; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + @java.lang.Override + public int getSubscriptionsCount() { + return subscriptions_.size(); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + @java.lang.Override + public org.xmtp.android.library.push.Service.Subscription getSubscriptions(int index) { + return subscriptions_.get(index); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public org.xmtp.android.library.push.Service.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + return subscriptions_.get(index); + } + private void ensureSubscriptionsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = subscriptions_; + if (!tmp.isModifiable()) { + subscriptions_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + private void setSubscriptions( + int index, org.xmtp.android.library.push.Service.Subscription value) { + value.getClass(); + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, value); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + private void addSubscriptions(org.xmtp.android.library.push.Service.Subscription value) { + value.getClass(); + ensureSubscriptionsIsMutable(); + subscriptions_.add(value); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + private void addSubscriptions( + int index, org.xmtp.android.library.push.Service.Subscription value) { + value.getClass(); + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, value); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + private void addAllSubscriptions( + java.lang.Iterable values) { + ensureSubscriptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, subscriptions_); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + private void clearSubscriptions() { + subscriptions_ = emptyProtobufList(); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + private void removeSubscriptions(int index) { + ensureSubscriptionsIsMutable(); + subscriptions_.remove(index); + } - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom(byte[] data) + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom(java.io.InputStream input) + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseDelimitedFrom(java.io.InputStream input) + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseDelimitedFrom( + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest parseFrom( + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1637,20 +2888,23 @@ public static org.xmtp.android.library.push.Service.DeleteInstallationRequest pa public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - - public static Builder newBuilder(org.xmtp.android.library.push.Service.DeleteInstallationRequest prototype) { + public static Builder newBuilder(org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** - * Protobuf type {@code notifications.v1.DeleteInstallationRequest} + *
+         * A request to subscribe to a list of topics and update the associated metadata
+         * 
+ * + * Protobuf type {@code notifications.v1.SubscribeWithMetadataRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - org.xmtp.android.library.push.Service.DeleteInstallationRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:notifications.v1.DeleteInstallationRequest) - org.xmtp.android.library.push.Service.DeleteInstallationRequestOrBuilder { - // Construct using org.xmtp.android.library.push.Service.DeleteInstallationRequest.newBuilder() + org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:notifications.v1.SubscribeWithMetadataRequest) + org.xmtp.android.library.push.Service.SubscribeWithMetadataRequestOrBuilder { + // Construct using org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest.newBuilder() private Builder() { super(DEFAULT_INSTANCE); } @@ -1658,17 +2912,14 @@ private Builder() { /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return instance.getInstallationId(); } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -1676,10 +2927,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return instance.getInstallationIdBytes(); } - /** * string installation_id = 1; - * * @param value The installationId to set. * @return This builder for chaining. */ @@ -1689,10 +2938,8 @@ public Builder setInstallationId( instance.setInstallationId(value); return this; } - /** * string installation_id = 1; - * * @return This builder for chaining. */ public Builder clearInstallationId() { @@ -1700,10 +2947,8 @@ public Builder clearInstallationId() { instance.clearInstallationId(); return this; } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. * @return This builder for chaining. */ @@ -1714,9 +2959,110 @@ public Builder setInstallationIdBytes( return this; } - // @@protoc_insertion_point(builder_scope:notifications.v1.DeleteInstallationRequest) - } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + @java.lang.Override + public java.util.List getSubscriptionsList() { + return java.util.Collections.unmodifiableList( + instance.getSubscriptionsList()); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + @java.lang.Override + public int getSubscriptionsCount() { + return instance.getSubscriptionsCount(); + }/** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + @java.lang.Override + public org.xmtp.android.library.push.Service.Subscription getSubscriptions(int index) { + return instance.getSubscriptions(index); + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder setSubscriptions( + int index, org.xmtp.android.library.push.Service.Subscription value) { + copyOnWrite(); + instance.setSubscriptions(index, value); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder setSubscriptions( + int index, org.xmtp.android.library.push.Service.Subscription.Builder builderForValue) { + copyOnWrite(); + instance.setSubscriptions(index, + builderForValue.build()); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder addSubscriptions(org.xmtp.android.library.push.Service.Subscription value) { + copyOnWrite(); + instance.addSubscriptions(value); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder addSubscriptions( + int index, org.xmtp.android.library.push.Service.Subscription value) { + copyOnWrite(); + instance.addSubscriptions(index, value); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder addSubscriptions( + org.xmtp.android.library.push.Service.Subscription.Builder builderForValue) { + copyOnWrite(); + instance.addSubscriptions(builderForValue.build()); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder addSubscriptions( + int index, org.xmtp.android.library.push.Service.Subscription.Builder builderForValue) { + copyOnWrite(); + instance.addSubscriptions(index, + builderForValue.build()); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder addAllSubscriptions( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllSubscriptions(values); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder clearSubscriptions() { + copyOnWrite(); + instance.clearSubscriptions(); + return this; + } + /** + * repeated .notifications.v1.Subscription subscriptions = 2; + */ + public Builder removeSubscriptions(int index) { + copyOnWrite(); + instance.removeSubscriptions(index); + return this; + } + // @@protoc_insertion_point(builder_scope:notifications.v1.SubscribeWithMetadataRequest) + } @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) protected final java.lang.Object dynamicMethod( @@ -1724,17 +3070,20 @@ protected final java.lang.Object dynamicMethod( java.lang.Object arg0, java.lang.Object arg1) { switch (method) { case NEW_MUTABLE_INSTANCE: { - return new org.xmtp.android.library.push.Service.DeleteInstallationRequest(); + return new org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest(); } case NEW_BUILDER: { return new Builder(); } case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[]{ + java.lang.Object[] objects = new java.lang.Object[] { "installationId_", + "subscriptions_", + org.xmtp.android.library.push.Service.Subscription.class, }; java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0001\u0000\u0001\u0208\u0002\u001b" + + ""; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -1742,13 +3091,13 @@ protected final java.lang.Object dynamicMethod( return DEFAULT_INSTANCE; } case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; + com.google.protobuf.Parser parser = PARSER; if (parser == null) { - synchronized (org.xmtp.android.library.push.Service.DeleteInstallationRequest.class) { + synchronized (org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest.class) { parser = PARSER; if (parser == null) { parser = - new DefaultInstanceBasedParser( + new DefaultInstanceBasedParser( DEFAULT_INSTANCE); PARSER = parser; } @@ -1767,25 +3116,24 @@ protected final java.lang.Object dynamicMethod( } - // @@protoc_insertion_point(class_scope:notifications.v1.DeleteInstallationRequest) - private static final org.xmtp.android.library.push.Service.DeleteInstallationRequest DEFAULT_INSTANCE; - + // @@protoc_insertion_point(class_scope:notifications.v1.SubscribeWithMetadataRequest) + private static final org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest DEFAULT_INSTANCE; static { - DeleteInstallationRequest defaultInstance = new DeleteInstallationRequest(); + SubscribeWithMetadataRequest defaultInstance = new SubscribeWithMetadataRequest(); // New instances are implicitly immutable so no need to make // immutable. DEFAULT_INSTANCE = defaultInstance; com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DeleteInstallationRequest.class, defaultInstance); + SubscribeWithMetadataRequest.class, defaultInstance); } - public static org.xmtp.android.library.push.Service.DeleteInstallationRequest getDefaultInstance() { + public static org.xmtp.android.library.push.Service.SubscribeWithMetadataRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static volatile com.google.protobuf.Parser PARSER; + private static volatile com.google.protobuf.Parser PARSER; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return DEFAULT_INSTANCE.getParserForType(); } } @@ -1796,14 +3144,11 @@ public interface SubscribeRequestOrBuilder extends /** * string installation_id = 1; - * * @return The installationId. */ java.lang.String getInstallationId(); - /** * string installation_id = 1; - * * @return The bytes for installationId. */ com.google.protobuf.ByteString @@ -1811,41 +3156,37 @@ public interface SubscribeRequestOrBuilder extends /** * repeated string topics = 2; - * * @return A list containing the topics. */ java.util.List getTopicsList(); - /** * repeated string topics = 2; - * * @return The count of topics. */ int getTopicsCount(); - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ java.lang.String getTopics(int index); - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ com.google.protobuf.ByteString getTopicsBytes(int index); } - /** + *
+     * Subscribe to a list of topics
+     * 
+ * * Protobuf type {@code notifications.v1.SubscribeRequest} */ - public static final class SubscribeRequest extends + public static final class SubscribeRequest extends com.google.protobuf.GeneratedMessageLite< SubscribeRequest, SubscribeRequest.Builder> implements // @@protoc_insertion_point(message_implements:notifications.v1.SubscribeRequest) @@ -1854,23 +3195,18 @@ private SubscribeRequest() { installationId_ = ""; topics_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); } - public static final int INSTALLATION_ID_FIELD_NUMBER = 1; private java.lang.String installationId_; - /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return installationId_; } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -1878,10 +3214,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return com.google.protobuf.ByteString.copyFromUtf8(installationId_); } - /** * string installation_id = 1; - * * @param value The installationId to set. */ private void setInstallationId( @@ -1890,7 +3224,6 @@ private void setInstallationId( installationId_ = value; } - /** * string installation_id = 1; */ @@ -1898,10 +3231,8 @@ private void clearInstallationId() { installationId_ = getDefaultInstance().getInstallationId(); } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. */ private void setInstallationIdBytes( @@ -1913,30 +3244,24 @@ private void setInstallationIdBytes( public static final int TOPICS_FIELD_NUMBER = 2; private com.google.protobuf.Internal.ProtobufList topics_; - /** * repeated string topics = 2; - * * @return A list containing the topics. */ @java.lang.Override public java.util.List getTopicsList() { return topics_; } - /** * repeated string topics = 2; - * * @return The count of topics. */ @java.lang.Override public int getTopicsCount() { return topics_.size(); } - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ @@ -1944,10 +3269,8 @@ public int getTopicsCount() { public java.lang.String getTopics(int index) { return topics_.get(index); } - /** * repeated string topics = 2; - * * @param index The index of the value to return. * @return The bytes of the topics at the given index. */ @@ -1957,19 +3280,15 @@ public java.lang.String getTopics(int index) { return com.google.protobuf.ByteString.copyFromUtf8( topics_.get(index)); } - private void ensureTopicsIsMutable() { com.google.protobuf.Internal.ProtobufList tmp = - topics_; - if (!tmp.isModifiable()) { + topics_; if (!tmp.isModifiable()) { topics_ = com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); } } - /** * repeated string topics = 2; - * * @param index The index to set the value at. * @param value The topics to set. */ @@ -1979,10 +3298,8 @@ private void setTopics( ensureTopicsIsMutable(); topics_.set(index, value); } - /** * repeated string topics = 2; - * * @param value The topics to add. */ private void addTopics( @@ -1991,10 +3308,8 @@ private void addTopics( ensureTopicsIsMutable(); topics_.add(value); } - /** * repeated string topics = 2; - * * @param values The topics to add. */ private void addAllTopics( @@ -2003,17 +3318,14 @@ private void addAllTopics( com.google.protobuf.AbstractMessageLite.addAll( values, topics_); } - /** * repeated string topics = 2; */ private void clearTopics() { topics_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); } - /** * repeated string topics = 2; - * * @param value The bytes of the topics to add. */ private void addTopicsBytes( @@ -2029,7 +3341,6 @@ public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2037,14 +3348,12 @@ public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2052,13 +3361,11 @@ public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2066,13 +3373,11 @@ public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2080,26 +3385,22 @@ public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2111,12 +3412,15 @@ public static org.xmtp.android.library.push.Service.SubscribeRequest parseFrom( public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(org.xmtp.android.library.push.Service.SubscribeRequest prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** + *
+         * Subscribe to a list of topics
+         * 
+ * * Protobuf type {@code notifications.v1.SubscribeRequest} */ public static final class Builder extends @@ -2132,17 +3436,14 @@ private Builder() { /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return instance.getInstallationId(); } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -2150,10 +3451,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return instance.getInstallationIdBytes(); } - /** * string installation_id = 1; - * * @param value The installationId to set. * @return This builder for chaining. */ @@ -2163,10 +3462,8 @@ public Builder setInstallationId( instance.setInstallationId(value); return this; } - /** * string installation_id = 1; - * * @return This builder for chaining. */ public Builder clearInstallationId() { @@ -2174,10 +3471,8 @@ public Builder clearInstallationId() { instance.clearInstallationId(); return this; } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. * @return This builder for chaining. */ @@ -2190,7 +3485,6 @@ public Builder setInstallationIdBytes( /** * repeated string topics = 2; - * * @return A list containing the topics. */ @java.lang.Override @@ -2199,20 +3493,16 @@ public Builder setInstallationIdBytes( return java.util.Collections.unmodifiableList( instance.getTopicsList()); } - /** * repeated string topics = 2; - * * @return The count of topics. */ @java.lang.Override public int getTopicsCount() { return instance.getTopicsCount(); } - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ @@ -2220,10 +3510,8 @@ public int getTopicsCount() { public java.lang.String getTopics(int index) { return instance.getTopics(index); } - /** * repeated string topics = 2; - * * @param index The index of the value to return. * @return The bytes of the topics at the given index. */ @@ -2232,10 +3520,8 @@ public java.lang.String getTopics(int index) { getTopicsBytes(int index) { return instance.getTopicsBytes(index); } - /** * repeated string topics = 2; - * * @param index The index to set the value at. * @param value The topics to set. * @return This builder for chaining. @@ -2246,10 +3532,8 @@ public Builder setTopics( instance.setTopics(index, value); return this; } - /** * repeated string topics = 2; - * * @param value The topics to add. * @return This builder for chaining. */ @@ -2259,10 +3543,8 @@ public Builder addTopics( instance.addTopics(value); return this; } - /** * repeated string topics = 2; - * * @param values The topics to add. * @return This builder for chaining. */ @@ -2272,10 +3554,8 @@ public Builder addAllTopics( instance.addAllTopics(values); return this; } - /** * repeated string topics = 2; - * * @return This builder for chaining. */ public Builder clearTopics() { @@ -2283,10 +3563,8 @@ public Builder clearTopics() { instance.clearTopics(); return this; } - /** * repeated string topics = 2; - * * @param value The bytes of the topics to add. * @return This builder for chaining. */ @@ -2299,7 +3577,6 @@ public Builder addTopicsBytes( // @@protoc_insertion_point(builder_scope:notifications.v1.SubscribeRequest) } - @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) protected final java.lang.Object dynamicMethod( @@ -2313,7 +3590,7 @@ protected final java.lang.Object dynamicMethod( return new Builder(); } case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[]{ + java.lang.Object[] objects = new java.lang.Object[] { "installationId_", "topics_", }; @@ -2354,7 +3631,6 @@ protected final java.lang.Object dynamicMethod( // @@protoc_insertion_point(class_scope:notifications.v1.SubscribeRequest) private static final org.xmtp.android.library.push.Service.SubscribeRequest DEFAULT_INSTANCE; - static { SubscribeRequest defaultInstance = new SubscribeRequest(); // New instances are implicitly immutable so no need to make @@ -2381,14 +3657,11 @@ public interface UnsubscribeRequestOrBuilder extends /** * string installation_id = 1; - * * @return The installationId. */ java.lang.String getInstallationId(); - /** * string installation_id = 1; - * * @return The bytes for installationId. */ com.google.protobuf.ByteString @@ -2396,41 +3669,37 @@ public interface UnsubscribeRequestOrBuilder extends /** * repeated string topics = 2; - * * @return A list containing the topics. */ java.util.List getTopicsList(); - /** * repeated string topics = 2; - * * @return The count of topics. */ int getTopicsCount(); - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ java.lang.String getTopics(int index); - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ com.google.protobuf.ByteString getTopicsBytes(int index); } - /** + *
+     * Unsubscribe from a list of topics
+     * 
+ * * Protobuf type {@code notifications.v1.UnsubscribeRequest} */ - public static final class UnsubscribeRequest extends + public static final class UnsubscribeRequest extends com.google.protobuf.GeneratedMessageLite< UnsubscribeRequest, UnsubscribeRequest.Builder> implements // @@protoc_insertion_point(message_implements:notifications.v1.UnsubscribeRequest) @@ -2439,23 +3708,18 @@ private UnsubscribeRequest() { installationId_ = ""; topics_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); } - public static final int INSTALLATION_ID_FIELD_NUMBER = 1; private java.lang.String installationId_; - /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return installationId_; } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -2463,10 +3727,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return com.google.protobuf.ByteString.copyFromUtf8(installationId_); } - /** * string installation_id = 1; - * * @param value The installationId to set. */ private void setInstallationId( @@ -2475,7 +3737,6 @@ private void setInstallationId( installationId_ = value; } - /** * string installation_id = 1; */ @@ -2483,10 +3744,8 @@ private void clearInstallationId() { installationId_ = getDefaultInstance().getInstallationId(); } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. */ private void setInstallationIdBytes( @@ -2498,30 +3757,24 @@ private void setInstallationIdBytes( public static final int TOPICS_FIELD_NUMBER = 2; private com.google.protobuf.Internal.ProtobufList topics_; - /** * repeated string topics = 2; - * * @return A list containing the topics. */ @java.lang.Override public java.util.List getTopicsList() { return topics_; } - /** * repeated string topics = 2; - * * @return The count of topics. */ @java.lang.Override public int getTopicsCount() { return topics_.size(); } - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ @@ -2529,10 +3782,8 @@ public int getTopicsCount() { public java.lang.String getTopics(int index) { return topics_.get(index); } - /** * repeated string topics = 2; - * * @param index The index of the value to return. * @return The bytes of the topics at the given index. */ @@ -2542,19 +3793,15 @@ public java.lang.String getTopics(int index) { return com.google.protobuf.ByteString.copyFromUtf8( topics_.get(index)); } - private void ensureTopicsIsMutable() { com.google.protobuf.Internal.ProtobufList tmp = - topics_; - if (!tmp.isModifiable()) { + topics_; if (!tmp.isModifiable()) { topics_ = com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); } } - /** * repeated string topics = 2; - * * @param index The index to set the value at. * @param value The topics to set. */ @@ -2564,10 +3811,8 @@ private void setTopics( ensureTopicsIsMutable(); topics_.set(index, value); } - /** * repeated string topics = 2; - * * @param value The topics to add. */ private void addTopics( @@ -2576,10 +3821,8 @@ private void addTopics( ensureTopicsIsMutable(); topics_.add(value); } - /** * repeated string topics = 2; - * * @param values The topics to add. */ private void addAllTopics( @@ -2588,17 +3831,14 @@ private void addAllTopics( com.google.protobuf.AbstractMessageLite.addAll( values, topics_); } - /** * repeated string topics = 2; */ private void clearTopics() { topics_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); } - /** * repeated string topics = 2; - * * @param value The bytes of the topics to add. */ private void addTopicsBytes( @@ -2614,7 +3854,6 @@ public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2622,14 +3861,12 @@ public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2637,13 +3874,11 @@ public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2651,13 +3886,11 @@ public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2665,26 +3898,22 @@ public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2696,12 +3925,15 @@ public static org.xmtp.android.library.push.Service.UnsubscribeRequest parseFrom public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(org.xmtp.android.library.push.Service.UnsubscribeRequest prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** + *
+         * Unsubscribe from a list of topics
+         * 
+ * * Protobuf type {@code notifications.v1.UnsubscribeRequest} */ public static final class Builder extends @@ -2717,17 +3949,14 @@ private Builder() { /** * string installation_id = 1; - * * @return The installationId. */ @java.lang.Override public java.lang.String getInstallationId() { return instance.getInstallationId(); } - /** * string installation_id = 1; - * * @return The bytes for installationId. */ @java.lang.Override @@ -2735,10 +3964,8 @@ public java.lang.String getInstallationId() { getInstallationIdBytes() { return instance.getInstallationIdBytes(); } - /** * string installation_id = 1; - * * @param value The installationId to set. * @return This builder for chaining. */ @@ -2748,10 +3975,8 @@ public Builder setInstallationId( instance.setInstallationId(value); return this; } - /** * string installation_id = 1; - * * @return This builder for chaining. */ public Builder clearInstallationId() { @@ -2759,10 +3984,8 @@ public Builder clearInstallationId() { instance.clearInstallationId(); return this; } - /** * string installation_id = 1; - * * @param value The bytes for installationId to set. * @return This builder for chaining. */ @@ -2775,7 +3998,6 @@ public Builder setInstallationIdBytes( /** * repeated string topics = 2; - * * @return A list containing the topics. */ @java.lang.Override @@ -2784,20 +4006,16 @@ public Builder setInstallationIdBytes( return java.util.Collections.unmodifiableList( instance.getTopicsList()); } - /** * repeated string topics = 2; - * * @return The count of topics. */ @java.lang.Override public int getTopicsCount() { return instance.getTopicsCount(); } - /** * repeated string topics = 2; - * * @param index The index of the element to return. * @return The topics at the given index. */ @@ -2805,10 +4023,8 @@ public int getTopicsCount() { public java.lang.String getTopics(int index) { return instance.getTopics(index); } - /** * repeated string topics = 2; - * * @param index The index of the value to return. * @return The bytes of the topics at the given index. */ @@ -2817,10 +4033,8 @@ public java.lang.String getTopics(int index) { getTopicsBytes(int index) { return instance.getTopicsBytes(index); } - /** * repeated string topics = 2; - * * @param index The index to set the value at. * @param value The topics to set. * @return This builder for chaining. @@ -2831,10 +4045,8 @@ public Builder setTopics( instance.setTopics(index, value); return this; } - /** * repeated string topics = 2; - * * @param value The topics to add. * @return This builder for chaining. */ @@ -2844,10 +4056,8 @@ public Builder addTopics( instance.addTopics(value); return this; } - /** * repeated string topics = 2; - * * @param values The topics to add. * @return This builder for chaining. */ @@ -2857,10 +4067,8 @@ public Builder addAllTopics( instance.addAllTopics(values); return this; } - /** * repeated string topics = 2; - * * @return This builder for chaining. */ public Builder clearTopics() { @@ -2868,10 +4076,8 @@ public Builder clearTopics() { instance.clearTopics(); return this; } - /** * repeated string topics = 2; - * * @param value The bytes of the topics to add. * @return This builder for chaining. */ @@ -2884,7 +4090,6 @@ public Builder addTopicsBytes( // @@protoc_insertion_point(builder_scope:notifications.v1.UnsubscribeRequest) } - @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) protected final java.lang.Object dynamicMethod( @@ -2898,7 +4103,7 @@ protected final java.lang.Object dynamicMethod( return new Builder(); } case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[]{ + java.lang.Object[] objects = new java.lang.Object[] { "installationId_", "topics_", }; @@ -2939,7 +4144,6 @@ protected final java.lang.Object dynamicMethod( // @@protoc_insertion_point(class_scope:notifications.v1.UnsubscribeRequest) private static final org.xmtp.android.library.push.Service.UnsubscribeRequest DEFAULT_INSTANCE; - static { UnsubscribeRequest defaultInstance = new UnsubscribeRequest(); // New instances are implicitly immutable so no need to make diff --git a/library/src/main/java/org/xmtp/android/library/push/XMTPPush.kt b/library/src/main/java/org/xmtp/android/library/push/XMTPPush.kt index fc3a7fbd..5827417a 100644 --- a/library/src/main/java/org/xmtp/android/library/push/XMTPPush.kt +++ b/library/src/main/java/org/xmtp/android/library/push/XMTPPush.kt @@ -51,6 +51,17 @@ class XMTPPush() { client.subscribe(request) } + fun subscribeWithMetadata(subscriptions: List) { + if (pushServer == "") { + throw XMTPException("No push server") + } + val request = Service.SubscribeWithMetadataRequest.newBuilder().also { request -> + request.installationId = installationId + request.addAllSubscriptions(subscriptions) + }.build() + client.subscribeWithMetadata(request) + } + fun unsubscribe(topics: List) { if (pushServer == "") { throw XMTPException("No push server")