diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e8b2ddc3..3fd7b344 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -123,7 +123,6 @@ dependencies { implementation(projects.clickstreamHealthMetrics) implementation(projects.clickstreamEventVisualiser) implementation(projects.clickstreamEventVisualiserUi) - implementation(files("$rootDir/libs/proto-consumer-1.18.6.jar")) // Common implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1") diff --git a/app/src/main/java/com/clickstream/app/main/MainViewModel.kt b/app/src/main/java/com/clickstream/app/main/MainViewModel.kt index 407943da..3cecd680 100644 --- a/app/src/main/java/com/clickstream/app/main/MainViewModel.kt +++ b/app/src/main/java/com/clickstream/app/main/MainViewModel.kt @@ -11,11 +11,9 @@ import com.clickstream.app.main.MainIntent.DisconnectIntent import com.clickstream.app.main.MainIntent.InputIntent import com.clickstream.app.main.MainIntent.SendIntent import com.clickstream.app.main.MainState.InFlight -import com.gojek.clickstream.common.EventMeta -import com.gojek.clickstream.products.common.AppType -import com.gojek.clickstream.products.common.DroppedProperties -import com.gojek.clickstream.products.common.DroppedPropertiesBatch -import com.gojek.clickstream.products.common.Product +import com.clickstream.app.proto.App +import com.clickstream.app.proto.Device +import com.clickstream.app.proto.User import com.google.protobuf.Timestamp import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.Flow @@ -49,14 +47,22 @@ class MainViewModel @Inject constructor(val dispatcher: Dispatcher) : ViewModel( } private fun sendMockCSEvent() { - val customerProto = DroppedPropertiesBatch.newBuilder().apply { - appType = AppType.Consumer - product = Product.GoSend - meta = EventMeta.newBuilder().apply { - eventGuid = "123" + val customerProto = User.newBuilder().apply { + guid = "Some Guid" + name = "John Doe" + age = 35 + gender = "male" + phoneNumber = 1234567890 + email = "john.doe@example.com" + app = App.newBuilder().apply { + version = "0.0.1" + packageName = "com.clickstream" }.build() - eventTimestamp = Timestamp.newBuilder().apply { - seconds = System.currentTimeMillis() / 1000L + device = Device.newBuilder().apply { + operatingSystem = "android" + operatingSystemVersion = "29" + deviceMake = "Samsung" + deviceModel = "SM2028" }.build() }.build() diff --git a/app/src/main/java/com/clickstream/app/proto/App.java b/app/src/main/java/com/clickstream/app/proto/App.java new file mode 100644 index 00000000..8ec100da --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/App.java @@ -0,0 +1,498 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: App.proto + +package com.clickstream.app.proto; + +/** + *
+ * Corresponds to the details for the app used by the user.
+ * 
+ * + * Protobuf type {@code clickstream.proto.App} + */ +public final class App extends + com.google.protobuf.GeneratedMessageLite< + App, App.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.proto.App) + AppOrBuilder { + private App() { + version_ = ""; + packageName_ = ""; + } + public static final int VERSION_FIELD_NUMBER = 1; + private String version_; + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The version. + */ + @Override + public String getVersion() { + return version_; + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The bytes for version. + */ + @Override + public com.google.protobuf.ByteString + getVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(version_); + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @param value The version to set. + */ + private void setVersion( + String value) { + Class valueClass = value.getClass(); + + version_ = value; + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + */ + private void clearVersion() { + + version_ = getDefaultInstance().getVersion(); + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @param value The bytes for version to set. + */ + private void setVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + version_ = value.toStringUtf8(); + + } + + public static final int PACKAGE_NAME_FIELD_NUMBER = 2; + private String packageName_; + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The packageName. + */ + @Override + public String getPackageName() { + return packageName_; + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The bytes for packageName. + */ + @Override + public com.google.protobuf.ByteString + getPackageNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(packageName_); + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @param value The packageName to set. + */ + private void setPackageName( + String value) { + Class valueClass = value.getClass(); + + packageName_ = value; + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + */ + private void clearPackageName() { + + packageName_ = getDefaultInstance().getPackageName(); + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @param value The bytes for packageName to set. + */ + private void setPackageNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + packageName_ = value.toStringUtf8(); + + } + + public static App parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static App 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 App parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static App parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static App parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static App 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(App prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Corresponds to the details for the app used by the user.
+   * 
+ * + * Protobuf type {@code clickstream.proto.App} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + App, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.proto.App) + AppOrBuilder { + // Construct using com.clickstream.app.proto.App.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @return The version. + */ + @Override + public String getVersion() { + return instance.getVersion(); + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @return The bytes for version. + */ + @Override + public com.google.protobuf.ByteString + getVersionBytes() { + return instance.getVersionBytes(); + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + String value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @return This builder for chaining. + */ + public Builder clearVersion() { + copyOnWrite(); + instance.clearVersion(); + return this; + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setVersionBytes(value); + return this; + } + + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @return The packageName. + */ + @Override + public String getPackageName() { + return instance.getPackageName(); + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @return The bytes for packageName. + */ + @Override + public com.google.protobuf.ByteString + getPackageNameBytes() { + return instance.getPackageNameBytes(); + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @param value The packageName to set. + * @return This builder for chaining. + */ + public Builder setPackageName( + String value) { + copyOnWrite(); + instance.setPackageName(value); + return this; + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @return This builder for chaining. + */ + public Builder clearPackageName() { + copyOnWrite(); + instance.clearPackageName(); + return this; + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @param value The bytes for packageName to set. + * @return This builder for chaining. + */ + public Builder setPackageNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPackageNameBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.proto.App) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new App(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "version_", + "packageName_", + }; + String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\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 (App.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:clickstream.proto.App) + private static final App DEFAULT_INSTANCE; + static { + App defaultInstance = new App(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + App.class, defaultInstance); + } + + public static App getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/app/src/main/java/com/clickstream/app/proto/AppOrBuilder.java b/app/src/main/java/com/clickstream/app/proto/AppOrBuilder.java new file mode 100644 index 00000000..daac8d8d --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/AppOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: App.proto + +package com.clickstream.app.proto; + +public interface AppOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.proto.App) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The version. + */ + String getVersion(); + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The packageName. + */ + String getPackageName(); + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The bytes for packageName. + */ + com.google.protobuf.ByteString + getPackageNameBytes(); +} diff --git a/app/src/main/java/com/clickstream/app/proto/AppProto.java b/app/src/main/java/com/clickstream/app/proto/AppProto.java new file mode 100644 index 00000000..4d2eedd0 --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/AppProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: App.proto + +package com.clickstream.app.proto; + +public final class AppProto { + private AppProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/clickstream/app/proto/Device.java b/app/src/main/java/com/clickstream/app/proto/Device.java new file mode 100644 index 00000000..5db076a4 --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/Device.java @@ -0,0 +1,784 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Device.proto + +package com.clickstream.app.proto; + +/** + *
+ * Corresponds to the device being used by the customer. Holds the respective details for the device under use.
+ * 
+ * + * Protobuf type {@code clickstream.proto.Device} + */ +public final class Device extends + com.google.protobuf.GeneratedMessageLite< + Device, Device.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.proto.Device) + DeviceOrBuilder { + private Device() { + operatingSystem_ = ""; + operatingSystemVersion_ = ""; + deviceMake_ = ""; + deviceModel_ = ""; + } + public static final int OPERATING_SYSTEM_FIELD_NUMBER = 1; + private String operatingSystem_; + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The operatingSystem. + */ + @Override + public String getOperatingSystem() { + return operatingSystem_; + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(operatingSystem_); + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @param value The operatingSystem to set. + */ + private void setOperatingSystem( + String value) { + Class valueClass = value.getClass(); + + operatingSystem_ = value; + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + */ + private void clearOperatingSystem() { + + operatingSystem_ = getDefaultInstance().getOperatingSystem(); + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @param value The bytes for operatingSystem to set. + */ + private void setOperatingSystemBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + operatingSystem_ = value.toStringUtf8(); + + } + + public static final int OPERATING_SYSTEM_VERSION_FIELD_NUMBER = 2; + private String operatingSystemVersion_; + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + @Override + public String getOperatingSystemVersion() { + return operatingSystemVersion_; + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(operatingSystemVersion_); + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @param value The operatingSystemVersion to set. + */ + private void setOperatingSystemVersion( + String value) { + Class valueClass = value.getClass(); + + operatingSystemVersion_ = value; + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + */ + private void clearOperatingSystemVersion() { + + operatingSystemVersion_ = getDefaultInstance().getOperatingSystemVersion(); + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @param value The bytes for operatingSystemVersion to set. + */ + private void setOperatingSystemVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + operatingSystemVersion_ = value.toStringUtf8(); + + } + + public static final int DEVICE_MAKE_FIELD_NUMBER = 3; + private String deviceMake_; + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The deviceMake. + */ + @Override + public String getDeviceMake() { + return deviceMake_; + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The bytes for deviceMake. + */ + @Override + public com.google.protobuf.ByteString + getDeviceMakeBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceMake_); + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @param value The deviceMake to set. + */ + private void setDeviceMake( + String value) { + Class valueClass = value.getClass(); + + deviceMake_ = value; + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + */ + private void clearDeviceMake() { + + deviceMake_ = getDefaultInstance().getDeviceMake(); + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @param value The bytes for deviceMake to set. + */ + private void setDeviceMakeBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceMake_ = value.toStringUtf8(); + + } + + public static final int DEVICE_MODEL_FIELD_NUMBER = 4; + private String deviceModel_; + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The deviceModel. + */ + @Override + public String getDeviceModel() { + return deviceModel_; + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The bytes for deviceModel. + */ + @Override + public com.google.protobuf.ByteString + getDeviceModelBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceModel_); + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @param value The deviceModel to set. + */ + private void setDeviceModel( + String value) { + Class valueClass = value.getClass(); + + deviceModel_ = value; + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + */ + private void clearDeviceModel() { + + deviceModel_ = getDefaultInstance().getDeviceModel(); + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @param value The bytes for deviceModel to set. + */ + private void setDeviceModelBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceModel_ = value.toStringUtf8(); + + } + + public static Device parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Device 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 Device parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Device parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Device parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Device 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(Device prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Corresponds to the device being used by the customer. Holds the respective details for the device under use.
+   * 
+ * + * Protobuf type {@code clickstream.proto.Device} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Device, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.proto.Device) + DeviceOrBuilder { + // Construct using com.clickstream.app.proto.Device.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @return The operatingSystem. + */ + @Override + public String getOperatingSystem() { + return instance.getOperatingSystem(); + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemBytes() { + return instance.getOperatingSystemBytes(); + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @param value The operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystem( + String value) { + copyOnWrite(); + instance.setOperatingSystem(value); + return this; + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @return This builder for chaining. + */ + public Builder clearOperatingSystem() { + copyOnWrite(); + instance.clearOperatingSystem(); + return this; + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @param value The bytes for operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOperatingSystemBytes(value); + return this; + } + + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + @Override + public String getOperatingSystemVersion() { + return instance.getOperatingSystemVersion(); + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemVersionBytes() { + return instance.getOperatingSystemVersionBytes(); + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @param value The operatingSystemVersion to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemVersion( + String value) { + copyOnWrite(); + instance.setOperatingSystemVersion(value); + return this; + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @return This builder for chaining. + */ + public Builder clearOperatingSystemVersion() { + copyOnWrite(); + instance.clearOperatingSystemVersion(); + return this; + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @param value The bytes for operatingSystemVersion to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOperatingSystemVersionBytes(value); + return this; + } + + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @return The deviceMake. + */ + @Override + public String getDeviceMake() { + return instance.getDeviceMake(); + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @return The bytes for deviceMake. + */ + @Override + public com.google.protobuf.ByteString + getDeviceMakeBytes() { + return instance.getDeviceMakeBytes(); + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @param value The deviceMake to set. + * @return This builder for chaining. + */ + public Builder setDeviceMake( + String value) { + copyOnWrite(); + instance.setDeviceMake(value); + return this; + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @return This builder for chaining. + */ + public Builder clearDeviceMake() { + copyOnWrite(); + instance.clearDeviceMake(); + return this; + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @param value The bytes for deviceMake to set. + * @return This builder for chaining. + */ + public Builder setDeviceMakeBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceMakeBytes(value); + return this; + } + + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @return The deviceModel. + */ + @Override + public String getDeviceModel() { + return instance.getDeviceModel(); + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @return The bytes for deviceModel. + */ + @Override + public com.google.protobuf.ByteString + getDeviceModelBytes() { + return instance.getDeviceModelBytes(); + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @param value The deviceModel to set. + * @return This builder for chaining. + */ + public Builder setDeviceModel( + String value) { + copyOnWrite(); + instance.setDeviceModel(value); + return this; + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceModel() { + copyOnWrite(); + instance.clearDeviceModel(); + return this; + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @param value The bytes for deviceModel to set. + * @return This builder for chaining. + */ + public Builder setDeviceModelBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceModelBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.proto.Device) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Device(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "operatingSystem_", + "operatingSystemVersion_", + "deviceMake_", + "deviceModel_", + }; + String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208\u0004\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 (Device.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:clickstream.proto.Device) + private static final Device DEFAULT_INSTANCE; + static { + Device defaultInstance = new Device(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Device.class, defaultInstance); + } + + public static Device getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/app/src/main/java/com/clickstream/app/proto/DeviceOrBuilder.java b/app/src/main/java/com/clickstream/app/proto/DeviceOrBuilder.java new file mode 100644 index 00000000..4d5eb8fe --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/DeviceOrBuilder.java @@ -0,0 +1,97 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Device.proto + +package com.clickstream.app.proto; + +public interface DeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.proto.Device) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The operatingSystem. + */ + String getOperatingSystem(); + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + com.google.protobuf.ByteString + getOperatingSystemBytes(); + + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + String getOperatingSystemVersion(); + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + com.google.protobuf.ByteString + getOperatingSystemVersionBytes(); + + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The deviceMake. + */ + String getDeviceMake(); + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The bytes for deviceMake. + */ + com.google.protobuf.ByteString + getDeviceMakeBytes(); + + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The deviceModel. + */ + String getDeviceModel(); + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The bytes for deviceModel. + */ + com.google.protobuf.ByteString + getDeviceModelBytes(); +} diff --git a/app/src/main/java/com/clickstream/app/proto/DeviceProto.java b/app/src/main/java/com/clickstream/app/proto/DeviceProto.java new file mode 100644 index 00000000..b127f74c --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/DeviceProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Device.proto + +package com.clickstream.app.proto; + +public final class DeviceProto { + private DeviceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/clickstream/app/proto/User.java b/app/src/main/java/com/clickstream/app/proto/User.java new file mode 100644 index 00000000..5512871b --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/User.java @@ -0,0 +1,1316 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package com.clickstream.app.proto; + +/** + *
+ * Corresponds to the details for the user.
+ * 
+ * + * Protobuf type {@code clickstream.proto.User} + */ +public final class User extends + com.google.protobuf.GeneratedMessageLite< + User, User.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.proto.User) + UserOrBuilder { + private User() { + guid_ = ""; + name_ = ""; + gender_ = ""; + email_ = ""; + } + public static final int GUID_FIELD_NUMBER = 1; + private String guid_; + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The guid. + */ + @Override + public String getGuid() { + return guid_; + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The bytes for guid. + */ + @Override + public com.google.protobuf.ByteString + getGuidBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(guid_); + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @param value The guid to set. + */ + private void setGuid( + String value) { + Class valueClass = value.getClass(); + + guid_ = value; + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + */ + private void clearGuid() { + + guid_ = getDefaultInstance().getGuid(); + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @param value The bytes for guid to set. + */ + private void setGuidBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + guid_ = value.toStringUtf8(); + + } + + public static final int NAME_FIELD_NUMBER = 2; + private String name_; + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The name. + */ + @Override + public String getName() { + return name_; + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @Override + public com.google.protobuf.ByteString + getNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(name_); + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @param value The name to set. + */ + private void setName( + String value) { + Class valueClass = value.getClass(); + + name_ = value; + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + */ + private void clearName() { + + name_ = getDefaultInstance().getName(); + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @param value The bytes for name to set. + */ + private void setNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + name_ = value.toStringUtf8(); + + } + + public static final int AGE_FIELD_NUMBER = 3; + private int age_; + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + * @return The age. + */ + @Override + public int getAge() { + return age_; + } + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + * @param value The age to set. + */ + private void setAge(int value) { + + age_ = value; + } + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + */ + private void clearAge() { + + age_ = 0; + } + + public static final int GENDER_FIELD_NUMBER = 4; + private String gender_; + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The gender. + */ + @Override + public String getGender() { + return gender_; + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The bytes for gender. + */ + @Override + public com.google.protobuf.ByteString + getGenderBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(gender_); + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @param value The gender to set. + */ + private void setGender( + String value) { + Class valueClass = value.getClass(); + + gender_ = value; + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + */ + private void clearGender() { + + gender_ = getDefaultInstance().getGender(); + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @param value The bytes for gender to set. + */ + private void setGenderBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + gender_ = value.toStringUtf8(); + + } + + public static final int PHONE_NUMBER_FIELD_NUMBER = 5; + private long phoneNumber_; + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + * @return The phoneNumber. + */ + @Override + public long getPhoneNumber() { + return phoneNumber_; + } + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + * @param value The phoneNumber to set. + */ + private void setPhoneNumber(long value) { + + phoneNumber_ = value; + } + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + */ + private void clearPhoneNumber() { + + phoneNumber_ = 0L; + } + + public static final int EMAIL_FIELD_NUMBER = 6; + private String email_; + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The email. + */ + @Override + public String getEmail() { + return email_; + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The bytes for email. + */ + @Override + public com.google.protobuf.ByteString + getEmailBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(email_); + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @param value The email to set. + */ + private void setEmail( + String value) { + Class valueClass = value.getClass(); + + email_ = value; + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + */ + private void clearEmail() { + + email_ = getDefaultInstance().getEmail(); + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @param value The bytes for email to set. + */ + private void setEmailBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + email_ = value.toStringUtf8(); + + } + + public static final int APP_FIELD_NUMBER = 7; + private App app_; + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public boolean hasApp() { + return app_ != null; + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public App getApp() { + return app_ == null ? App.getDefaultInstance() : app_; + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + private void setApp(App value) { + value.getClass(); + app_ = value; + + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeApp(App value) { + value.getClass(); + if (app_ != null && + app_ != App.getDefaultInstance()) { + app_ = + App.newBuilder(app_).mergeFrom(value).buildPartial(); + } else { + app_ = value; + } + + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + private void clearApp() { app_ = null; + + } + + public static final int DEVICE_FIELD_NUMBER = 8; + private Device device_; + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public boolean hasDevice() { + return device_ != null; + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public Device getDevice() { + return device_ == null ? Device.getDefaultInstance() : device_; + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + private void setDevice(Device value) { + value.getClass(); + device_ = value; + + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeDevice(Device value) { + value.getClass(); + if (device_ != null && + device_ != Device.getDefaultInstance()) { + device_ = + Device.newBuilder(device_).mergeFrom(value).buildPartial(); + } else { + device_ = value; + } + + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + private void clearDevice() { device_ = null; + + } + + public static final int DEVICE_TIMESTAMP_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp deviceTimestamp_; + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public boolean hasDeviceTimestamp() { + return deviceTimestamp_ != null; + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public com.google.protobuf.Timestamp getDeviceTimestamp() { + return deviceTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deviceTimestamp_; + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + private void setDeviceTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + deviceTimestamp_ = value; + + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeDeviceTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (deviceTimestamp_ != null && + deviceTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + deviceTimestamp_ = + com.google.protobuf.Timestamp.newBuilder(deviceTimestamp_).mergeFrom(value).buildPartial(); + } else { + deviceTimestamp_ = value; + } + + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + private void clearDeviceTimestamp() { deviceTimestamp_ = null; + + } + + public static User parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static User 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 User parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static User 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 User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static User 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 User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static User 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 User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static User parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static User parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static User 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(User prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Corresponds to the details for the user.
+   * 
+ * + * Protobuf type {@code clickstream.proto.User} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + User, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.proto.User) + UserOrBuilder { + // Construct using com.clickstream.app.proto.User.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @return The guid. + */ + @Override + public String getGuid() { + return instance.getGuid(); + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @return The bytes for guid. + */ + @Override + public com.google.protobuf.ByteString + getGuidBytes() { + return instance.getGuidBytes(); + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @param value The guid to set. + * @return This builder for chaining. + */ + public Builder setGuid( + String value) { + copyOnWrite(); + instance.setGuid(value); + return this; + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @return This builder for chaining. + */ + public Builder clearGuid() { + copyOnWrite(); + instance.clearGuid(); + return this; + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @param value The bytes for guid to set. + * @return This builder for chaining. + */ + public Builder setGuidBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setGuidBytes(value); + return this; + } + + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @return The name. + */ + @Override + public String getName() { + return instance.getName(); + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @Override + public com.google.protobuf.ByteString + getNameBytes() { + return instance.getNameBytes(); + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + String value) { + copyOnWrite(); + instance.setName(value); + return this; + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + copyOnWrite(); + instance.clearName(); + return this; + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNameBytes(value); + return this; + } + + /** + *
+     * User's age.
+     * 
+ * + * int32 age = 3; + * @return The age. + */ + @Override + public int getAge() { + return instance.getAge(); + } + /** + *
+     * User's age.
+     * 
+ * + * int32 age = 3; + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + copyOnWrite(); + instance.setAge(value); + return this; + } + /** + *
+     * User's age.
+     * 
+ * + * int32 age = 3; + * @return This builder for chaining. + */ + public Builder clearAge() { + copyOnWrite(); + instance.clearAge(); + return this; + } + + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @return The gender. + */ + @Override + public String getGender() { + return instance.getGender(); + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @return The bytes for gender. + */ + @Override + public com.google.protobuf.ByteString + getGenderBytes() { + return instance.getGenderBytes(); + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @param value The gender to set. + * @return This builder for chaining. + */ + public Builder setGender( + String value) { + copyOnWrite(); + instance.setGender(value); + return this; + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @return This builder for chaining. + */ + public Builder clearGender() { + copyOnWrite(); + instance.clearGender(); + return this; + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @param value The bytes for gender to set. + * @return This builder for chaining. + */ + public Builder setGenderBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setGenderBytes(value); + return this; + } + + /** + *
+     * User's phone number.
+     * 
+ * + * int64 phone_number = 5; + * @return The phoneNumber. + */ + @Override + public long getPhoneNumber() { + return instance.getPhoneNumber(); + } + /** + *
+     * User's phone number.
+     * 
+ * + * int64 phone_number = 5; + * @param value The phoneNumber to set. + * @return This builder for chaining. + */ + public Builder setPhoneNumber(long value) { + copyOnWrite(); + instance.setPhoneNumber(value); + return this; + } + /** + *
+     * User's phone number.
+     * 
+ * + * int64 phone_number = 5; + * @return This builder for chaining. + */ + public Builder clearPhoneNumber() { + copyOnWrite(); + instance.clearPhoneNumber(); + return this; + } + + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @return The email. + */ + @Override + public String getEmail() { + return instance.getEmail(); + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @return The bytes for email. + */ + @Override + public com.google.protobuf.ByteString + getEmailBytes() { + return instance.getEmailBytes(); + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail( + String value) { + copyOnWrite(); + instance.setEmail(value); + return this; + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @return This builder for chaining. + */ + public Builder clearEmail() { + copyOnWrite(); + instance.clearEmail(); + return this; + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEmailBytes(value); + return this; + } + + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public boolean hasApp() { + return instance.hasApp(); + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public App getApp() { + return instance.getApp(); + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder setApp(App value) { + copyOnWrite(); + instance.setApp(value); + return this; + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder setApp( + App.Builder builderForValue) { + copyOnWrite(); + instance.setApp(builderForValue.build()); + return this; + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder mergeApp(App value) { + copyOnWrite(); + instance.mergeApp(value); + return this; + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder clearApp() { copyOnWrite(); + instance.clearApp(); + return this; + } + + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public boolean hasDevice() { + return instance.hasDevice(); + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public Device getDevice() { + return instance.getDevice(); + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder setDevice(Device value) { + copyOnWrite(); + instance.setDevice(value); + return this; + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder setDevice( + Device.Builder builderForValue) { + copyOnWrite(); + instance.setDevice(builderForValue.build()); + return this; + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder mergeDevice(Device value) { + copyOnWrite(); + instance.mergeDevice(value); + return this; + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder clearDevice() { copyOnWrite(); + instance.clearDevice(); + return this; + } + + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public boolean hasDeviceTimestamp() { + return instance.hasDeviceTimestamp(); + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public com.google.protobuf.Timestamp getDeviceTimestamp() { + return instance.getDeviceTimestamp(); + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder setDeviceTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setDeviceTimestamp(value); + return this; + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder setDeviceTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setDeviceTimestamp(builderForValue.build()); + return this; + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder mergeDeviceTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeDeviceTimestamp(value); + return this; + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder clearDeviceTimestamp() { copyOnWrite(); + instance.clearDeviceTimestamp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.proto.User) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new User(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "guid_", + "name_", + "age_", + "gender_", + "phoneNumber_", + "email_", + "app_", + "device_", + "deviceTimestamp_", + }; + String info = + "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0000\u0000\u0001\u0208\u0002\u0208\u0003\u0004" + + "\u0004\u0208\u0005\u0002\u0006\u0208\u0007\t\b\t\t\t"; + 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 (User.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:clickstream.proto.User) + private static final User DEFAULT_INSTANCE; + static { + User defaultInstance = new User(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + User.class, defaultInstance); + } + + public static User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/app/src/main/java/com/clickstream/app/proto/UserOrBuilder.java b/app/src/main/java/com/clickstream/app/proto/UserOrBuilder.java new file mode 100644 index 00000000..0eefa6a7 --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/UserOrBuilder.java @@ -0,0 +1,166 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package com.clickstream.app.proto; + +public interface UserOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.proto.User) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The guid. + */ + String getGuid(); + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The bytes for guid. + */ + com.google.protobuf.ByteString + getGuidBytes(); + + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The name. + */ + String getName(); + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + * @return The age. + */ + int getAge(); + + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The gender. + */ + String getGender(); + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The bytes for gender. + */ + com.google.protobuf.ByteString + getGenderBytes(); + + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + * @return The phoneNumber. + */ + long getPhoneNumber(); + + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The email. + */ + String getEmail(); + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The bytes for email. + */ + com.google.protobuf.ByteString + getEmailBytes(); + + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + * @return Whether the app field is set. + */ + boolean hasApp(); + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + * @return The app. + */ + App getApp(); + + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + * @return Whether the device field is set. + */ + boolean hasDevice(); + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + * @return The device. + */ + Device getDevice(); + + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + * @return Whether the deviceTimestamp field is set. + */ + boolean hasDeviceTimestamp(); + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + * @return The deviceTimestamp. + */ + com.google.protobuf.Timestamp getDeviceTimestamp(); +} diff --git a/app/src/main/java/com/clickstream/app/proto/UserProto.java b/app/src/main/java/com/clickstream/app/proto/UserProto.java new file mode 100644 index 00000000..6823c621 --- /dev/null +++ b/app/src/main/java/com/clickstream/app/proto/UserProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package com.clickstream.app.proto; + +public final class UserProto { + private UserProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/clickstream-api/build.gradle.kts b/clickstream-api/build.gradle.kts index f2ac9e6e..5e8c9ef9 100644 --- a/clickstream-api/build.gradle.kts +++ b/clickstream-api/build.gradle.kts @@ -34,7 +34,7 @@ android { dependencies { // Clickstream - compileOnly(files("$rootDir/libs/proto-sdk-1.18.6.jar")) + compileOnly(projects.clickstreamHealthProto) // Common implementation(deps.utils.protoLite) diff --git a/clickstream-api/src/main/kotlin/clickstream/api/CSMetaProvider.kt b/clickstream-api/src/main/kotlin/clickstream/api/CSMetaProvider.kt index 9c56ba6e..12564222 100644 --- a/clickstream-api/src/main/kotlin/clickstream/api/CSMetaProvider.kt +++ b/clickstream-api/src/main/kotlin/clickstream/api/CSMetaProvider.kt @@ -1,10 +1,12 @@ package clickstream.api -import com.gojek.clickstream.internal.HealthMeta.App -import com.gojek.clickstream.internal.HealthMeta.Customer -import com.gojek.clickstream.internal.HealthMeta.Device -import com.gojek.clickstream.internal.HealthMeta.Location -import com.gojek.clickstream.internal.HealthMeta.Session + +import clickstream.health.proto.HealthMeta.Location +import clickstream.health.proto.HealthMeta.Customer +import clickstream.health.proto.HealthMeta.App +import clickstream.health.proto.HealthMeta.Device +import clickstream.health.proto.HealthMeta.Session + /** * This data source is responsible for providing values for those common keys diff --git a/clickstream-health-metrics-api/build.gradle.kts b/clickstream-health-metrics-api/build.gradle.kts index c5de58e5..24ec1893 100644 --- a/clickstream-health-metrics-api/build.gradle.kts +++ b/clickstream-health-metrics-api/build.gradle.kts @@ -34,7 +34,7 @@ android { dependencies { // Clickstream - compileOnly(files("$rootDir/libs/proto-sdk-1.18.6.jar")) + compileOnly(projects.clickstreamHealthProto) implementation(deps.android.core.annotation) } diff --git a/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventFactory.kt b/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventFactory.kt index 3199b444..c24fcb89 100644 --- a/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventFactory.kt +++ b/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventFactory.kt @@ -1,7 +1,7 @@ package clickstream.health.intermediate import androidx.annotation.RestrictTo -import com.gojek.clickstream.internal.Health +import clickstream.health.proto.Health /** * This is responsible for creating an event object in proto format when provided with user-generated, diff --git a/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventProcessor.kt b/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventProcessor.kt index 0160ba13..f0caa466 100644 --- a/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventProcessor.kt +++ b/clickstream-health-metrics-api/src/main/kotlin/clickstream/health/intermediate/CSHealthEventProcessor.kt @@ -1,7 +1,7 @@ package clickstream.health.intermediate import androidx.annotation.RestrictTo -import com.gojek.clickstream.internal.Health +import clickstream.health.proto.Health /** * [CSHealthEventProcessor] is the Heart of the Clickstream Library. The [CSHealthEventProcessor] diff --git a/clickstream-health-metrics-noop/build.gradle.kts b/clickstream-health-metrics-noop/build.gradle.kts index 76427073..85a1add4 100644 --- a/clickstream-health-metrics-noop/build.gradle.kts +++ b/clickstream-health-metrics-noop/build.gradle.kts @@ -34,7 +34,7 @@ android { dependencies { // Clickstream - compileOnly(files("$rootDir/libs/proto-sdk-1.18.6.jar")) + compileOnly(projects.clickstreamHealthProto) api(projects.clickstreamHealthMetricsApi) api(projects.clickstreamApi) api(projects.clickstreamLifecycle) diff --git a/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventFactory.kt b/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventFactory.kt index 1c1aab6e..ca2f54bd 100644 --- a/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventFactory.kt +++ b/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventFactory.kt @@ -1,7 +1,7 @@ package clickstream.health.internal import clickstream.health.intermediate.CSHealthEventFactory -import com.gojek.clickstream.internal.Health +import clickstream.health.proto.Health internal class NoOpCSHealthEventFactory : CSHealthEventFactory { override suspend fun create(message: Health): Health { diff --git a/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventProcessor.kt b/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventProcessor.kt index 9e4674c3..6d1c6396 100644 --- a/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventProcessor.kt +++ b/clickstream-health-metrics-noop/src/main/kotlin/clickstream/health/internal/NoOpCSHealthEventProcessor.kt @@ -1,7 +1,7 @@ package clickstream.health.internal import clickstream.health.intermediate.CSHealthEventProcessor -import com.gojek.clickstream.internal.Health +import clickstream.health.proto.Health internal class NoOpCSHealthEventProcessor : CSHealthEventProcessor { override suspend fun getAggregateEvents(): List { diff --git a/clickstream-health-metrics/build.gradle.kts b/clickstream-health-metrics/build.gradle.kts index 7587dbcc..6017439e 100644 --- a/clickstream-health-metrics/build.gradle.kts +++ b/clickstream-health-metrics/build.gradle.kts @@ -34,7 +34,7 @@ android { dependencies { // Clickstream - compileOnly(files("$rootDir/libs/proto-sdk-1.18.6.jar")) + compileOnly(projects.clickstreamHealthProto) compileOnly(projects.clickstreamLogger) api(projects.clickstreamHealthMetricsApi) api(projects.clickstreamApi) diff --git a/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventFactory.kt b/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventFactory.kt index 27be101e..15003d3d 100644 --- a/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventFactory.kt +++ b/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventFactory.kt @@ -5,8 +5,8 @@ import clickstream.api.CSMetaProvider import clickstream.health.time.CSTimeStampGenerator import clickstream.health.identity.CSGuIdGenerator import clickstream.health.intermediate.CSHealthEventFactory -import com.gojek.clickstream.internal.Health -import com.gojek.clickstream.internal.HealthMeta +import clickstream.health.proto.Health +import clickstream.health.proto.HealthMeta /** * This is the implementation of [CSHealthEventFactory] diff --git a/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessor.kt b/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessor.kt index a96d380f..77de6533 100644 --- a/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessor.kt +++ b/clickstream-health-metrics/src/main/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessor.kt @@ -9,14 +9,12 @@ import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.internal.CSHealthEventEntity.Companion.dtosMapTo import clickstream.health.model.CSHealthEventConfig import clickstream.health.model.CSHealthEventDTO +import clickstream.health.proto.Health +import clickstream.health.proto.HealthDetails import clickstream.lifecycle.CSAppLifeCycle import clickstream.lifecycle.CSLifeCycleManager import clickstream.logger.CSLogger import clickstream.util.CSAppVersionSharedPref -import com.gojek.clickstream.internal.ErrorDetails -import com.gojek.clickstream.internal.Health -import com.gojek.clickstream.internal.HealthDetails -import com.gojek.clickstream.internal.TraceDetails import com.google.protobuf.Timestamp import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope @@ -116,16 +114,6 @@ public class DefaultCSHealthEventProcessor( .addEventBatchGuids(event.eventBatchGuid) .build() ) - .setTraceDetails( - TraceDetails.newBuilder() - .setTimeToConnection(event.timeToConnection.toString()) - .setErrorDetails( - ErrorDetails.newBuilder() - .setReason(event.error) - .build() - ) - .build() - ) .build() logger.debug { "DefaultCSHealthEventProcessor#getInstantEvents : Health Events $health" } healthEventFactory.create(health) diff --git a/clickstream-health-proto/.gitignore b/clickstream-health-proto/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/clickstream-health-proto/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/clickstream-health-proto/build.gradle.kts b/clickstream-health-proto/build.gradle.kts new file mode 100644 index 00000000..6e258f7a --- /dev/null +++ b/clickstream-health-proto/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("java-library") + id("org.jetbrains.kotlin.jvm") +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 +} + +dependencies { + // Proto + api(deps.utils.protoLite) +} \ No newline at end of file diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/Health.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/Health.java new file mode 100644 index 00000000..d1ba9ae6 --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/Health.java @@ -0,0 +1,988 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Health.proto + +package clickstream.health.proto; + +/** + * Protobuf type {@code clickstream.health.proto.Health} + */ +public final class Health extends + com.google.protobuf.GeneratedMessageLite< + Health, Health.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.Health) + HealthOrBuilder { + private Health() { + eventName_ = ""; + } + public static final int EVENT_NAME_FIELD_NUMBER = 1; + private String eventName_; + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + * @return The eventName. + */ + @Override + public String getEventName() { + return eventName_; + } + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + * @return The bytes for eventName. + */ + @Override + public com.google.protobuf.ByteString + getEventNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(eventName_); + } + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + * @param value The eventName to set. + */ + private void setEventName( + String value) { + Class valueClass = value.getClass(); + + eventName_ = value; + } + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + */ + private void clearEventName() { + + eventName_ = getDefaultInstance().getEventName(); + } + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + * @param value The bytes for eventName to set. + */ + private void setEventNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + eventName_ = value.toStringUtf8(); + + } + + public static final int HEALTHDETAILS_FIELD_NUMBER = 2; + private HealthDetails healthDetails_; + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + @Override + public boolean hasHealthDetails() { + return healthDetails_ != null; + } + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + @Override + public HealthDetails getHealthDetails() { + return healthDetails_ == null ? HealthDetails.getDefaultInstance() : healthDetails_; + } + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + private void setHealthDetails(HealthDetails value) { + value.getClass(); + healthDetails_ = value; + + } + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeHealthDetails(HealthDetails value) { + value.getClass(); + if (healthDetails_ != null && + healthDetails_ != HealthDetails.getDefaultInstance()) { + healthDetails_ = + HealthDetails.newBuilder(healthDetails_).mergeFrom(value).buildPartial(); + } else { + healthDetails_ = value; + } + + } + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + private void clearHealthDetails() { healthDetails_ = null; + + } + + public static final int NUMBER_OF_EVENTS_FIELD_NUMBER = 3; + private long numberOfEvents_; + /** + *
+   * Number of events tracked.
+   * 
+ * + * int64 number_of_events = 3; + * @return The numberOfEvents. + */ + @Override + public long getNumberOfEvents() { + return numberOfEvents_; + } + /** + *
+   * Number of events tracked.
+   * 
+ * + * int64 number_of_events = 3; + * @param value The numberOfEvents to set. + */ + private void setNumberOfEvents(long value) { + + numberOfEvents_ = value; + } + /** + *
+   * Number of events tracked.
+   * 
+ * + * int64 number_of_events = 3; + */ + private void clearNumberOfEvents() { + + numberOfEvents_ = 0L; + } + + public static final int NUMBER_OF_BATCHES_FIELD_NUMBER = 4; + private long numberOfBatches_; + /** + *
+   * Number of event batches tracked.
+   * 
+ * + * int64 number_of_batches = 4; + * @return The numberOfBatches. + */ + @Override + public long getNumberOfBatches() { + return numberOfBatches_; + } + /** + *
+   * Number of event batches tracked.
+   * 
+ * + * int64 number_of_batches = 4; + * @param value The numberOfBatches to set. + */ + private void setNumberOfBatches(long value) { + + numberOfBatches_ = value; + } + /** + *
+   * Number of event batches tracked.
+   * 
+ * + * int64 number_of_batches = 4; + */ + private void clearNumberOfBatches() { + + numberOfBatches_ = 0L; + } + + public static final int EVENT_TIMESTAMP_FIELD_NUMBER = 101; + private com.google.protobuf.Timestamp eventTimestamp_; + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + @Override + public boolean hasEventTimestamp() { + return eventTimestamp_ != null; + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + @Override + public com.google.protobuf.Timestamp getEventTimestamp() { + return eventTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTimestamp_; + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + private void setEventTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + eventTimestamp_ = value; + + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeEventTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (eventTimestamp_ != null && + eventTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + eventTimestamp_ = + com.google.protobuf.Timestamp.newBuilder(eventTimestamp_).mergeFrom(value).buildPartial(); + } else { + eventTimestamp_ = value; + } + + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + private void clearEventTimestamp() { eventTimestamp_ = null; + + } + + public static final int HEALTHMETA_FIELD_NUMBER = 103; + private HealthMeta healthMeta_; + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + @Override + public boolean hasHealthMeta() { + return healthMeta_ != null; + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + @Override + public HealthMeta getHealthMeta() { + return healthMeta_ == null ? HealthMeta.getDefaultInstance() : healthMeta_; + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + private void setHealthMeta(HealthMeta value) { + value.getClass(); + healthMeta_ = value; + + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeHealthMeta(HealthMeta value) { + value.getClass(); + if (healthMeta_ != null && + healthMeta_ != HealthMeta.getDefaultInstance()) { + healthMeta_ = + HealthMeta.newBuilder(healthMeta_).mergeFrom(value).buildPartial(); + } else { + healthMeta_ = value; + } + + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + private void clearHealthMeta() { healthMeta_ = null; + + } + + public static final int DEVICE_TIMESTAMP_FIELD_NUMBER = 104; + private com.google.protobuf.Timestamp deviceTimestamp_; + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + @Override + public boolean hasDeviceTimestamp() { + return deviceTimestamp_ != null; + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + @Override + public com.google.protobuf.Timestamp getDeviceTimestamp() { + return deviceTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deviceTimestamp_; + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + private void setDeviceTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + deviceTimestamp_ = value; + + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeDeviceTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (deviceTimestamp_ != null && + deviceTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + deviceTimestamp_ = + com.google.protobuf.Timestamp.newBuilder(deviceTimestamp_).mergeFrom(value).buildPartial(); + } else { + deviceTimestamp_ = value; + } + + } + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + private void clearDeviceTimestamp() { deviceTimestamp_ = null; + + } + + public static Health parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Health 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 Health parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Health 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 Health parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Health 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 Health parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Health 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 Health parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Health parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Health parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Health 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(Health prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.Health} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Health, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.Health) + HealthOrBuilder { + // Construct using clickstream.health.proto.Health.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Name of the health event.
+     * 
+ * + * string event_name = 1; + * @return The eventName. + */ + @Override + public String getEventName() { + return instance.getEventName(); + } + /** + *
+     * Name of the health event.
+     * 
+ * + * string event_name = 1; + * @return The bytes for eventName. + */ + @Override + public com.google.protobuf.ByteString + getEventNameBytes() { + return instance.getEventNameBytes(); + } + /** + *
+     * Name of the health event.
+     * 
+ * + * string event_name = 1; + * @param value The eventName to set. + * @return This builder for chaining. + */ + public Builder setEventName( + String value) { + copyOnWrite(); + instance.setEventName(value); + return this; + } + /** + *
+     * Name of the health event.
+     * 
+ * + * string event_name = 1; + * @return This builder for chaining. + */ + public Builder clearEventName() { + copyOnWrite(); + instance.clearEventName(); + return this; + } + /** + *
+     * Name of the health event.
+     * 
+ * + * string event_name = 1; + * @param value The bytes for eventName to set. + * @return This builder for chaining. + */ + public Builder setEventNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEventNameBytes(value); + return this; + } + + /** + *
+     * Health details, captured by the SDK when the mode is verbose.
+     * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + @Override + public boolean hasHealthDetails() { + return instance.hasHealthDetails(); + } + /** + *
+     * Health details, captured by the SDK when the mode is verbose.
+     * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + @Override + public HealthDetails getHealthDetails() { + return instance.getHealthDetails(); + } + /** + *
+     * Health details, captured by the SDK when the mode is verbose.
+     * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + public Builder setHealthDetails(HealthDetails value) { + copyOnWrite(); + instance.setHealthDetails(value); + return this; + } + /** + *
+     * Health details, captured by the SDK when the mode is verbose.
+     * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + public Builder setHealthDetails( + HealthDetails.Builder builderForValue) { + copyOnWrite(); + instance.setHealthDetails(builderForValue.build()); + return this; + } + /** + *
+     * Health details, captured by the SDK when the mode is verbose.
+     * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + public Builder mergeHealthDetails(HealthDetails value) { + copyOnWrite(); + instance.mergeHealthDetails(value); + return this; + } + /** + *
+     * Health details, captured by the SDK when the mode is verbose.
+     * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + */ + public Builder clearHealthDetails() { copyOnWrite(); + instance.clearHealthDetails(); + return this; + } + + /** + *
+     * Number of events tracked.
+     * 
+ * + * int64 number_of_events = 3; + * @return The numberOfEvents. + */ + @Override + public long getNumberOfEvents() { + return instance.getNumberOfEvents(); + } + /** + *
+     * Number of events tracked.
+     * 
+ * + * int64 number_of_events = 3; + * @param value The numberOfEvents to set. + * @return This builder for chaining. + */ + public Builder setNumberOfEvents(long value) { + copyOnWrite(); + instance.setNumberOfEvents(value); + return this; + } + /** + *
+     * Number of events tracked.
+     * 
+ * + * int64 number_of_events = 3; + * @return This builder for chaining. + */ + public Builder clearNumberOfEvents() { + copyOnWrite(); + instance.clearNumberOfEvents(); + return this; + } + + /** + *
+     * Number of event batches tracked.
+     * 
+ * + * int64 number_of_batches = 4; + * @return The numberOfBatches. + */ + @Override + public long getNumberOfBatches() { + return instance.getNumberOfBatches(); + } + /** + *
+     * Number of event batches tracked.
+     * 
+ * + * int64 number_of_batches = 4; + * @param value The numberOfBatches to set. + * @return This builder for chaining. + */ + public Builder setNumberOfBatches(long value) { + copyOnWrite(); + instance.setNumberOfBatches(value); + return this; + } + /** + *
+     * Number of event batches tracked.
+     * 
+ * + * int64 number_of_batches = 4; + * @return This builder for chaining. + */ + public Builder clearNumberOfBatches() { + copyOnWrite(); + instance.clearNumberOfBatches(); + return this; + } + + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + @Override + public boolean hasEventTimestamp() { + return instance.hasEventTimestamp(); + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + @Override + public com.google.protobuf.Timestamp getEventTimestamp() { + return instance.getEventTimestamp(); + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + public Builder setEventTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setEventTimestamp(value); + return this; + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + public Builder setEventTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setEventTimestamp(builderForValue.build()); + return this; + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + public Builder mergeEventTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeEventTimestamp(value); + return this; + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + */ + public Builder clearEventTimestamp() { copyOnWrite(); + instance.clearEventTimestamp(); + return this; + } + + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + @Override + public boolean hasHealthMeta() { + return instance.hasHealthMeta(); + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + @Override + public HealthMeta getHealthMeta() { + return instance.getHealthMeta(); + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + public Builder setHealthMeta(HealthMeta value) { + copyOnWrite(); + instance.setHealthMeta(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + public Builder setHealthMeta( + HealthMeta.Builder builderForValue) { + copyOnWrite(); + instance.setHealthMeta(builderForValue.build()); + return this; + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + public Builder mergeHealthMeta(HealthMeta value) { + copyOnWrite(); + instance.mergeHealthMeta(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + */ + public Builder clearHealthMeta() { copyOnWrite(); + instance.clearHealthMeta(); + return this; + } + + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + @Override + public boolean hasDeviceTimestamp() { + return instance.hasDeviceTimestamp(); + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + @Override + public com.google.protobuf.Timestamp getDeviceTimestamp() { + return instance.getDeviceTimestamp(); + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + public Builder setDeviceTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setDeviceTimestamp(value); + return this; + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + public Builder setDeviceTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setDeviceTimestamp(builderForValue.build()); + return this; + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + public Builder mergeDeviceTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeDeviceTimestamp(value); + return this; + } + /** + *
+     * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + */ + public Builder clearDeviceTimestamp() { copyOnWrite(); + instance.clearDeviceTimestamp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.Health) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Health(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "eventName_", + "healthDetails_", + "numberOfEvents_", + "numberOfBatches_", + "eventTimestamp_", + "healthMeta_", + "deviceTimestamp_", + }; + String info = + "\u0000\u0007\u0000\u0000\u0001h\u0007\u0000\u0000\u0000\u0001\u0208\u0002\t\u0003" + + "\u0002\u0004\u0002e\tg\th\t"; + 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 (Health.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:clickstream.health.proto.Health) + private static final Health DEFAULT_INSTANCE; + static { + Health defaultInstance = new Health(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Health.class, defaultInstance); + } + + public static Health getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthDetails.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthDetails.java new file mode 100644 index 00000000..e0fa20fe --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthDetails.java @@ -0,0 +1,702 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Health.proto + +package clickstream.health.proto; + +/** + * Protobuf type {@code clickstream.health.proto.HealthDetails} + */ +public final class HealthDetails extends + com.google.protobuf.GeneratedMessageLite< + HealthDetails, HealthDetails.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthDetails) + HealthDetailsOrBuilder { + private HealthDetails() { + eventGuids_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + eventBatchGuids_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int EVENT_GUIDS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList eventGuids_; + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @return A list containing the eventGuids. + */ + @Override + public java.util.List getEventGuidsList() { + return eventGuids_; + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @return The count of eventGuids. + */ + @Override + public int getEventGuidsCount() { + return eventGuids_.size(); + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param index The index of the element to return. + * @return The eventGuids at the given index. + */ + @Override + public String getEventGuids(int index) { + return eventGuids_.get(index); + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param index The index of the value to return. + * @return The bytes of the eventGuids at the given index. + */ + @Override + public com.google.protobuf.ByteString + getEventGuidsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + eventGuids_.get(index)); + } + private void ensureEventGuidsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + eventGuids_; if (!tmp.isModifiable()) { + eventGuids_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param index The index to set the value at. + * @param value The eventGuids to set. + */ + private void setEventGuids( + int index, String value) { + Class valueClass = value.getClass(); + ensureEventGuidsIsMutable(); + eventGuids_.set(index, value); + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param value The eventGuids to add. + */ + private void addEventGuids( + String value) { + Class valueClass = value.getClass(); + ensureEventGuidsIsMutable(); + eventGuids_.add(value); + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param values The eventGuids to add. + */ + private void addAllEventGuids( + Iterable values) { + ensureEventGuidsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, eventGuids_); + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + */ + private void clearEventGuids() { + eventGuids_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param value The bytes of the eventGuids to add. + */ + private void addEventGuidsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureEventGuidsIsMutable(); + eventGuids_.add(value.toStringUtf8()); + } + + public static final int EVENT_BATCH_GUIDS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList eventBatchGuids_; + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @return A list containing the eventBatchGuids. + */ + @Override + public java.util.List getEventBatchGuidsList() { + return eventBatchGuids_; + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @return The count of eventBatchGuids. + */ + @Override + public int getEventBatchGuidsCount() { + return eventBatchGuids_.size(); + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index of the element to return. + * @return The eventBatchGuids at the given index. + */ + @Override + public String getEventBatchGuids(int index) { + return eventBatchGuids_.get(index); + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index of the value to return. + * @return The bytes of the eventBatchGuids at the given index. + */ + @Override + public com.google.protobuf.ByteString + getEventBatchGuidsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + eventBatchGuids_.get(index)); + } + private void ensureEventBatchGuidsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + eventBatchGuids_; if (!tmp.isModifiable()) { + eventBatchGuids_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index to set the value at. + * @param value The eventBatchGuids to set. + */ + private void setEventBatchGuids( + int index, String value) { + Class valueClass = value.getClass(); + ensureEventBatchGuidsIsMutable(); + eventBatchGuids_.set(index, value); + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param value The eventBatchGuids to add. + */ + private void addEventBatchGuids( + String value) { + Class valueClass = value.getClass(); + ensureEventBatchGuidsIsMutable(); + eventBatchGuids_.add(value); + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param values The eventBatchGuids to add. + */ + private void addAllEventBatchGuids( + Iterable values) { + ensureEventBatchGuidsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, eventBatchGuids_); + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + */ + private void clearEventBatchGuids() { + eventBatchGuids_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param value The bytes of the eventBatchGuids to add. + */ + private void addEventBatchGuidsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureEventBatchGuidsIsMutable(); + eventBatchGuids_.add(value.toStringUtf8()); + } + + public static HealthDetails parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static HealthDetails 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 HealthDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static HealthDetails 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 HealthDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static HealthDetails 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 HealthDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static HealthDetails 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 HealthDetails parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static HealthDetails parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static HealthDetails parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static HealthDetails 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(HealthDetails prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthDetails} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + HealthDetails, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthDetails) + HealthDetailsOrBuilder { + // Construct using clickstream.health.proto.HealthDetails.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @return A list containing the eventGuids. + */ + @Override + public java.util.List + getEventGuidsList() { + return java.util.Collections.unmodifiableList( + instance.getEventGuidsList()); + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @return The count of eventGuids. + */ + @Override + public int getEventGuidsCount() { + return instance.getEventGuidsCount(); + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @param index The index of the element to return. + * @return The eventGuids at the given index. + */ + @Override + public String getEventGuids(int index) { + return instance.getEventGuids(index); + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @param index The index of the value to return. + * @return The bytes of the eventGuids at the given index. + */ + @Override + public com.google.protobuf.ByteString + getEventGuidsBytes(int index) { + return instance.getEventGuidsBytes(index); + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @param index The index to set the value at. + * @param value The eventGuids to set. + * @return This builder for chaining. + */ + public Builder setEventGuids( + int index, String value) { + copyOnWrite(); + instance.setEventGuids(index, value); + return this; + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @param value The eventGuids to add. + * @return This builder for chaining. + */ + public Builder addEventGuids( + String value) { + copyOnWrite(); + instance.addEventGuids(value); + return this; + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @param values The eventGuids to add. + * @return This builder for chaining. + */ + public Builder addAllEventGuids( + Iterable values) { + copyOnWrite(); + instance.addAllEventGuids(values); + return this; + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @return This builder for chaining. + */ + public Builder clearEventGuids() { + copyOnWrite(); + instance.clearEventGuids(); + return this; + } + /** + *
+     * Array of event guids.
+     * 
+ * + * repeated string event_guids = 1; + * @param value The bytes of the eventGuids to add. + * @return This builder for chaining. + */ + public Builder addEventGuidsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addEventGuidsBytes(value); + return this; + } + + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @return A list containing the eventBatchGuids. + */ + @Override + public java.util.List + getEventBatchGuidsList() { + return java.util.Collections.unmodifiableList( + instance.getEventBatchGuidsList()); + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @return The count of eventBatchGuids. + */ + @Override + public int getEventBatchGuidsCount() { + return instance.getEventBatchGuidsCount(); + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index of the element to return. + * @return The eventBatchGuids at the given index. + */ + @Override + public String getEventBatchGuids(int index) { + return instance.getEventBatchGuids(index); + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index of the value to return. + * @return The bytes of the eventBatchGuids at the given index. + */ + @Override + public com.google.protobuf.ByteString + getEventBatchGuidsBytes(int index) { + return instance.getEventBatchGuidsBytes(index); + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index to set the value at. + * @param value The eventBatchGuids to set. + * @return This builder for chaining. + */ + public Builder setEventBatchGuids( + int index, String value) { + copyOnWrite(); + instance.setEventBatchGuids(index, value); + return this; + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @param value The eventBatchGuids to add. + * @return This builder for chaining. + */ + public Builder addEventBatchGuids( + String value) { + copyOnWrite(); + instance.addEventBatchGuids(value); + return this; + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @param values The eventBatchGuids to add. + * @return This builder for chaining. + */ + public Builder addAllEventBatchGuids( + Iterable values) { + copyOnWrite(); + instance.addAllEventBatchGuids(values); + return this; + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @return This builder for chaining. + */ + public Builder clearEventBatchGuids() { + copyOnWrite(); + instance.clearEventBatchGuids(); + return this; + } + /** + *
+     * Array of event batch guids.
+     * 
+ * + * repeated string event_batch_guids = 2; + * @param value The bytes of the eventBatchGuids to add. + * @return This builder for chaining. + */ + public Builder addEventBatchGuidsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addEventBatchGuidsBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthDetails) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new HealthDetails(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "eventGuids_", + "eventBatchGuids_", + }; + String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0002\u0000\u0001\u021a\u0002\u021a" + + ""; + 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 (HealthDetails.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:clickstream.health.proto.HealthDetails) + private static final HealthDetails DEFAULT_INSTANCE; + static { + HealthDetails defaultInstance = new HealthDetails(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + HealthDetails.class, defaultInstance); + } + + public static HealthDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthDetailsOrBuilder.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthDetailsOrBuilder.java new file mode 100644 index 00000000..67d1d170 --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthDetailsOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Health.proto + +package clickstream.health.proto; + +public interface HealthDetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthDetails) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @return A list containing the eventGuids. + */ + java.util.List + getEventGuidsList(); + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @return The count of eventGuids. + */ + int getEventGuidsCount(); + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param index The index of the element to return. + * @return The eventGuids at the given index. + */ + String getEventGuids(int index); + /** + *
+   * Array of event guids.
+   * 
+ * + * repeated string event_guids = 1; + * @param index The index of the element to return. + * @return The eventGuids at the given index. + */ + com.google.protobuf.ByteString + getEventGuidsBytes(int index); + + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @return A list containing the eventBatchGuids. + */ + java.util.List + getEventBatchGuidsList(); + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @return The count of eventBatchGuids. + */ + int getEventBatchGuidsCount(); + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index of the element to return. + * @return The eventBatchGuids at the given index. + */ + String getEventBatchGuids(int index); + /** + *
+   * Array of event batch guids.
+   * 
+ * + * repeated string event_batch_guids = 2; + * @param index The index of the element to return. + * @return The eventBatchGuids at the given index. + */ + com.google.protobuf.ByteString + getEventBatchGuidsBytes(int index); +} diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMeta.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMeta.java new file mode 100644 index 00000000..7e6112aa --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMeta.java @@ -0,0 +1,2838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HealthMeta.proto + +package clickstream.health.proto; + +/** + * Protobuf type {@code clickstream.health.proto.HealthMeta} + */ +public final class HealthMeta extends + com.google.protobuf.GeneratedMessageLite< + HealthMeta, HealthMeta.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthMeta) + HealthMetaOrBuilder { + private HealthMeta() { + eventGuid_ = ""; + } + public interface AppOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthMeta.App) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string version = 1; + * @return The version. + */ + String getVersion(); + /** + * string version = 1; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + } + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.App} + */ + public static final class App extends + com.google.protobuf.GeneratedMessageLite< + App, App.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthMeta.App) + AppOrBuilder { + private App() { + version_ = ""; + } + public static final int VERSION_FIELD_NUMBER = 1; + private String version_; + /** + * string version = 1; + * @return The version. + */ + @Override + public String getVersion() { + return version_; + } + /** + * string version = 1; + * @return The bytes for version. + */ + @Override + public com.google.protobuf.ByteString + getVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(version_); + } + /** + * string version = 1; + * @param value The version to set. + */ + private void setVersion( + String value) { + Class valueClass = value.getClass(); + + version_ = value; + } + /** + * string version = 1; + */ + private void clearVersion() { + + version_ = getDefaultInstance().getVersion(); + } + /** + * string version = 1; + * @param value The bytes for version to set. + */ + private void setVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + version_ = value.toStringUtf8(); + + } + + public static App parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static App 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 App parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static App parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static App parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static App 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(App prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.App} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + App, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthMeta.App) + AppOrBuilder { + // Construct using clickstream.health.proto.HealthMeta.App.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string version = 1; + * @return The version. + */ + @Override + public String getVersion() { + return instance.getVersion(); + } + /** + * string version = 1; + * @return The bytes for version. + */ + @Override + public com.google.protobuf.ByteString + getVersionBytes() { + return instance.getVersionBytes(); + } + /** + * string version = 1; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + String value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + * string version = 1; + * @return This builder for chaining. + */ + public Builder clearVersion() { + copyOnWrite(); + instance.clearVersion(); + return this; + } + /** + * string version = 1; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setVersionBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthMeta.App) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new App(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "version_", + }; + 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 (App.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:clickstream.health.proto.HealthMeta.App) + private static final App DEFAULT_INSTANCE; + static { + App defaultInstance = new App(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + App.class, defaultInstance); + } + + public static App 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 CustomerOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthMeta.Customer) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string signed_up_country = 1; + * @return The signedUpCountry. + */ + String getSignedUpCountry(); + /** + * string signed_up_country = 1; + * @return The bytes for signedUpCountry. + */ + com.google.protobuf.ByteString + getSignedUpCountryBytes(); + + /** + * string current_country = 2; + * @return The currentCountry. + */ + String getCurrentCountry(); + /** + * string current_country = 2; + * @return The bytes for currentCountry. + */ + com.google.protobuf.ByteString + getCurrentCountryBytes(); + + /** + * int32 identity = 3; + * @return The identity. + */ + int getIdentity(); + + /** + * string email = 4; + * @return The email. + */ + String getEmail(); + /** + * string email = 4; + * @return The bytes for email. + */ + com.google.protobuf.ByteString + getEmailBytes(); + } + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Customer} + */ + public static final class Customer extends + com.google.protobuf.GeneratedMessageLite< + Customer, Customer.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthMeta.Customer) + CustomerOrBuilder { + private Customer() { + signedUpCountry_ = ""; + currentCountry_ = ""; + email_ = ""; + } + public static final int SIGNED_UP_COUNTRY_FIELD_NUMBER = 1; + private String signedUpCountry_; + /** + * string signed_up_country = 1; + * @return The signedUpCountry. + */ + @Override + public String getSignedUpCountry() { + return signedUpCountry_; + } + /** + * string signed_up_country = 1; + * @return The bytes for signedUpCountry. + */ + @Override + public com.google.protobuf.ByteString + getSignedUpCountryBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(signedUpCountry_); + } + /** + * string signed_up_country = 1; + * @param value The signedUpCountry to set. + */ + private void setSignedUpCountry( + String value) { + Class valueClass = value.getClass(); + + signedUpCountry_ = value; + } + /** + * string signed_up_country = 1; + */ + private void clearSignedUpCountry() { + + signedUpCountry_ = getDefaultInstance().getSignedUpCountry(); + } + /** + * string signed_up_country = 1; + * @param value The bytes for signedUpCountry to set. + */ + private void setSignedUpCountryBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + signedUpCountry_ = value.toStringUtf8(); + + } + + public static final int CURRENT_COUNTRY_FIELD_NUMBER = 2; + private String currentCountry_; + /** + * string current_country = 2; + * @return The currentCountry. + */ + @Override + public String getCurrentCountry() { + return currentCountry_; + } + /** + * string current_country = 2; + * @return The bytes for currentCountry. + */ + @Override + public com.google.protobuf.ByteString + getCurrentCountryBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(currentCountry_); + } + /** + * string current_country = 2; + * @param value The currentCountry to set. + */ + private void setCurrentCountry( + String value) { + Class valueClass = value.getClass(); + + currentCountry_ = value; + } + /** + * string current_country = 2; + */ + private void clearCurrentCountry() { + + currentCountry_ = getDefaultInstance().getCurrentCountry(); + } + /** + * string current_country = 2; + * @param value The bytes for currentCountry to set. + */ + private void setCurrentCountryBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + currentCountry_ = value.toStringUtf8(); + + } + + public static final int IDENTITY_FIELD_NUMBER = 3; + private int identity_; + /** + * int32 identity = 3; + * @return The identity. + */ + @Override + public int getIdentity() { + return identity_; + } + /** + * int32 identity = 3; + * @param value The identity to set. + */ + private void setIdentity(int value) { + + identity_ = value; + } + /** + * int32 identity = 3; + */ + private void clearIdentity() { + + identity_ = 0; + } + + public static final int EMAIL_FIELD_NUMBER = 4; + private String email_; + /** + * string email = 4; + * @return The email. + */ + @Override + public String getEmail() { + return email_; + } + /** + * string email = 4; + * @return The bytes for email. + */ + @Override + public com.google.protobuf.ByteString + getEmailBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(email_); + } + /** + * string email = 4; + * @param value The email to set. + */ + private void setEmail( + String value) { + Class valueClass = value.getClass(); + + email_ = value; + } + /** + * string email = 4; + */ + private void clearEmail() { + + email_ = getDefaultInstance().getEmail(); + } + /** + * string email = 4; + * @param value The bytes for email to set. + */ + private void setEmailBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + email_ = value.toStringUtf8(); + + } + + public static Customer parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Customer 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 Customer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Customer 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 Customer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Customer 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 Customer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Customer 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 Customer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Customer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Customer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Customer 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(Customer prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Customer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Customer, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthMeta.Customer) + CustomerOrBuilder { + // Construct using clickstream.health.proto.HealthMeta.Customer.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string signed_up_country = 1; + * @return The signedUpCountry. + */ + @Override + public String getSignedUpCountry() { + return instance.getSignedUpCountry(); + } + /** + * string signed_up_country = 1; + * @return The bytes for signedUpCountry. + */ + @Override + public com.google.protobuf.ByteString + getSignedUpCountryBytes() { + return instance.getSignedUpCountryBytes(); + } + /** + * string signed_up_country = 1; + * @param value The signedUpCountry to set. + * @return This builder for chaining. + */ + public Builder setSignedUpCountry( + String value) { + copyOnWrite(); + instance.setSignedUpCountry(value); + return this; + } + /** + * string signed_up_country = 1; + * @return This builder for chaining. + */ + public Builder clearSignedUpCountry() { + copyOnWrite(); + instance.clearSignedUpCountry(); + return this; + } + /** + * string signed_up_country = 1; + * @param value The bytes for signedUpCountry to set. + * @return This builder for chaining. + */ + public Builder setSignedUpCountryBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignedUpCountryBytes(value); + return this; + } + + /** + * string current_country = 2; + * @return The currentCountry. + */ + @Override + public String getCurrentCountry() { + return instance.getCurrentCountry(); + } + /** + * string current_country = 2; + * @return The bytes for currentCountry. + */ + @Override + public com.google.protobuf.ByteString + getCurrentCountryBytes() { + return instance.getCurrentCountryBytes(); + } + /** + * string current_country = 2; + * @param value The currentCountry to set. + * @return This builder for chaining. + */ + public Builder setCurrentCountry( + String value) { + copyOnWrite(); + instance.setCurrentCountry(value); + return this; + } + /** + * string current_country = 2; + * @return This builder for chaining. + */ + public Builder clearCurrentCountry() { + copyOnWrite(); + instance.clearCurrentCountry(); + return this; + } + /** + * string current_country = 2; + * @param value The bytes for currentCountry to set. + * @return This builder for chaining. + */ + public Builder setCurrentCountryBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setCurrentCountryBytes(value); + return this; + } + + /** + * int32 identity = 3; + * @return The identity. + */ + @Override + public int getIdentity() { + return instance.getIdentity(); + } + /** + * int32 identity = 3; + * @param value The identity to set. + * @return This builder for chaining. + */ + public Builder setIdentity(int value) { + copyOnWrite(); + instance.setIdentity(value); + return this; + } + /** + * int32 identity = 3; + * @return This builder for chaining. + */ + public Builder clearIdentity() { + copyOnWrite(); + instance.clearIdentity(); + return this; + } + + /** + * string email = 4; + * @return The email. + */ + @Override + public String getEmail() { + return instance.getEmail(); + } + /** + * string email = 4; + * @return The bytes for email. + */ + @Override + public com.google.protobuf.ByteString + getEmailBytes() { + return instance.getEmailBytes(); + } + /** + * string email = 4; + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail( + String value) { + copyOnWrite(); + instance.setEmail(value); + return this; + } + /** + * string email = 4; + * @return This builder for chaining. + */ + public Builder clearEmail() { + copyOnWrite(); + instance.clearEmail(); + return this; + } + /** + * string email = 4; + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEmailBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthMeta.Customer) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Customer(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "signedUpCountry_", + "currentCountry_", + "identity_", + "email_", + }; + String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0004\u0004\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 (Customer.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:clickstream.health.proto.HealthMeta.Customer) + private static final Customer DEFAULT_INSTANCE; + static { + Customer defaultInstance = new Customer(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Customer.class, defaultInstance); + } + + public static Customer 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 DeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthMeta.Device) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string operating_system = 1; + * @return The operatingSystem. + */ + String getOperatingSystem(); + /** + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + com.google.protobuf.ByteString + getOperatingSystemBytes(); + + /** + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + String getOperatingSystemVersion(); + /** + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + com.google.protobuf.ByteString + getOperatingSystemVersionBytes(); + + /** + * string device_make = 3; + * @return The deviceMake. + */ + String getDeviceMake(); + /** + * string device_make = 3; + * @return The bytes for deviceMake. + */ + com.google.protobuf.ByteString + getDeviceMakeBytes(); + + /** + * string device_model = 4; + * @return The deviceModel. + */ + String getDeviceModel(); + /** + * string device_model = 4; + * @return The bytes for deviceModel. + */ + com.google.protobuf.ByteString + getDeviceModelBytes(); + } + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Device} + */ + public static final class Device extends + com.google.protobuf.GeneratedMessageLite< + Device, Device.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthMeta.Device) + DeviceOrBuilder { + private Device() { + operatingSystem_ = ""; + operatingSystemVersion_ = ""; + deviceMake_ = ""; + deviceModel_ = ""; + } + public static final int OPERATING_SYSTEM_FIELD_NUMBER = 1; + private String operatingSystem_; + /** + * string operating_system = 1; + * @return The operatingSystem. + */ + @Override + public String getOperatingSystem() { + return operatingSystem_; + } + /** + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(operatingSystem_); + } + /** + * string operating_system = 1; + * @param value The operatingSystem to set. + */ + private void setOperatingSystem( + String value) { + Class valueClass = value.getClass(); + + operatingSystem_ = value; + } + /** + * string operating_system = 1; + */ + private void clearOperatingSystem() { + + operatingSystem_ = getDefaultInstance().getOperatingSystem(); + } + /** + * string operating_system = 1; + * @param value The bytes for operatingSystem to set. + */ + private void setOperatingSystemBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + operatingSystem_ = value.toStringUtf8(); + + } + + public static final int OPERATING_SYSTEM_VERSION_FIELD_NUMBER = 2; + private String operatingSystemVersion_; + /** + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + @Override + public String getOperatingSystemVersion() { + return operatingSystemVersion_; + } + /** + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(operatingSystemVersion_); + } + /** + * string operating_system_version = 2; + * @param value The operatingSystemVersion to set. + */ + private void setOperatingSystemVersion( + String value) { + Class valueClass = value.getClass(); + + operatingSystemVersion_ = value; + } + /** + * string operating_system_version = 2; + */ + private void clearOperatingSystemVersion() { + + operatingSystemVersion_ = getDefaultInstance().getOperatingSystemVersion(); + } + /** + * string operating_system_version = 2; + * @param value The bytes for operatingSystemVersion to set. + */ + private void setOperatingSystemVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + operatingSystemVersion_ = value.toStringUtf8(); + + } + + public static final int DEVICE_MAKE_FIELD_NUMBER = 3; + private String deviceMake_; + /** + * string device_make = 3; + * @return The deviceMake. + */ + @Override + public String getDeviceMake() { + return deviceMake_; + } + /** + * string device_make = 3; + * @return The bytes for deviceMake. + */ + @Override + public com.google.protobuf.ByteString + getDeviceMakeBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceMake_); + } + /** + * string device_make = 3; + * @param value The deviceMake to set. + */ + private void setDeviceMake( + String value) { + Class valueClass = value.getClass(); + + deviceMake_ = value; + } + /** + * string device_make = 3; + */ + private void clearDeviceMake() { + + deviceMake_ = getDefaultInstance().getDeviceMake(); + } + /** + * string device_make = 3; + * @param value The bytes for deviceMake to set. + */ + private void setDeviceMakeBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceMake_ = value.toStringUtf8(); + + } + + public static final int DEVICE_MODEL_FIELD_NUMBER = 4; + private String deviceModel_; + /** + * string device_model = 4; + * @return The deviceModel. + */ + @Override + public String getDeviceModel() { + return deviceModel_; + } + /** + * string device_model = 4; + * @return The bytes for deviceModel. + */ + @Override + public com.google.protobuf.ByteString + getDeviceModelBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceModel_); + } + /** + * string device_model = 4; + * @param value The deviceModel to set. + */ + private void setDeviceModel( + String value) { + Class valueClass = value.getClass(); + + deviceModel_ = value; + } + /** + * string device_model = 4; + */ + private void clearDeviceModel() { + + deviceModel_ = getDefaultInstance().getDeviceModel(); + } + /** + * string device_model = 4; + * @param value The bytes for deviceModel to set. + */ + private void setDeviceModelBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceModel_ = value.toStringUtf8(); + + } + + public static Device parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Device 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 Device parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Device parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Device parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Device 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(Device prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Device} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Device, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthMeta.Device) + DeviceOrBuilder { + // Construct using clickstream.health.proto.HealthMeta.Device.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string operating_system = 1; + * @return The operatingSystem. + */ + @Override + public String getOperatingSystem() { + return instance.getOperatingSystem(); + } + /** + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemBytes() { + return instance.getOperatingSystemBytes(); + } + /** + * string operating_system = 1; + * @param value The operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystem( + String value) { + copyOnWrite(); + instance.setOperatingSystem(value); + return this; + } + /** + * string operating_system = 1; + * @return This builder for chaining. + */ + public Builder clearOperatingSystem() { + copyOnWrite(); + instance.clearOperatingSystem(); + return this; + } + /** + * string operating_system = 1; + * @param value The bytes for operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOperatingSystemBytes(value); + return this; + } + + /** + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + @Override + public String getOperatingSystemVersion() { + return instance.getOperatingSystemVersion(); + } + /** + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemVersionBytes() { + return instance.getOperatingSystemVersionBytes(); + } + /** + * string operating_system_version = 2; + * @param value The operatingSystemVersion to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemVersion( + String value) { + copyOnWrite(); + instance.setOperatingSystemVersion(value); + return this; + } + /** + * string operating_system_version = 2; + * @return This builder for chaining. + */ + public Builder clearOperatingSystemVersion() { + copyOnWrite(); + instance.clearOperatingSystemVersion(); + return this; + } + /** + * string operating_system_version = 2; + * @param value The bytes for operatingSystemVersion to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOperatingSystemVersionBytes(value); + return this; + } + + /** + * string device_make = 3; + * @return The deviceMake. + */ + @Override + public String getDeviceMake() { + return instance.getDeviceMake(); + } + /** + * string device_make = 3; + * @return The bytes for deviceMake. + */ + @Override + public com.google.protobuf.ByteString + getDeviceMakeBytes() { + return instance.getDeviceMakeBytes(); + } + /** + * string device_make = 3; + * @param value The deviceMake to set. + * @return This builder for chaining. + */ + public Builder setDeviceMake( + String value) { + copyOnWrite(); + instance.setDeviceMake(value); + return this; + } + /** + * string device_make = 3; + * @return This builder for chaining. + */ + public Builder clearDeviceMake() { + copyOnWrite(); + instance.clearDeviceMake(); + return this; + } + /** + * string device_make = 3; + * @param value The bytes for deviceMake to set. + * @return This builder for chaining. + */ + public Builder setDeviceMakeBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceMakeBytes(value); + return this; + } + + /** + * string device_model = 4; + * @return The deviceModel. + */ + @Override + public String getDeviceModel() { + return instance.getDeviceModel(); + } + /** + * string device_model = 4; + * @return The bytes for deviceModel. + */ + @Override + public com.google.protobuf.ByteString + getDeviceModelBytes() { + return instance.getDeviceModelBytes(); + } + /** + * string device_model = 4; + * @param value The deviceModel to set. + * @return This builder for chaining. + */ + public Builder setDeviceModel( + String value) { + copyOnWrite(); + instance.setDeviceModel(value); + return this; + } + /** + * string device_model = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceModel() { + copyOnWrite(); + instance.clearDeviceModel(); + return this; + } + /** + * string device_model = 4; + * @param value The bytes for deviceModel to set. + * @return This builder for chaining. + */ + public Builder setDeviceModelBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceModelBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthMeta.Device) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Device(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "operatingSystem_", + "operatingSystemVersion_", + "deviceMake_", + "deviceModel_", + }; + String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208\u0004\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 (Device.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:clickstream.health.proto.HealthMeta.Device) + private static final Device DEFAULT_INSTANCE; + static { + Device defaultInstance = new Device(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Device.class, defaultInstance); + } + + public static Device 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 LocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthMeta.Location) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * double latitude = 1; + * @return The latitude. + */ + double getLatitude(); + + /** + * double longitude = 2; + * @return The longitude. + */ + double getLongitude(); + } + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Location} + */ + public static final class Location extends + com.google.protobuf.GeneratedMessageLite< + Location, Location.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthMeta.Location) + LocationOrBuilder { + private Location() { + } + public static final int LATITUDE_FIELD_NUMBER = 1; + private double latitude_; + /** + * double latitude = 1; + * @return The latitude. + */ + @Override + public double getLatitude() { + return latitude_; + } + /** + * double latitude = 1; + * @param value The latitude to set. + */ + private void setLatitude(double value) { + + latitude_ = value; + } + /** + * double latitude = 1; + */ + private void clearLatitude() { + + latitude_ = 0D; + } + + public static final int LONGITUDE_FIELD_NUMBER = 2; + private double longitude_; + /** + * double longitude = 2; + * @return The longitude. + */ + @Override + public double getLongitude() { + return longitude_; + } + /** + * double longitude = 2; + * @param value The longitude to set. + */ + private void setLongitude(double value) { + + longitude_ = value; + } + /** + * double longitude = 2; + */ + private void clearLongitude() { + + longitude_ = 0D; + } + + public static Location parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Location 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 Location parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Location 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 Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Location 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 Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Location 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 Location parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Location parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Location parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Location 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(Location prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Location} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Location, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthMeta.Location) + LocationOrBuilder { + // Construct using clickstream.health.proto.HealthMeta.Location.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * double latitude = 1; + * @return The latitude. + */ + @Override + public double getLatitude() { + return instance.getLatitude(); + } + /** + * double latitude = 1; + * @param value The latitude to set. + * @return This builder for chaining. + */ + public Builder setLatitude(double value) { + copyOnWrite(); + instance.setLatitude(value); + return this; + } + /** + * double latitude = 1; + * @return This builder for chaining. + */ + public Builder clearLatitude() { + copyOnWrite(); + instance.clearLatitude(); + return this; + } + + /** + * double longitude = 2; + * @return The longitude. + */ + @Override + public double getLongitude() { + return instance.getLongitude(); + } + /** + * double longitude = 2; + * @param value The longitude to set. + * @return This builder for chaining. + */ + public Builder setLongitude(double value) { + copyOnWrite(); + instance.setLongitude(value); + return this; + } + /** + * double longitude = 2; + * @return This builder for chaining. + */ + public Builder clearLongitude() { + copyOnWrite(); + instance.clearLongitude(); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthMeta.Location) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Location(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "latitude_", + "longitude_", + }; + String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + ""; + 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 (Location.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:clickstream.health.proto.HealthMeta.Location) + private static final Location DEFAULT_INSTANCE; + static { + Location defaultInstance = new Location(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Location.class, defaultInstance); + } + + public static Location 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 SessionOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthMeta.Session) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string session_id = 1; + * @return The sessionId. + */ + String getSessionId(); + /** + * string session_id = 1; + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString + getSessionIdBytes(); + } + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Session} + */ + public static final class Session extends + com.google.protobuf.GeneratedMessageLite< + Session, Session.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.health.proto.HealthMeta.Session) + SessionOrBuilder { + private Session() { + sessionId_ = ""; + } + public static final int SESSION_ID_FIELD_NUMBER = 1; + private String sessionId_; + /** + * string session_id = 1; + * @return The sessionId. + */ + @Override + public String getSessionId() { + return sessionId_; + } + /** + * string session_id = 1; + * @return The bytes for sessionId. + */ + @Override + public com.google.protobuf.ByteString + getSessionIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(sessionId_); + } + /** + * string session_id = 1; + * @param value The sessionId to set. + */ + private void setSessionId( + String value) { + Class valueClass = value.getClass(); + + sessionId_ = value; + } + /** + * string session_id = 1; + */ + private void clearSessionId() { + + sessionId_ = getDefaultInstance().getSessionId(); + } + /** + * string session_id = 1; + * @param value The bytes for sessionId to set. + */ + private void setSessionIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + sessionId_ = value.toStringUtf8(); + + } + + public static Session parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Session 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 Session parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Session 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 Session parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Session 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 Session parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Session 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 Session parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Session parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Session parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Session 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(Session prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta.Session} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Session, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthMeta.Session) + SessionOrBuilder { + // Construct using clickstream.health.proto.HealthMeta.Session.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string session_id = 1; + * @return The sessionId. + */ + @Override + public String getSessionId() { + return instance.getSessionId(); + } + /** + * string session_id = 1; + * @return The bytes for sessionId. + */ + @Override + public com.google.protobuf.ByteString + getSessionIdBytes() { + return instance.getSessionIdBytes(); + } + /** + * string session_id = 1; + * @param value The sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionId( + String value) { + copyOnWrite(); + instance.setSessionId(value); + return this; + } + /** + * string session_id = 1; + * @return This builder for chaining. + */ + public Builder clearSessionId() { + copyOnWrite(); + instance.clearSessionId(); + return this; + } + /** + * string session_id = 1; + * @param value The bytes for sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSessionIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthMeta.Session) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Session(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "sessionId_", + }; + 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 (Session.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:clickstream.health.proto.HealthMeta.Session) + private static final Session DEFAULT_INSTANCE; + static { + Session defaultInstance = new Session(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Session.class, defaultInstance); + } + + public static Session 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 EVENT_GUID_FIELD_NUMBER = 1; + private String eventGuid_; + /** + * string event_guid = 1; + * @return The eventGuid. + */ + @Override + public String getEventGuid() { + return eventGuid_; + } + /** + * string event_guid = 1; + * @return The bytes for eventGuid. + */ + @Override + public com.google.protobuf.ByteString + getEventGuidBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(eventGuid_); + } + /** + * string event_guid = 1; + * @param value The eventGuid to set. + */ + private void setEventGuid( + String value) { + Class valueClass = value.getClass(); + + eventGuid_ = value; + } + /** + * string event_guid = 1; + */ + private void clearEventGuid() { + + eventGuid_ = getDefaultInstance().getEventGuid(); + } + /** + * string event_guid = 1; + * @param value The bytes for eventGuid to set. + */ + private void setEventGuidBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + eventGuid_ = value.toStringUtf8(); + + } + + public static final int LOCATION_FIELD_NUMBER = 4; + private Location location_; + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + @Override + public boolean hasLocation() { + return location_ != null; + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + @Override + public Location getLocation() { + return location_ == null ? Location.getDefaultInstance() : location_; + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + private void setLocation(Location value) { + value.getClass(); + location_ = value; + + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeLocation(Location value) { + value.getClass(); + if (location_ != null && + location_ != Location.getDefaultInstance()) { + location_ = + Location.newBuilder(location_).mergeFrom(value).buildPartial(); + } else { + location_ = value; + } + + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + private void clearLocation() { location_ = null; + + } + + public static final int CUSTOMER_FIELD_NUMBER = 5; + private Customer customer_; + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + @Override + public boolean hasCustomer() { + return customer_ != null; + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + @Override + public Customer getCustomer() { + return customer_ == null ? Customer.getDefaultInstance() : customer_; + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + private void setCustomer(Customer value) { + value.getClass(); + customer_ = value; + + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeCustomer(Customer value) { + value.getClass(); + if (customer_ != null && + customer_ != Customer.getDefaultInstance()) { + customer_ = + Customer.newBuilder(customer_).mergeFrom(value).buildPartial(); + } else { + customer_ = value; + } + + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + private void clearCustomer() { customer_ = null; + + } + + public static final int DEVICE_FIELD_NUMBER = 6; + private Device device_; + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + @Override + public boolean hasDevice() { + return device_ != null; + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + @Override + public Device getDevice() { + return device_ == null ? Device.getDefaultInstance() : device_; + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + private void setDevice(Device value) { + value.getClass(); + device_ = value; + + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeDevice(Device value) { + value.getClass(); + if (device_ != null && + device_ != Device.getDefaultInstance()) { + device_ = + Device.newBuilder(device_).mergeFrom(value).buildPartial(); + } else { + device_ = value; + } + + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + private void clearDevice() { device_ = null; + + } + + public static final int SESSION_FIELD_NUMBER = 7; + private Session session_; + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + @Override + public boolean hasSession() { + return session_ != null; + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + @Override + public Session getSession() { + return session_ == null ? Session.getDefaultInstance() : session_; + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + private void setSession(Session value) { + value.getClass(); + session_ = value; + + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeSession(Session value) { + value.getClass(); + if (session_ != null && + session_ != Session.getDefaultInstance()) { + session_ = + Session.newBuilder(session_).mergeFrom(value).buildPartial(); + } else { + session_ = value; + } + + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + private void clearSession() { session_ = null; + + } + + public static final int APP_FIELD_NUMBER = 8; + private App app_; + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + @Override + public boolean hasApp() { + return app_ != null; + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + @Override + public App getApp() { + return app_ == null ? App.getDefaultInstance() : app_; + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + private void setApp(App value) { + value.getClass(); + app_ = value; + + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeApp(App value) { + value.getClass(); + if (app_ != null && + app_ != App.getDefaultInstance()) { + app_ = + App.newBuilder(app_).mergeFrom(value).buildPartial(); + } else { + app_ = value; + } + + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + private void clearApp() { app_ = null; + + } + + public static HealthMeta parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static HealthMeta 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 HealthMeta parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static HealthMeta 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 HealthMeta parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static HealthMeta 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 HealthMeta parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static HealthMeta 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 HealthMeta parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static HealthMeta parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static HealthMeta parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static HealthMeta 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(HealthMeta prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code clickstream.health.proto.HealthMeta} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + HealthMeta, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.health.proto.HealthMeta) + HealthMetaOrBuilder { + // Construct using clickstream.health.proto.HealthMeta.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string event_guid = 1; + * @return The eventGuid. + */ + @Override + public String getEventGuid() { + return instance.getEventGuid(); + } + /** + * string event_guid = 1; + * @return The bytes for eventGuid. + */ + @Override + public com.google.protobuf.ByteString + getEventGuidBytes() { + return instance.getEventGuidBytes(); + } + /** + * string event_guid = 1; + * @param value The eventGuid to set. + * @return This builder for chaining. + */ + public Builder setEventGuid( + String value) { + copyOnWrite(); + instance.setEventGuid(value); + return this; + } + /** + * string event_guid = 1; + * @return This builder for chaining. + */ + public Builder clearEventGuid() { + copyOnWrite(); + instance.clearEventGuid(); + return this; + } + /** + * string event_guid = 1; + * @param value The bytes for eventGuid to set. + * @return This builder for chaining. + */ + public Builder setEventGuidBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEventGuidBytes(value); + return this; + } + + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + @Override + public boolean hasLocation() { + return instance.hasLocation(); + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + @Override + public Location getLocation() { + return instance.getLocation(); + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + public Builder setLocation(Location value) { + copyOnWrite(); + instance.setLocation(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + public Builder setLocation( + Location.Builder builderForValue) { + copyOnWrite(); + instance.setLocation(builderForValue.build()); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + public Builder mergeLocation(Location value) { + copyOnWrite(); + instance.mergeLocation(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + */ + public Builder clearLocation() { copyOnWrite(); + instance.clearLocation(); + return this; + } + + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + @Override + public boolean hasCustomer() { + return instance.hasCustomer(); + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + @Override + public Customer getCustomer() { + return instance.getCustomer(); + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + public Builder setCustomer(Customer value) { + copyOnWrite(); + instance.setCustomer(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + public Builder setCustomer( + Customer.Builder builderForValue) { + copyOnWrite(); + instance.setCustomer(builderForValue.build()); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + public Builder mergeCustomer(Customer value) { + copyOnWrite(); + instance.mergeCustomer(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + */ + public Builder clearCustomer() { copyOnWrite(); + instance.clearCustomer(); + return this; + } + + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + @Override + public boolean hasDevice() { + return instance.hasDevice(); + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + @Override + public Device getDevice() { + return instance.getDevice(); + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + public Builder setDevice(Device value) { + copyOnWrite(); + instance.setDevice(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + public Builder setDevice( + Device.Builder builderForValue) { + copyOnWrite(); + instance.setDevice(builderForValue.build()); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + public Builder mergeDevice(Device value) { + copyOnWrite(); + instance.mergeDevice(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + */ + public Builder clearDevice() { copyOnWrite(); + instance.clearDevice(); + return this; + } + + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + @Override + public boolean hasSession() { + return instance.hasSession(); + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + @Override + public Session getSession() { + return instance.getSession(); + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + public Builder setSession(Session value) { + copyOnWrite(); + instance.setSession(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + public Builder setSession( + Session.Builder builderForValue) { + copyOnWrite(); + instance.setSession(builderForValue.build()); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + public Builder mergeSession(Session value) { + copyOnWrite(); + instance.mergeSession(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + */ + public Builder clearSession() { copyOnWrite(); + instance.clearSession(); + return this; + } + + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + @Override + public boolean hasApp() { + return instance.hasApp(); + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + @Override + public App getApp() { + return instance.getApp(); + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + public Builder setApp(App value) { + copyOnWrite(); + instance.setApp(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + public Builder setApp( + App.Builder builderForValue) { + copyOnWrite(); + instance.setApp(builderForValue.build()); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + public Builder mergeApp(App value) { + copyOnWrite(); + instance.mergeApp(value); + return this; + } + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + */ + public Builder clearApp() { copyOnWrite(); + instance.clearApp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.health.proto.HealthMeta) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new HealthMeta(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "eventGuid_", + "location_", + "customer_", + "device_", + "session_", + "app_", + }; + String info = + "\u0000\u0006\u0000\u0000\u0001\b\u0006\u0000\u0000\u0000\u0001\u0208\u0004\t\u0005" + + "\t\u0006\t\u0007\t\b\t"; + 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 (HealthMeta.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:clickstream.health.proto.HealthMeta) + private static final HealthMeta DEFAULT_INSTANCE; + static { + HealthMeta defaultInstance = new HealthMeta(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + HealthMeta.class, defaultInstance); + } + + public static HealthMeta getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMetaOrBuilder.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMetaOrBuilder.java new file mode 100644 index 00000000..a05ebb05 --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMetaOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HealthMeta.proto + +package clickstream.health.proto; + +public interface HealthMetaOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.HealthMeta) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string event_guid = 1; + * @return The eventGuid. + */ + String getEventGuid(); + /** + * string event_guid = 1; + * @return The bytes for eventGuid. + */ + com.google.protobuf.ByteString + getEventGuidBytes(); + + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + * @return Whether the location field is set. + */ + boolean hasLocation(); + /** + * .clickstream.health.proto.HealthMeta.Location location = 4; + * @return The location. + */ + HealthMeta.Location getLocation(); + + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + * @return Whether the customer field is set. + */ + boolean hasCustomer(); + /** + * .clickstream.health.proto.HealthMeta.Customer customer = 5; + * @return The customer. + */ + HealthMeta.Customer getCustomer(); + + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + * @return Whether the device field is set. + */ + boolean hasDevice(); + /** + * .clickstream.health.proto.HealthMeta.Device device = 6; + * @return The device. + */ + HealthMeta.Device getDevice(); + + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + * @return Whether the session field is set. + */ + boolean hasSession(); + /** + * .clickstream.health.proto.HealthMeta.Session session = 7; + * @return The session. + */ + HealthMeta.Session getSession(); + + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + * @return Whether the app field is set. + */ + boolean hasApp(); + /** + * .clickstream.health.proto.HealthMeta.App app = 8; + * @return The app. + */ + HealthMeta.App getApp(); +} diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMetaProto.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMetaProto.java new file mode 100644 index 00000000..9ace1a97 --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthMetaProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HealthMeta.proto + +package clickstream.health.proto; + +public final class HealthMetaProto { + private HealthMetaProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthOrBuilder.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthOrBuilder.java new file mode 100644 index 00000000..dae39100 --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthOrBuilder.java @@ -0,0 +1,117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Health.proto + +package clickstream.health.proto; + +public interface HealthOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.health.proto.Health) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + * @return The eventName. + */ + String getEventName(); + /** + *
+   * Name of the health event.
+   * 
+ * + * string event_name = 1; + * @return The bytes for eventName. + */ + com.google.protobuf.ByteString + getEventNameBytes(); + + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + * @return Whether the healthDetails field is set. + */ + boolean hasHealthDetails(); + /** + *
+   * Health details, captured by the SDK when the mode is verbose.
+   * 
+ * + * .clickstream.health.proto.HealthDetails healthDetails = 2; + * @return The healthDetails. + */ + HealthDetails getHealthDetails(); + + /** + *
+   * Number of events tracked.
+   * 
+ * + * int64 number_of_events = 3; + * @return The numberOfEvents. + */ + long getNumberOfEvents(); + + /** + *
+   * Number of event batches tracked.
+   * 
+ * + * int64 number_of_batches = 4; + * @return The numberOfBatches. + */ + long getNumberOfBatches(); + + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + * @return Whether the eventTimestamp field is set. + */ + boolean hasEventTimestamp(); + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp event_timestamp = 101; + * @return The eventTimestamp. + */ + com.google.protobuf.Timestamp getEventTimestamp(); + + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + * @return Whether the healthMeta field is set. + */ + boolean hasHealthMeta(); + /** + * .clickstream.health.proto.HealthMeta healthMeta = 103; + * @return The healthMeta. + */ + HealthMeta getHealthMeta(); + + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + * @return Whether the deviceTimestamp field is set. + */ + boolean hasDeviceTimestamp(); + /** + *
+   * Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 104; + * @return The deviceTimestamp. + */ + com.google.protobuf.Timestamp getDeviceTimestamp(); +} diff --git a/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthProto.java b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthProto.java new file mode 100644 index 00000000..35ff62f4 --- /dev/null +++ b/clickstream-health-proto/src/main/java/clickstream/health/proto/HealthProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Health.proto + +package clickstream.health.proto; + +public final class HealthProto { + private HealthProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/clickstream/build.gradle.kts b/clickstream/build.gradle.kts index 1006cdda..a24d2c44 100644 --- a/clickstream/build.gradle.kts +++ b/clickstream/build.gradle.kts @@ -35,7 +35,7 @@ android { dependencies { // Clickstream - implementation(files("$rootDir/libs/proto-sdk-1.18.6.jar")) + implementation(projects.clickstreamHealthProto) api(projects.clickstreamLogger) api(projects.clickstreamHealthMetricsNoop) api(projects.clickstreamEventListener) @@ -64,7 +64,6 @@ dependencies { // Unit Test deps.android.test.unitTest.list.forEach(::testImplementation) - testImplementation(files("$rootDir/libs/proto-consumer-1.18.6.jar")) testImplementation(projects.clickstreamHealthMetrics) testImplementation(projects.clickstreamApi) testImplementation(projects.clickstreamHealthMetricsApi) diff --git a/clickstream/src/main/kotlin/clickstream/extension/CSMessageExt.kt b/clickstream/src/main/kotlin/clickstream/extension/CSMessageExt.kt index 9f82c14f..06b1c96d 100644 --- a/clickstream/src/main/kotlin/clickstream/extension/CSMessageExt.kt +++ b/clickstream/src/main/kotlin/clickstream/extension/CSMessageExt.kt @@ -1,7 +1,7 @@ package clickstream.extension -import com.gojek.clickstream.de.Event -import com.gojek.clickstream.internal.Health +import clickstream.health.proto.Health +import clickstream.internal.networklayer.proto.raccoon.Event import com.google.protobuf.Internal.isValidUtf8 import com.google.protobuf.MessageLite import java.lang.reflect.Field diff --git a/clickstream/src/main/kotlin/clickstream/internal/di/CSServiceLocator.kt b/clickstream/src/main/kotlin/clickstream/internal/di/CSServiceLocator.kt index aacccc06..b466ac26 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/di/CSServiceLocator.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/di/CSServiceLocator.kt @@ -19,7 +19,6 @@ import clickstream.lifecycle.CSBackgroundLifecycleManager import clickstream.listener.CSEventListener import clickstream.logger.CSLogLevel import clickstream.logger.CSLogger -import com.gojek.clickstream.internal.Health import com.tinder.scarlet.lifecycle.LifecycleRegistry import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/clickstream/src/main/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSMetaProvider.kt b/clickstream/src/main/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSMetaProvider.kt index 566e9f21..458116aa 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSMetaProvider.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSMetaProvider.kt @@ -3,11 +3,7 @@ package clickstream.internal.eventprocessor.impl import clickstream.api.CSInfo import clickstream.api.CSLocationInfo import clickstream.api.CSMetaProvider -import com.gojek.clickstream.internal.HealthMeta.App -import com.gojek.clickstream.internal.HealthMeta.Customer -import com.gojek.clickstream.internal.HealthMeta.Device -import com.gojek.clickstream.internal.HealthMeta.Location -import com.gojek.clickstream.internal.HealthMeta.Session +import clickstream.health.proto.HealthMeta /** * This is the implementation of [CSMetaProvider]. @@ -18,24 +14,24 @@ public class DefaultCSMetaProvider( private val info: CSInfo ) : CSMetaProvider { - override suspend fun location(): Location = + override suspend fun location(): HealthMeta.Location = with(info.locationInfo) { val currentLocation = CSLocationInfo.Location(latitude, longitude) - return@with Location.newBuilder().apply { + return@with HealthMeta.Location.newBuilder().apply { latitude = currentLocation.latitude longitude = currentLocation.longitude }.build() } - override val app: App by lazy { - App.newBuilder().apply { + override val app: HealthMeta.App by lazy { + HealthMeta.App.newBuilder().apply { version = info.appInfo.appVersion }.build() } - override val customer: Customer by lazy { + override val customer: HealthMeta.Customer by lazy { with(info.userInfo) { - Customer.newBuilder() + HealthMeta.Customer.newBuilder() .setSignedUpCountry(signedUpCountry) .setCurrentCountry(currentCountry) .setIdentity(identity) @@ -44,9 +40,9 @@ public class DefaultCSMetaProvider( } } - override val device: Device by lazy { + override val device: HealthMeta.Device by lazy { with(info.deviceInfo) { - Device.newBuilder().apply { + HealthMeta.Device.newBuilder().apply { deviceModel = this@with.getDeviceModel() deviceMake = this@with.getDeviceManufacturer() operatingSystem = this@with.getOperatingSystem() @@ -55,8 +51,8 @@ public class DefaultCSMetaProvider( } } - override val session: Session by lazy { - Session.newBuilder().apply { + override val session: HealthMeta.Session by lazy { + HealthMeta.Session.newBuilder().apply { sessionId = info.sessionInfo.sessionID }.build() } diff --git a/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSBaseEventScheduler.kt b/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSBaseEventScheduler.kt index 3903ed33..09e7a5dc 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSBaseEventScheduler.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSBaseEventScheduler.kt @@ -8,9 +8,11 @@ import clickstream.health.constant.CSEventTypesConstant import clickstream.health.identity.CSGuIdGenerator import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO +import clickstream.health.proto.Health import clickstream.health.time.CSTimeStampGenerator import clickstream.internal.analytics.CSErrorReasons import clickstream.internal.networklayer.CSNetworkManager +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest import clickstream.internal.utils.CSBatteryLevel import clickstream.internal.utils.CSBatteryStatusObserver import clickstream.internal.utils.CSNetworkStatusObserver @@ -21,8 +23,6 @@ import clickstream.lifecycle.CSLifeCycleManager import clickstream.listener.CSEventListener import clickstream.listener.CSEventModel import clickstream.logger.CSLogger -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.internal.Health import com.google.protobuf.MessageLite import java.util.concurrent.CopyOnWriteArrayList import kotlinx.coroutines.CoroutineDispatcher @@ -214,10 +214,10 @@ internal open class CSBaseEventScheduler( healthEventRepository.insertHealthEvent(event) } - protected fun transformToEventRequest(eventData: List): EventRequest { + protected fun transformToEventRequest(eventData: List): SendEventRequest { logger.debug { "CSBaseEventScheduler#transformToEventRequest" } - return EventRequest.newBuilder().apply { + return SendEventRequest.newBuilder().apply { reqGuid = guIdGenerator.getId() sentTime = CSTimeStampMessageBuilder.build(timeStampGenerator.getTimeStamp()) addAllEvents(eventData.map { it.event() }) @@ -229,7 +229,7 @@ internal open class CSBaseEventScheduler( } private suspend fun updateEventsGuidAndInsertToDb( - eventRequest: EventRequest, + eventRequest: SendEventRequest, eventData: List ) { logger.debug { "CSBaseEventScheduler#updateEventsGuidAndInsertToDb" } @@ -277,7 +277,7 @@ internal open class CSBaseEventScheduler( private suspend fun recordEventBatchCreated( batch: List, - eventRequest: EventRequest + eventRequest: SendEventRequest ): String { var eventGuids = "" if (batch.isNotEmpty() && batch[0].messageName != Health::class.qualifiedName.orEmpty()) { diff --git a/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSEventData.kt b/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSEventData.kt index 2fe81be0..e42e4600 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSEventData.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/eventscheduler/CSEventData.kt @@ -5,8 +5,8 @@ import androidx.room.Entity import androidx.room.PrimaryKey import clickstream.extension.eventName import clickstream.health.model.CSEventHealth +import clickstream.internal.networklayer.proto.raccoon.Event import clickstream.model.CSEvent -import com.gojek.clickstream.de.Event import com.google.protobuf.ByteString import com.google.protobuf.MessageLite import java.util.Locale diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSEventService.kt b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSEventService.kt index 8b96523b..9a87445e 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSEventService.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSEventService.kt @@ -1,7 +1,7 @@ package clickstream.internal.networklayer -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import com.tinder.scarlet.WebSocket import com.tinder.scarlet.ws.Receive import com.tinder.scarlet.ws.Send @@ -17,7 +17,7 @@ internal interface CSEventService { * @return Flow<> - Stream of event data containing the ID of successful events */ @Receive - fun observeResponse(): Flow + fun observeResponse(): Flow /** * Observes the socket connection - Opened, closed, IsClosing, Failed, MessageReceived @@ -31,5 +31,5 @@ internal interface CSEventService { * @param streamBatchEvents - The analytic data which is to be sent */ @Send - fun sendEvent(streamBatchEvents: EventRequest): Boolean + fun sendEvent(streamBatchEvents: SendEventRequest): Boolean } diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkManager.kt b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkManager.kt index ab984d15..74baef69 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkManager.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkManager.kt @@ -15,11 +15,11 @@ import clickstream.health.constant.CSEventTypesConstant import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO import clickstream.internal.analytics.CSErrorReasons +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest import clickstream.internal.utils.CSResult import clickstream.lifecycle.CSAppLifeCycle import clickstream.lifecycle.CSLifeCycleManager import clickstream.logger.CSLogger -import com.gojek.clickstream.de.EventRequest import com.tinder.scarlet.WebSocket import java.io.EOFException import java.net.SocketTimeoutException @@ -133,7 +133,7 @@ internal open class CSNetworkManager( * @param eventRequest - The data which hold the analytic events * @param eventGuids - a guid list within string the comma separate "1, 2, 3" */ - fun processEvent(eventRequest: EventRequest, eventGuids: String) { + fun processEvent(eventRequest: SendEventRequest, eventGuids: String) { logger.debug { "CSNetworkManager#processEvent" } networkRepository.sendEvents(eventRequest, eventGuids, callback) @@ -145,7 +145,7 @@ internal open class CSNetworkManager( * @param eventRequest - The data which hold the analytic events */ fun processInstantEvent( - eventRequest: EventRequest + eventRequest: SendEventRequest ) { logger.debug { "CSNetworkManager#processInstantEvent" } networkRepository.sendInstantEvents(eventRequest = eventRequest) diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkRepository.kt b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkRepository.kt index 2ef6deeb..857c8a39 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkRepository.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSNetworkRepository.kt @@ -4,10 +4,10 @@ import clickstream.api.CSInfo import clickstream.config.CSNetworkConfig import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.time.CSTimeStampGenerator +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import clickstream.internal.utils.CSCallback import clickstream.logger.CSLogger -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse import com.tinder.scarlet.WebSocket import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.flow.Flow @@ -22,7 +22,7 @@ internal interface CSNetworkRepository { * Observes the acknowledgement from the BE * @return Flow<> - Stream of event data containing the ID of successful events */ - public fun observeResponse(): Flow + public fun observeResponse(): Flow /** * Observes the socket connection - Opened, closed, IsClosing, Failed, MessageReceived @@ -35,7 +35,7 @@ internal interface CSNetworkRepository { * @param eventRequest - The analytic data which is to be sent */ public fun sendEvents( - eventRequest: EventRequest, + eventRequest: SendEventRequest, eventGuids: String, callback: CSCallback ) @@ -45,7 +45,7 @@ internal interface CSNetworkRepository { * @param eventRequest - The analytic data which is to be sent */ public fun sendInstantEvents( - eventRequest: EventRequest + eventRequest: SendEventRequest ) } @@ -63,7 +63,7 @@ internal class CSNetworkRepositoryImpl( private val info: CSInfo ) : CSNetworkRepository { - override fun observeResponse(): Flow { + override fun observeResponse(): Flow { logger.debug { "CSNetworkRepositoryImpl#observeResponse" } return eventService.observeResponse() @@ -76,7 +76,7 @@ internal class CSNetworkRepositoryImpl( } override fun sendEvents( - eventRequest: EventRequest, + eventRequest: SendEventRequest, eventGuids: String, callback: CSCallback ) { @@ -107,7 +107,7 @@ internal class CSNetworkRepositoryImpl( } } - override fun sendInstantEvents(eventRequest: EventRequest) { + override fun sendInstantEvents(eventRequest: SendEventRequest) { logger.debug { "CSNetworkRepositoryImpl#sendInstantEvents - eventRequest $eventRequest" } logger.debug { "CSNetworkRepositoryImpl#sendInstantEvents - eventRequestType ${eventRequest.eventsList[0].type}" } diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSRetryableCallback.kt b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSRetryableCallback.kt index 6e2802e5..b7c38d09 100644 --- a/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSRetryableCallback.kt +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/CSRetryableCallback.kt @@ -9,12 +9,13 @@ import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO import clickstream.health.time.CSTimeStampGenerator import clickstream.internal.analytics.CSErrorReasons +import clickstream.internal.networklayer.proto.raccoon.Code +import clickstream.internal.networklayer.proto.raccoon.Code.* +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse +import clickstream.internal.networklayer.proto.raccoon.Status import clickstream.internal.utils.CSTimeStampMessageBuilder import clickstream.logger.CSLogger -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.Code -import com.gojek.clickstream.de.common.EventResponse -import com.gojek.clickstream.de.common.Status import java.util.concurrent.atomic.AtomicInteger import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineExceptionHandler @@ -40,7 +41,7 @@ private const val REQUEST_GUID_KEY = "req_guid" internal abstract class CSRetryableCallback( private val networkConfig: CSNetworkConfig, private val eventService: CSEventService, - private var eventRequest: EventRequest, + private var eventRequest: SendEventRequest, private val eventGuids: String, private val dispatcher: CoroutineDispatcher, private val timeStampGenerator: CSTimeStampGenerator, @@ -104,7 +105,7 @@ internal abstract class CSRetryableCallback( logger.debug { "CSRetryableCallback#observeCallback - Message received from the server: ${it.dataMap[REQUEST_GUID_KEY]}" } val guid = it.dataMap[REQUEST_GUID_KEY]!! when { - it.status == Status.SUCCESS -> { + it.status == Status.STATUS_SUCCESS -> { logger.debug { "CSRetryableCallback#observeCallback - Success" } onSuccess(guid) @@ -250,13 +251,13 @@ internal abstract class CSRetryableCallback( timeOutJob.cancel() } - private suspend fun trackEventResponse(eventResponse: EventResponse, eventRequestGuid: String) { + private suspend fun trackEventResponse(eventResponse: SendEventResponse, eventRequestGuid: String) { logger.debug { "CSRetryableCallback#trackEventResponse - eventResponse $eventResponse" } when (eventResponse.code.ordinal) { - Code.MAX_CONNECTION_LIMIT_REACHED.ordinal -> { + CODE_MAX_CONNECTION_LIMIT_REACHED.ordinal -> { logger.debug { "CSRetryableCallback#trackEventResponse - eventResponse MAX_CONNECTION_LIMIT_REACHED" } recordHealthEvent( @@ -266,7 +267,7 @@ internal abstract class CSRetryableCallback( eventBatchGuid = eventRequestGuid ) } - Code.MAX_USER_LIMIT_REACHED.ordinal -> { + CODE_MAX_USER_LIMIT_REACHED.ordinal -> { logger.debug { "CSRetryableCallback#trackEventResponse - eventResponse MAX_USER_LIMIT_REACHED" } recordHealthEvent( @@ -276,7 +277,7 @@ internal abstract class CSRetryableCallback( eventBatchGuid = eventRequestGuid ) } - Code.BAD_REQUEST.ordinal -> { + CODE_BAD_REQUEST.ordinal -> { logger.debug { "CSRetryableCallback#trackEventResponse : eventResponse BAD_REQUEST" } recordHealthEvent( diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Code.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Code.java new file mode 100644 index 00000000..8026de8b --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Code.java @@ -0,0 +1,186 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +/** + * Protobuf enum {@code raystack.raccoon.v1beta1.Code} + */ +public enum Code + implements com.google.protobuf.Internal.EnumLite { + /** + *
+   *`CODE_UNSPECIFIED` indicates no appropriate/existing code can describe it.
+   * 
+ * + * CODE_UNSPECIFIED = 0; + */ + CODE_UNSPECIFIED(0), + /** + *
+   *`OK` indicates the request is processed successfully.
+   * 
+ * + * CODE_OK = 1; + */ + CODE_OK(1), + /** + *
+   *`BAD_REQUEST` indicates there is something wrong with the request.
+   * 
+ * + * CODE_BAD_REQUEST = 2; + */ + CODE_BAD_REQUEST(2), + /** + *
+   *`INTERNAL_ERROR` indicates that Raccoon encountered an unexpected condition that prevented it from fulfilling the request.
+   * 
+ * + * CODE_INTERNAL_ERROR = 3; + */ + CODE_INTERNAL_ERROR(3), + /** + *
+   *`MAX_CONNECTION_LIMIT_REACHED` indicates that Raccoon is unable to accepts new connection due to max connection is reached.
+   *To prevent Raccoon from eating up resources, connection limit needs to be set. The limit is configurable on Raccoon by setting `SERVER_WEBSOCKET_MAX_CONN`
+   * 
+ * + * CODE_MAX_CONNECTION_LIMIT_REACHED = 4; + */ + CODE_MAX_CONNECTION_LIMIT_REACHED(4), + /** + *
+   *`MAX_USER_LIMIT_REACHED` indicates that existing connection with the same ID.
+   *Raccoon ensures unique connection using unique identifier passed from the header
+   *the first time Websocket connection is established. The header key that
+   *contains unique identifier is configurable on Raccoon by setting `SERVER_WEBSOCKET_CONN_UNIQ_ID_HEADER`
+   * 
+ * + * CODE_MAX_USER_LIMIT_REACHED = 5; + */ + CODE_MAX_USER_LIMIT_REACHED(5), + UNRECOGNIZED(-1), + ; + + /** + *
+   *`CODE_UNSPECIFIED` indicates no appropriate/existing code can describe it.
+   * 
+ * + * CODE_UNSPECIFIED = 0; + */ + public static final int CODE_UNSPECIFIED_VALUE = 0; + /** + *
+   *`OK` indicates the request is processed successfully.
+   * 
+ * + * CODE_OK = 1; + */ + public static final int CODE_OK_VALUE = 1; + /** + *
+   *`BAD_REQUEST` indicates there is something wrong with the request.
+   * 
+ * + * CODE_BAD_REQUEST = 2; + */ + public static final int CODE_BAD_REQUEST_VALUE = 2; + /** + *
+   *`INTERNAL_ERROR` indicates that Raccoon encountered an unexpected condition that prevented it from fulfilling the request.
+   * 
+ * + * CODE_INTERNAL_ERROR = 3; + */ + public static final int CODE_INTERNAL_ERROR_VALUE = 3; + /** + *
+   *`MAX_CONNECTION_LIMIT_REACHED` indicates that Raccoon is unable to accepts new connection due to max connection is reached.
+   *To prevent Raccoon from eating up resources, connection limit needs to be set. The limit is configurable on Raccoon by setting `SERVER_WEBSOCKET_MAX_CONN`
+   * 
+ * + * CODE_MAX_CONNECTION_LIMIT_REACHED = 4; + */ + public static final int CODE_MAX_CONNECTION_LIMIT_REACHED_VALUE = 4; + /** + *
+   *`MAX_USER_LIMIT_REACHED` indicates that existing connection with the same ID.
+   *Raccoon ensures unique connection using unique identifier passed from the header
+   *the first time Websocket connection is established. The header key that
+   *contains unique identifier is configurable on Raccoon by setting `SERVER_WEBSOCKET_CONN_UNIQ_ID_HEADER`
+   * 
+ * + * CODE_MAX_USER_LIMIT_REACHED = 5; + */ + public static final int CODE_MAX_USER_LIMIT_REACHED_VALUE = 5; + + + @Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } + + public static Code forNumber(int value) { + switch (value) { + case 0: return CODE_UNSPECIFIED; + case 1: return CODE_OK; + case 2: return CODE_BAD_REQUEST; + case 3: return CODE_INTERNAL_ERROR; + case 4: return CODE_MAX_CONNECTION_LIMIT_REACHED; + case 5: return CODE_MAX_USER_LIMIT_REACHED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Code> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @Override + public Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return CodeVerifier.INSTANCE; + } + + private static final class CodeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new CodeVerifier(); + @Override + public boolean isInRange(int number) { + return Code.forNumber(number) != null; + } + }; + + private final int value; + + private Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:raystack.raccoon.v1beta1.Code) +} + diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Event.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Event.java new file mode 100644 index 00000000..66e33482 --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Event.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +/** + * Protobuf type {@code raystack.raccoon.v1beta1.Event} + */ +public final class Event extends + com.google.protobuf.GeneratedMessageLite< + Event, Event.Builder> implements + // @@protoc_insertion_point(message_implements:raystack.raccoon.v1beta1.Event) + EventOrBuilder { + private Event() { + eventBytes_ = com.google.protobuf.ByteString.EMPTY; + type_ = ""; + } + public static final int EVENT_BYTES_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString eventBytes_; + /** + *
+   *`event_bytes` is where you put bytes serialized event.
+   * 
+ * + * bytes event_bytes = 1; + * @return The eventBytes. + */ + @Override + public com.google.protobuf.ByteString getEventBytes() { + return eventBytes_; + } + /** + *
+   *`event_bytes` is where you put bytes serialized event.
+   * 
+ * + * bytes event_bytes = 1; + * @param value The eventBytes to set. + */ + private void setEventBytes(com.google.protobuf.ByteString value) { + Class valueClass = value.getClass(); + + eventBytes_ = value; + } + /** + *
+   *`event_bytes` is where you put bytes serialized event.
+   * 
+ * + * bytes event_bytes = 1; + */ + private void clearEventBytes() { + + eventBytes_ = getDefaultInstance().getEventBytes(); + } + + public static final int TYPE_FIELD_NUMBER = 2; + private String type_; + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + * @return The type. + */ + @Override + public String getType() { + return type_; + } + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + * @return The bytes for type. + */ + @Override + public com.google.protobuf.ByteString + getTypeBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(type_); + } + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + * @param value The type to set. + */ + private void setType( + String value) { + Class valueClass = value.getClass(); + + type_ = value; + } + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + */ + private void clearType() { + + type_ = getDefaultInstance().getType(); + } + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + * @param value The bytes for type to set. + */ + private void setTypeBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + type_ = value.toStringUtf8(); + + } + + public static Event parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Event 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 Event parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Event 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 Event parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Event 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 Event parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Event 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 Event parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Event parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Event parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Event 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(Event prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code raystack.raccoon.v1beta1.Event} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Event, Builder> implements + // @@protoc_insertion_point(builder_implements:raystack.raccoon.v1beta1.Event) + EventOrBuilder { + // Construct using clickstream.internal.networklayer.proto.raccoon.Event.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     *`event_bytes` is where you put bytes serialized event.
+     * 
+ * + * bytes event_bytes = 1; + * @return The eventBytes. + */ + @Override + public com.google.protobuf.ByteString getEventBytes() { + return instance.getEventBytes(); + } + /** + *
+     *`event_bytes` is where you put bytes serialized event.
+     * 
+ * + * bytes event_bytes = 1; + * @param value The eventBytes to set. + * @return This builder for chaining. + */ + public Builder setEventBytes(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEventBytes(value); + return this; + } + /** + *
+     *`event_bytes` is where you put bytes serialized event.
+     * 
+ * + * bytes event_bytes = 1; + * @return This builder for chaining. + */ + public Builder clearEventBytes() { + copyOnWrite(); + instance.clearEventBytes(); + return this; + } + + /** + *
+     *`type` denotes an event type that the producer of this proto message may set.
+     *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+     *users of this proto can use this type to set strings which can be processed in their
+     *ingestion systems to distribute or perform other functions.
+     * 
+ * + * string type = 2; + * @return The type. + */ + @Override + public String getType() { + return instance.getType(); + } + /** + *
+     *`type` denotes an event type that the producer of this proto message may set.
+     *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+     *users of this proto can use this type to set strings which can be processed in their
+     *ingestion systems to distribute or perform other functions.
+     * 
+ * + * string type = 2; + * @return The bytes for type. + */ + @Override + public com.google.protobuf.ByteString + getTypeBytes() { + return instance.getTypeBytes(); + } + /** + *
+     *`type` denotes an event type that the producer of this proto message may set.
+     *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+     *users of this proto can use this type to set strings which can be processed in their
+     *ingestion systems to distribute or perform other functions.
+     * 
+ * + * string type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + String value) { + copyOnWrite(); + instance.setType(value); + return this; + } + /** + *
+     *`type` denotes an event type that the producer of this proto message may set.
+     *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+     *users of this proto can use this type to set strings which can be processed in their
+     *ingestion systems to distribute or perform other functions.
+     * 
+ * + * string type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + copyOnWrite(); + instance.clearType(); + return this; + } + /** + *
+     *`type` denotes an event type that the producer of this proto message may set.
+     *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+     *users of this proto can use this type to set strings which can be processed in their
+     *ingestion systems to distribute or perform other functions.
+     * 
+ * + * string type = 2; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTypeBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:raystack.raccoon.v1beta1.Event) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Event(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "eventBytes_", + "type_", + }; + String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\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 (Event.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:raystack.raccoon.v1beta1.Event) + private static final Event DEFAULT_INSTANCE; + static { + Event defaultInstance = new Event(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Event.class, defaultInstance); + } + + public static Event getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/EventOrBuilder.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/EventOrBuilder.java new file mode 100644 index 00000000..0e97ceb8 --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/EventOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +public interface EventOrBuilder extends + // @@protoc_insertion_point(interface_extends:raystack.raccoon.v1beta1.Event) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   *`event_bytes` is where you put bytes serialized event.
+   * 
+ * + * bytes event_bytes = 1; + * @return The eventBytes. + */ + com.google.protobuf.ByteString getEventBytes(); + + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + * @return The type. + */ + String getType(); + /** + *
+   *`type` denotes an event type that the producer of this proto message may set.
+   *It is currently used by raccoon to distribute events to respective Kafka topics. However the
+   *users of this proto can use this type to set strings which can be processed in their
+   *ingestion systems to distribute or perform other functions.
+   * 
+ * + * string type = 2; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); +} diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/EventProto.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/EventProto.java new file mode 100644 index 00000000..b5e879b9 --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/EventProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +public final class EventProto { + private EventProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventRequest.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventRequest.java new file mode 100644 index 00000000..f1799bac --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventRequest.java @@ -0,0 +1,913 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +/** + *
+ *`EventRequest` defines the contract to push events to Raccoon
+ *An `EventRequest` allows you to push more than one events(batch). The events
+ *are wrapped inside `events` repeated field. All of the fields on `EventRequest`
+ *are required.
+ * 
+ * + * Protobuf type {@code raystack.raccoon.v1beta1.SendEventRequest} + */ +public final class SendEventRequest extends + com.google.protobuf.GeneratedMessageLite< + SendEventRequest, SendEventRequest.Builder> implements + // @@protoc_insertion_point(message_implements:raystack.raccoon.v1beta1.SendEventRequest) + SendEventRequestOrBuilder { + private SendEventRequest() { + reqGuid_ = ""; + events_ = emptyProtobufList(); + } + public static final int REQ_GUID_FIELD_NUMBER = 1; + private String reqGuid_; + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + * @return The reqGuid. + */ + @Override + public String getReqGuid() { + return reqGuid_; + } + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + * @return The bytes for reqGuid. + */ + @Override + public com.google.protobuf.ByteString + getReqGuidBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(reqGuid_); + } + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + * @param value The reqGuid to set. + */ + private void setReqGuid( + String value) { + Class valueClass = value.getClass(); + + reqGuid_ = value; + } + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + */ + private void clearReqGuid() { + + reqGuid_ = getDefaultInstance().getReqGuid(); + } + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + * @param value The bytes for reqGuid to set. + */ + private void setReqGuidBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + reqGuid_ = value.toStringUtf8(); + + } + + public static final int SENT_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp sentTime_; + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + @Override + public boolean hasSentTime() { + return sentTime_ != null; + } + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + @Override + public com.google.protobuf.Timestamp getSentTime() { + return sentTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : sentTime_; + } + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + private void setSentTime(com.google.protobuf.Timestamp value) { + value.getClass(); + sentTime_ = value; + + } + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeSentTime(com.google.protobuf.Timestamp value) { + value.getClass(); + if (sentTime_ != null && + sentTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + sentTime_ = + com.google.protobuf.Timestamp.newBuilder(sentTime_).mergeFrom(value).buildPartial(); + } else { + sentTime_ = value; + } + + } + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + private void clearSentTime() { sentTime_ = null; + + } + + public static final int EVENTS_FIELD_NUMBER = 3; + private com.google.protobuf.Internal.ProtobufList events_; + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + @Override + public java.util.List getEventsList() { + return events_; + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public java.util.List + getEventsOrBuilderList() { + return events_; + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + @Override + public int getEventsCount() { + return events_.size(); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + @Override + public Event getEvents(int index) { + return events_.get(index); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public EventOrBuilder getEventsOrBuilder( + int index) { + return events_.get(index); + } + private void ensureEventsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = events_; + if (!tmp.isModifiable()) { + events_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + private void setEvents( + int index, Event value) { + value.getClass(); + ensureEventsIsMutable(); + events_.set(index, value); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + private void addEvents(Event value) { + value.getClass(); + ensureEventsIsMutable(); + events_.add(value); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + private void addEvents( + int index, Event value) { + value.getClass(); + ensureEventsIsMutable(); + events_.add(index, value); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + private void addAllEvents( + Iterable values) { + ensureEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, events_); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + private void clearEvents() { + events_ = emptyProtobufList(); + } + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + private void removeEvents(int index) { + ensureEventsIsMutable(); + events_.remove(index); + } + + public static SendEventRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static SendEventRequest 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 SendEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static SendEventRequest 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 SendEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static SendEventRequest 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 SendEventRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static SendEventRequest 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 SendEventRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static SendEventRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static SendEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static SendEventRequest 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(SendEventRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *`EventRequest` defines the contract to push events to Raccoon
+   *An `EventRequest` allows you to push more than one events(batch). The events
+   *are wrapped inside `events` repeated field. All of the fields on `EventRequest`
+   *are required.
+   * 
+ * + * Protobuf type {@code raystack.raccoon.v1beta1.SendEventRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + SendEventRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:raystack.raccoon.v1beta1.SendEventRequest) + SendEventRequestOrBuilder { + // Construct using clickstream.internal.networklayer.proto.raccoon.SendEventRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     *`req_guid` is unique identifier of the request the client is making.
+     *Raccoon uses the identifier to send response of the request. The client can handle the
+     *response accordingly. For example, the client can retry the request in case the response is
+     *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+     *This identifier is necessary because on event-based protocols like WebSocket the response is
+     *returned asynchronously. If there is no identifier, no way the client can tell which response
+     *belongs to which request.
+     *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+     *debug logs with `ReqGUID` keyword.
+     * 
+ * + * string req_guid = 1; + * @return The reqGuid. + */ + @Override + public String getReqGuid() { + return instance.getReqGuid(); + } + /** + *
+     *`req_guid` is unique identifier of the request the client is making.
+     *Raccoon uses the identifier to send response of the request. The client can handle the
+     *response accordingly. For example, the client can retry the request in case the response is
+     *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+     *This identifier is necessary because on event-based protocols like WebSocket the response is
+     *returned asynchronously. If there is no identifier, no way the client can tell which response
+     *belongs to which request.
+     *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+     *debug logs with `ReqGUID` keyword.
+     * 
+ * + * string req_guid = 1; + * @return The bytes for reqGuid. + */ + @Override + public com.google.protobuf.ByteString + getReqGuidBytes() { + return instance.getReqGuidBytes(); + } + /** + *
+     *`req_guid` is unique identifier of the request the client is making.
+     *Raccoon uses the identifier to send response of the request. The client can handle the
+     *response accordingly. For example, the client can retry the request in case the response is
+     *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+     *This identifier is necessary because on event-based protocols like WebSocket the response is
+     *returned asynchronously. If there is no identifier, no way the client can tell which response
+     *belongs to which request.
+     *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+     *debug logs with `ReqGUID` keyword.
+     * 
+ * + * string req_guid = 1; + * @param value The reqGuid to set. + * @return This builder for chaining. + */ + public Builder setReqGuid( + String value) { + copyOnWrite(); + instance.setReqGuid(value); + return this; + } + /** + *
+     *`req_guid` is unique identifier of the request the client is making.
+     *Raccoon uses the identifier to send response of the request. The client can handle the
+     *response accordingly. For example, the client can retry the request in case the response is
+     *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+     *This identifier is necessary because on event-based protocols like WebSocket the response is
+     *returned asynchronously. If there is no identifier, no way the client can tell which response
+     *belongs to which request.
+     *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+     *debug logs with `ReqGUID` keyword.
+     * 
+ * + * string req_guid = 1; + * @return This builder for chaining. + */ + public Builder clearReqGuid() { + copyOnWrite(); + instance.clearReqGuid(); + return this; + } + /** + *
+     *`req_guid` is unique identifier of the request the client is making.
+     *Raccoon uses the identifier to send response of the request. The client can handle the
+     *response accordingly. For example, the client can retry the request in case the response is
+     *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+     *This identifier is necessary because on event-based protocols like WebSocket the response is
+     *returned asynchronously. If there is no identifier, no way the client can tell which response
+     *belongs to which request.
+     *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+     *debug logs with `ReqGUID` keyword.
+     * 
+ * + * string req_guid = 1; + * @param value The bytes for reqGuid to set. + * @return This builder for chaining. + */ + public Builder setReqGuidBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setReqGuidBytes(value); + return this; + } + + /** + *
+     *`sent_time` defines the time the request is sent.
+     *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+     *request is sent until the events are published.
+     * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + @Override + public boolean hasSentTime() { + return instance.hasSentTime(); + } + /** + *
+     *`sent_time` defines the time the request is sent.
+     *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+     *request is sent until the events are published.
+     * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + @Override + public com.google.protobuf.Timestamp getSentTime() { + return instance.getSentTime(); + } + /** + *
+     *`sent_time` defines the time the request is sent.
+     *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+     *request is sent until the events are published.
+     * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + public Builder setSentTime(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setSentTime(value); + return this; + } + /** + *
+     *`sent_time` defines the time the request is sent.
+     *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+     *request is sent until the events are published.
+     * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + public Builder setSentTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setSentTime(builderForValue.build()); + return this; + } + /** + *
+     *`sent_time` defines the time the request is sent.
+     *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+     *request is sent until the events are published.
+     * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + public Builder mergeSentTime(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeSentTime(value); + return this; + } + /** + *
+     *`sent_time` defines the time the request is sent.
+     *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+     *request is sent until the events are published.
+     * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + */ + public Builder clearSentTime() { copyOnWrite(); + instance.clearSentTime(); + return this; + } + + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + @Override + public java.util.List getEventsList() { + return java.util.Collections.unmodifiableList( + instance.getEventsList()); + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + @Override + public int getEventsCount() { + return instance.getEventsCount(); + }/** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + @Override + public Event getEvents(int index) { + return instance.getEvents(index); + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder setEvents( + int index, Event value) { + copyOnWrite(); + instance.setEvents(index, value); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder setEvents( + int index, Event.Builder builderForValue) { + copyOnWrite(); + instance.setEvents(index, + builderForValue.build()); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder addEvents(Event value) { + copyOnWrite(); + instance.addEvents(value); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder addEvents( + int index, Event value) { + copyOnWrite(); + instance.addEvents(index, value); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder addEvents( + Event.Builder builderForValue) { + copyOnWrite(); + instance.addEvents(builderForValue.build()); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder addEvents( + int index, Event.Builder builderForValue) { + copyOnWrite(); + instance.addEvents(index, + builderForValue.build()); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder addAllEvents( + Iterable values) { + copyOnWrite(); + instance.addAllEvents(values); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder clearEvents() { + copyOnWrite(); + instance.clearEvents(); + return this; + } + /** + *
+     *`events` is where the client put all the events wrapped in `Event`.
+     *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+     *the events to optimize the network call.
+     * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + public Builder removeEvents(int index) { + copyOnWrite(); + instance.removeEvents(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:raystack.raccoon.v1beta1.SendEventRequest) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new SendEventRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "reqGuid_", + "sentTime_", + "events_", + Event.class, + }; + String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u0208\u0002\t" + + "\u0003\u001b"; + 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 (SendEventRequest.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:raystack.raccoon.v1beta1.SendEventRequest) + private static final SendEventRequest DEFAULT_INSTANCE; + static { + SendEventRequest defaultInstance = new SendEventRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SendEventRequest.class, defaultInstance); + } + + public static SendEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventRequestOrBuilder.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventRequestOrBuilder.java new file mode 100644 index 00000000..c5025eb6 --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventRequestOrBuilder.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +public interface SendEventRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:raystack.raccoon.v1beta1.SendEventRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + * @return The reqGuid. + */ + String getReqGuid(); + /** + *
+   *`req_guid` is unique identifier of the request the client is making.
+   *Raccoon uses the identifier to send response of the request. The client can handle the
+   *response accordingly. For example, the client can retry the request in case the response is
+   *giving `INTERNAL_ERROR` code with "publisher failed" reason.
+   *This identifier is necessary because on event-based protocols like WebSocket the response is
+   *returned asynchronously. If there is no identifier, no way the client can tell which response
+   *belongs to which request.
+   *Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the
+   *debug logs with `ReqGUID` keyword.
+   * 
+ * + * string req_guid = 1; + * @return The bytes for reqGuid. + */ + com.google.protobuf.ByteString + getReqGuidBytes(); + + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + * @return Whether the sentTime field is set. + */ + boolean hasSentTime(); + /** + *
+   *`sent_time` defines the time the request is sent.
+   *`sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the
+   *request is sent until the events are published.
+   * 
+ * + * .google.protobuf.Timestamp sent_time = 2; + * @return The sentTime. + */ + com.google.protobuf.Timestamp getSentTime(); + + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + java.util.List + getEventsList(); + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + Event getEvents(int index); + /** + *
+   *`events` is where the client put all the events wrapped in `Event`.
+   *As mentioned above, the request allows the client to push more than one event. Normally you want to batch
+   *the events to optimize the network call.
+   * 
+ * + * repeated .raystack.raccoon.v1beta1.Event events = 3; + */ + int getEventsCount(); +} diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventResponse.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventResponse.java new file mode 100644 index 00000000..a3ac573c --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventResponse.java @@ -0,0 +1,974 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +/** + * Protobuf type {@code raystack.raccoon.v1beta1.SendEventResponse} + */ +public final class SendEventResponse extends + com.google.protobuf.GeneratedMessageLite< + SendEventResponse, SendEventResponse.Builder> implements + // @@protoc_insertion_point(message_implements:raystack.raccoon.v1beta1.SendEventResponse) + SendEventResponseOrBuilder { + private SendEventResponse() { + reason_ = ""; + } + public static final int STATUS_FIELD_NUMBER = 1; + private int status_; + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @Override + public int getStatusValue() { + return status_; + } + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return The status. + */ + @Override + public Status getStatus() { + Status result = Status.forNumber(status_); + return result == null ? Status.UNRECOGNIZED : result; + } + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + */ + private void setStatusValue(int value) { + status_ = value; + } + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @param value The status to set. + */ + private void setStatus(Status value) { + status_ = value.getNumber(); + + } + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + */ + private void clearStatus() { + + status_ = 0; + } + + public static final int CODE_FIELD_NUMBER = 2; + private int code_; + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return The enum numeric value on the wire for code. + */ + @Override + public int getCodeValue() { + return code_; + } + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return The code. + */ + @Override + public Code getCode() { + Code result = Code.forNumber(code_); + return result == null ? Code.UNRECOGNIZED : result; + } + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @param value The enum numeric value on the wire for code to set. + */ + private void setCodeValue(int value) { + code_ = value; + } + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @param value The code to set. + */ + private void setCode(Code value) { + code_ = value.getNumber(); + + } + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + */ + private void clearCode() { + + code_ = 0; + } + + public static final int SENT_TIME_FIELD_NUMBER = 3; + private long sentTime_; + /** + *
+   *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+   * 
+ * + * int64 sent_time = 3; + * @return The sentTime. + */ + @Override + public long getSentTime() { + return sentTime_; + } + /** + *
+   *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+   * 
+ * + * int64 sent_time = 3; + * @param value The sentTime to set. + */ + private void setSentTime(long value) { + + sentTime_ = value; + } + /** + *
+   *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+   * 
+ * + * int64 sent_time = 3; + */ + private void clearSentTime() { + + sentTime_ = 0L; + } + + public static final int REASON_FIELD_NUMBER = 4; + private String reason_; + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + * @return The reason. + */ + @Override + public String getReason() { + return reason_; + } + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + * @return The bytes for reason. + */ + @Override + public com.google.protobuf.ByteString + getReasonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(reason_); + } + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + * @param value The reason to set. + */ + private void setReason( + String value) { + Class valueClass = value.getClass(); + + reason_ = value; + } + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + */ + private void clearReason() { + + reason_ = getDefaultInstance().getReason(); + } + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + * @param value The bytes for reason to set. + */ + private void setReasonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + reason_ = value.toStringUtf8(); + + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntryLite< + String, String> defaultEntry = + com.google.protobuf.MapEntryLite + .newDefaultInstance( + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapFieldLite< + String, String> data_ = + com.google.protobuf.MapFieldLite.emptyMapField(); + private com.google.protobuf.MapFieldLite + internalGetData() { + return data_; + } + private com.google.protobuf.MapFieldLite + internalGetMutableData() { + if (!data_.isMutable()) { + data_ = data_.mutableCopy(); + } + return data_; + } + @Override + + public int getDataCount() { + return internalGetData().size(); + } + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + @Override + + public boolean containsData( + String key) { + Class keyClass = key.getClass(); + return internalGetData().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @Override + @Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + @Override + + public java.util.Map getDataMap() { + return java.util.Collections.unmodifiableMap( + internalGetData()); + } + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + @Override + + public String getDataOrDefault( + String key, + String defaultValue) { + Class keyClass = key.getClass(); + java.util.Map map = + internalGetData(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + @Override + + public String getDataOrThrow( + String key) { + Class keyClass = key.getClass(); + java.util.Map map = + internalGetData(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + private java.util.Map + getMutableDataMap() { + return internalGetMutableData(); + } + + public static SendEventResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static SendEventResponse 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 SendEventResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static SendEventResponse 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 SendEventResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static SendEventResponse 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 SendEventResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static SendEventResponse 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 SendEventResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static SendEventResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static SendEventResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static SendEventResponse 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(SendEventResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code raystack.raccoon.v1beta1.SendEventResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + SendEventResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:raystack.raccoon.v1beta1.SendEventResponse) + SendEventResponseOrBuilder { + // Construct using clickstream.internal.networklayer.proto.raccoon.SendEventResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     *`status` denotes status of the request.
+     *Only 3 values are valid. `SUCCESS` means the the request is processed
+     *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+     *means Raccoon unable to determine whether the request is success or not.
+     * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @Override + public int getStatusValue() { + return instance.getStatusValue(); + } + /** + *
+     *`status` denotes status of the request.
+     *Only 3 values are valid. `SUCCESS` means the the request is processed
+     *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+     *means Raccoon unable to determine whether the request is success or not.
+     * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + copyOnWrite(); + instance.setStatusValue(value); + return this; + } + /** + *
+     *`status` denotes status of the request.
+     *Only 3 values are valid. `SUCCESS` means the the request is processed
+     *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+     *means Raccoon unable to determine whether the request is success or not.
+     * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return The status. + */ + @Override + public Status getStatus() { + return instance.getStatus(); + } + /** + *
+     *`status` denotes status of the request.
+     *Only 3 values are valid. `SUCCESS` means the the request is processed
+     *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+     *means Raccoon unable to determine whether the request is success or not.
+     * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatus(Status value) { + copyOnWrite(); + instance.setStatus(value); + return this; + } + /** + *
+     *`status` denotes status of the request.
+     *Only 3 values are valid. `SUCCESS` means the the request is processed
+     *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+     *means Raccoon unable to determine whether the request is success or not.
+     * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return This builder for chaining. + */ + public Builder clearStatus() { + copyOnWrite(); + instance.clearStatus(); + return this; + } + + /** + *
+     *`code` gives more detail of what happened to the request.
+     *Details of available `code` can be seen below.
+     * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return The enum numeric value on the wire for code. + */ + @Override + public int getCodeValue() { + return instance.getCodeValue(); + } + /** + *
+     *`code` gives more detail of what happened to the request.
+     *Details of available `code` can be seen below.
+     * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + copyOnWrite(); + instance.setCodeValue(value); + return this; + } + /** + *
+     *`code` gives more detail of what happened to the request.
+     *Details of available `code` can be seen below.
+     * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return The code. + */ + @Override + public Code getCode() { + return instance.getCode(); + } + /** + *
+     *`code` gives more detail of what happened to the request.
+     *Details of available `code` can be seen below.
+     * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCode(Code value) { + copyOnWrite(); + instance.setCode(value); + return this; + } + /** + *
+     *`code` gives more detail of what happened to the request.
+     *Details of available `code` can be seen below.
+     * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return This builder for chaining. + */ + public Builder clearCode() { + copyOnWrite(); + instance.clearCode(); + return this; + } + + /** + *
+     *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+     * 
+ * + * int64 sent_time = 3; + * @return The sentTime. + */ + @Override + public long getSentTime() { + return instance.getSentTime(); + } + /** + *
+     *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+     * 
+ * + * int64 sent_time = 3; + * @param value The sentTime to set. + * @return This builder for chaining. + */ + public Builder setSentTime(long value) { + copyOnWrite(); + instance.setSentTime(value); + return this; + } + /** + *
+     *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+     * 
+ * + * int64 sent_time = 3; + * @return This builder for chaining. + */ + public Builder clearSentTime() { + copyOnWrite(); + instance.clearSentTime(); + return this; + } + + /** + *
+     *`reason` is additional-human readable information to provide more context to `status` and `code`.
+     *There is no predefined structure for this. The value is arbitrary.
+     * 
+ * + * string reason = 4; + * @return The reason. + */ + @Override + public String getReason() { + return instance.getReason(); + } + /** + *
+     *`reason` is additional-human readable information to provide more context to `status` and `code`.
+     *There is no predefined structure for this. The value is arbitrary.
+     * 
+ * + * string reason = 4; + * @return The bytes for reason. + */ + @Override + public com.google.protobuf.ByteString + getReasonBytes() { + return instance.getReasonBytes(); + } + /** + *
+     *`reason` is additional-human readable information to provide more context to `status` and `code`.
+     *There is no predefined structure for this. The value is arbitrary.
+     * 
+ * + * string reason = 4; + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason( + String value) { + copyOnWrite(); + instance.setReason(value); + return this; + } + /** + *
+     *`reason` is additional-human readable information to provide more context to `status` and `code`.
+     *There is no predefined structure for this. The value is arbitrary.
+     * 
+ * + * string reason = 4; + * @return This builder for chaining. + */ + public Builder clearReason() { + copyOnWrite(); + instance.clearReason(); + return this; + } + /** + *
+     *`reason` is additional-human readable information to provide more context to `status` and `code`.
+     *There is no predefined structure for this. The value is arbitrary.
+     * 
+ * + * string reason = 4; + * @param value The bytes for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setReasonBytes(value); + return this; + } + + @Override + + public int getDataCount() { + return instance.getDataMap().size(); + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + @Override + + public boolean containsData( + String key) { + Class keyClass = key.getClass(); + return instance.getDataMap().containsKey(key); + } + + public Builder clearData() { + copyOnWrite(); + instance.getMutableDataMap().clear(); + return this; + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + + public Builder removeData( + String key) { + Class keyClass = key.getClass(); + copyOnWrite(); + instance.getMutableDataMap().remove(key); + return this; + } + /** + * Use {@link #getDataMap()} instead. + */ + @Override + @Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + @Override + public java.util.Map getDataMap() { + return java.util.Collections.unmodifiableMap( + instance.getDataMap()); + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + @Override + + public String getDataOrDefault( + String key, + String defaultValue) { + Class keyClass = key.getClass(); + java.util.Map map = + instance.getDataMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + @Override + + public String getDataOrThrow( + String key) { + Class keyClass = key.getClass(); + java.util.Map map = + instance.getDataMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + public Builder putData( + String key, + String value) { + Class keyClass = key.getClass(); + Class valueClass = value.getClass(); + copyOnWrite(); + instance.getMutableDataMap().put(key, value); + return this; + } + /** + *
+     *`data` is arbitrary extra metadata.
+     *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+     *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+     * 
+ * + * map<string, string> data = 5; + */ + public Builder putAllData( + java.util.Map values) { + copyOnWrite(); + instance.getMutableDataMap().putAll(values); + return this; + } + + // @@protoc_insertion_point(builder_scope:raystack.raccoon.v1beta1.SendEventResponse) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new SendEventResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "status_", + "code_", + "sentTime_", + "reason_", + "data_", + DataDefaultEntryHolder.defaultEntry, + }; + String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0001\u0000\u0000\u0001\f\u0002\f\u0003" + + "\u0002\u0004\u0208\u00052"; + 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 (SendEventResponse.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:raystack.raccoon.v1beta1.SendEventResponse) + private static final SendEventResponse DEFAULT_INSTANCE; + static { + SendEventResponse defaultInstance = new SendEventResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SendEventResponse.class, defaultInstance); + } + + public static SendEventResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventResponseOrBuilder.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventResponseOrBuilder.java new file mode 100644 index 00000000..d250960c --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/SendEventResponseOrBuilder.java @@ -0,0 +1,151 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +public interface SendEventResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:raystack.raccoon.v1beta1.SendEventResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + *
+   *`status` denotes status of the request.
+   *Only 3 values are valid. `SUCCESS` means the the request is processed
+   *successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS`
+   *means Raccoon unable to determine whether the request is success or not.
+   * 
+ * + * .raystack.raccoon.v1beta1.Status status = 1; + * @return The status. + */ + Status getStatus(); + + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + *
+   *`code` gives more detail of what happened to the request.
+   *Details of available `code` can be seen below.
+   * 
+ * + * .raystack.raccoon.v1beta1.Code code = 2; + * @return The code. + */ + Code getCode(); + + /** + *
+   *`sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent.
+   * 
+ * + * int64 sent_time = 3; + * @return The sentTime. + */ + long getSentTime(); + + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + * @return The reason. + */ + String getReason(); + /** + *
+   *`reason` is additional-human readable information to provide more context to `status` and `code`.
+   *There is no predefined structure for this. The value is arbitrary.
+   * 
+ * + * string reason = 4; + * @return The bytes for reason. + */ + com.google.protobuf.ByteString + getReasonBytes(); + + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + int getDataCount(); + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + boolean containsData( + String key); + /** + * Use {@link #getDataMap()} instead. + */ + @Deprecated + java.util.Map + getData(); + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + + String getDataOrDefault( + String key, + String defaultValue); + /** + *
+   *`data` is arbitrary extra metadata.
+   *Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part
+   *of `data`. The client may fetch req_guid as key to get the `req_guid` value.
+   * 
+ * + * map<string, string> data = 5; + */ + + String getDataOrThrow( + String key); +} diff --git a/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Status.java b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Status.java new file mode 100644 index 00000000..510524e8 --- /dev/null +++ b/clickstream/src/main/kotlin/clickstream/internal/networklayer/proto/raccoon/Status.java @@ -0,0 +1,103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raccoon.proto + +package clickstream.internal.networklayer.proto.raccoon; + +/** + * Protobuf enum {@code raystack.raccoon.v1beta1.Status} + */ +public enum Status + implements com.google.protobuf.Internal.EnumLite { + /** + * STATUS_UNSPECIFIED = 0; + */ + STATUS_UNSPECIFIED(0), + /** + * STATUS_SUCCESS = 1; + */ + STATUS_SUCCESS(1), + /** + * STATUS_ERROR = 2; + */ + STATUS_ERROR(2), + UNRECOGNIZED(-1), + ; + + /** + * STATUS_UNSPECIFIED = 0; + */ + public static final int STATUS_UNSPECIFIED_VALUE = 0; + /** + * STATUS_SUCCESS = 1; + */ + public static final int STATUS_SUCCESS_VALUE = 1; + /** + * STATUS_ERROR = 2; + */ + public static final int STATUS_ERROR_VALUE = 2; + + + @Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static Status valueOf(int value) { + return forNumber(value); + } + + public static Status forNumber(int value) { + switch (value) { + case 0: return STATUS_UNSPECIFIED; + case 1: return STATUS_SUCCESS; + case 2: return STATUS_ERROR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @Override + public Status findValueByNumber(int number) { + return Status.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return StatusVerifier.INSTANCE; + } + + private static final class StatusVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new StatusVerifier(); + @Override + public boolean isInRange(int number) { + return Status.forNumber(number) != null; + } + }; + + private final int value; + + private Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:raystack.raccoon.v1beta1.Status) +} + diff --git a/clickstream/src/test/kotlin/clickstream/ClickStreamConnectionTest.kt b/clickstream/src/test/kotlin/clickstream/ClickStreamConnectionTest.kt index fed603db..db4ebc05 100644 --- a/clickstream/src/test/kotlin/clickstream/ClickStreamConnectionTest.kt +++ b/clickstream/src/test/kotlin/clickstream/ClickStreamConnectionTest.kt @@ -2,19 +2,18 @@ package clickstream import clickstream.internal.eventscheduler.CSEventData import clickstream.internal.networklayer.CSEventService +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import clickstream.internal.utils.CSFlowStreamAdapterFactory import clickstream.internal.utils.CSTimeStampMessageBuilder import clickstream.model.CSEvent +import clickstream.proto.App +import clickstream.proto.User import clickstream.utils.TestFlowObserver import clickstream.utils.any import clickstream.utils.containingBytes import clickstream.utils.flowTest import clickstream.utils.newWebSocketFactory -import com.gojek.clickstream.common.App -import com.gojek.clickstream.common.EventMeta -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse -import com.gojek.clickstream.products.events.AdCardEvent import com.google.protobuf.Timestamp import com.tinder.scarlet.Lifecycle import com.tinder.scarlet.Scarlet @@ -55,10 +54,10 @@ public class ClickStreamConnectionTest { public fun send_givenConnectionIsEstablished_shouldBeReceivedByTheServer() { // Given givenConnectionIsEstablished() - val testResponse: TestFlowObserver = server.observeResponse().flowTest() + val testResponse: TestFlowObserver = server.observeResponse().flowTest() - val eventRequest1: EventRequest = generatedEvent("1") - val eventRequest2: EventRequest = generatedEvent("2") + val eventRequest1: SendEventRequest = generatedEvent("1") + val eventRequest2: SendEventRequest = generatedEvent("2") // When val event1 = client.sendEvent(eventRequest1) @@ -81,21 +80,19 @@ public class ClickStreamConnectionTest { ) assertThat(testResponse.values).allSatisfy { e -> - e is EventResponse + e is SendEventResponse } } - private fun generatedEvent(guid: String): EventRequest { + private fun generatedEvent(guid: String): SendEventRequest { val event = CSEvent( guid = guid, timestamp = Timestamp.getDefaultInstance(), - message = AdCardEvent.newBuilder() - .setMeta( - EventMeta.newBuilder() - .setApp(App.newBuilder().setVersion("4.35.0")) - .build() - ) - .build() + message = User.newBuilder() + .setApp( + App.newBuilder() + .setVersion("4.35.0") + ).build() ) val (eventData, eventHealthData) = CSEventData.create(event) return transformToEventRequest(eventData = listOf(eventData)) @@ -150,8 +147,8 @@ public class ClickStreamConnectionTest { ) } - private fun transformToEventRequest(eventData: List): EventRequest { - return EventRequest.newBuilder().apply { + private fun transformToEventRequest(eventData: List): SendEventRequest { + return SendEventRequest.newBuilder().apply { reqGuid = "1011" sentTime = CSTimeStampMessageBuilder.build(System.currentTimeMillis()) addAllEvents(eventData.map { it.event() }) diff --git a/clickstream/src/test/kotlin/clickstream/ClickStreamFunctionalTest.kt b/clickstream/src/test/kotlin/clickstream/ClickStreamFunctionalTest.kt deleted file mode 100644 index 34392e97..00000000 --- a/clickstream/src/test/kotlin/clickstream/ClickStreamFunctionalTest.kt +++ /dev/null @@ -1,111 +0,0 @@ -package clickstream - -import android.app.Application -import android.os.Build.VERSION_CODES -import androidx.test.core.app.ApplicationProvider -import clickstream.api.CSAppInfo -import clickstream.api.CSInfo -import clickstream.api.CSLocationInfo -import clickstream.api.CSSessionInfo -import clickstream.config.CSConfiguration -import clickstream.extension.protoName -import clickstream.fake.FakeCSAppLifeCycle -import clickstream.fake.FakeHealthGateway -import clickstream.fake.createCSConfig -import clickstream.fake.fakeUserInfo -import clickstream.internal.DefaultCSDeviceInfo -import clickstream.model.CSEvent -import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.common.App -import com.gojek.clickstream.common.Customer -import com.gojek.clickstream.common.EventMeta -import com.gojek.clickstream.products.events.AdCardEvent -import com.google.protobuf.Timestamp -import kotlinx.coroutines.ExperimentalCoroutinesApi -import okhttp3.OkHttpClient.Builder -import org.junit.Assert.assertTrue -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.kotlin.mock -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config - -@ExperimentalCoroutinesApi -@RunWith(RobolectricTestRunner::class) -@Config(manifest = Config.NONE, sdk = [VERSION_CODES.P]) -public class ClickStreamFunctionalTest { - @get:Rule - public val coroutineRule: CoroutineTestRule = CoroutineTestRule() - - private val fakeHealthGateway = FakeHealthGateway(mock(), mock(), mock(), mock()) - private val app = ApplicationProvider.getApplicationContext() - - @Test - public fun `Given EventMeta When Customer property is filled Then final generated EventMeta should have Customer metadata`() { - // Given - val userInfo = fakeUserInfo() - val csInfo = createCSInfo().copy(userInfo = userInfo) - val appLifecycle = FakeCSAppLifeCycle() - ClickStream.initialize( - CSConfiguration.Builder( - context = app, - info = csInfo, - config = createCSConfig(), - appLifeCycle = appLifecycle, - ) - .setDispatcher(coroutineRule.testDispatcher) - .setHealthGateway(fakeHealthGateway) - .build() - ) - - val sut = ClickStream.getInstance() - - // When - val event = generateCSCustomerEvent("12") - sut.trackEvent(event, true) - - // Then - assertTrue(event.message.protoName() == "AdCardEvent") - assertTrue((event.message as AdCardEvent).meta.customer.email == userInfo.email) - assertTrue((event.message as AdCardEvent).meta.customer.currentCountry == userInfo.currentCountry) - assertTrue((event.message as AdCardEvent).meta.customer.signedUpCountry == userInfo.signedUpCountry) - assertTrue((event.message as AdCardEvent).meta.customer.identity == userInfo.identity) - assertTrue((event.message as AdCardEvent).meta.hasMerchant().not()) - } - - private fun generateCSCustomerEvent(guid: String): CSEvent { - val userInfo = fakeUserInfo() - return CSEvent( - guid = guid, - timestamp = Timestamp.getDefaultInstance(), - message = AdCardEvent.newBuilder() - .setMeta( - EventMeta.newBuilder() - .setApp(App.newBuilder().setVersion("4.35.0")) - .setCustomer( - Customer.newBuilder() - .setCurrentCountry(userInfo.currentCountry) - .setEmail(userInfo.email) - .setIdentity(userInfo.identity) - .setSignedUpCountry(userInfo.signedUpCountry) - .build() - ) - .build() - ) - .build() - ) - } - - private fun createCSInfo(): CSInfo { - return CSInfo( - appInfo = CSAppInfo(appVersion = "4.37.0"), - locationInfo = CSLocationInfo( - latitude = -6.1753924, - longitude = 106.8249641, - s2Ids = emptyMap() - ), sessionInfo = CSSessionInfo(sessionID = "1234"), - deviceInfo = DefaultCSDeviceInfo(), fakeUserInfo() - ) - } -} diff --git a/clickstream/src/test/kotlin/clickstream/ClickStreamMerchantFunctionalTest.kt b/clickstream/src/test/kotlin/clickstream/ClickStreamMerchantFunctionalTest.kt deleted file mode 100644 index df16fa0c..00000000 --- a/clickstream/src/test/kotlin/clickstream/ClickStreamMerchantFunctionalTest.kt +++ /dev/null @@ -1,121 +0,0 @@ -package clickstream - -import android.app.Application -import android.os.Build.VERSION_CODES -import androidx.test.core.app.ApplicationProvider -import clickstream.api.CSAppInfo -import clickstream.api.CSInfo -import clickstream.api.CSLocationInfo -import clickstream.api.CSSessionInfo -import clickstream.config.CSConfiguration -import clickstream.extension.protoName -import clickstream.fake.FakeCSAppLifeCycle -import clickstream.fake.FakeHealthGateway -import clickstream.fake.createCSConfig -import clickstream.fake.fakeUserInfo -import clickstream.internal.DefaultCSDeviceInfo -import clickstream.model.CSEvent -import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.common.App -import com.gojek.clickstream.common.EventMeta -import com.gojek.clickstream.common.Merchant -import com.gojek.clickstream.common.MerchantUser -import com.gojek.clickstream.common.MerchantUserRole -import com.gojek.clickstream.products.events.AdCardEvent -import com.google.protobuf.Timestamp -import kotlinx.coroutines.ExperimentalCoroutinesApi -import okhttp3.OkHttpClient.Builder -import org.junit.Assert.assertTrue -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.kotlin.mock -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config - -@ExperimentalCoroutinesApi -@RunWith(RobolectricTestRunner::class) -@Config(manifest = Config.NONE, sdk = [VERSION_CODES.P]) -@Ignore -public class ClickStreamMerchantFunctionalTest { - @get:Rule - public val coroutineRule: CoroutineTestRule = CoroutineTestRule() - - private val fakeHealthGateway = FakeHealthGateway(mock(), mock(), mock(), mock()) - private val app = ApplicationProvider.getApplicationContext() - - @Test - public fun `Given EventMeta When Merchant property is filled Then final generated EventMeta should have Merchant metadata`() { - // Given - val csInfo = createCSInfo() - val appLifecycle = FakeCSAppLifeCycle() - ClickStream.initialize( - CSConfiguration.Builder( - context = app, - info = csInfo, - config = createCSConfig(), - appLifeCycle = appLifecycle - ) - .setDispatcher(coroutineRule.testDispatcher) - .setHealthGateway(fakeHealthGateway) - .build() - ) - val sut = ClickStream.getInstance() - - // When - val event = generateCSMerchantEvent("12") - sut.trackEvent(event, true) - - // Then - assertTrue(event.message.protoName() == "AdCardEvent") - assertTrue((event.message as AdCardEvent).meta.hasMerchant()) - assertTrue((event.message as AdCardEvent).meta.merchant.saudagarId == "1") - assertTrue((event.message as AdCardEvent).meta.merchant.user.role == MerchantUserRole.MERCHANT_USER_ROLE_ADMIN) - assertTrue((event.message as AdCardEvent).meta.merchant.user.signedUpCountry == "ID") - assertTrue((event.message as AdCardEvent).meta.merchant.user.phone == "085") - assertTrue((event.message as AdCardEvent).meta.merchant.user.identity == 12) - assertTrue((event.message as AdCardEvent).meta.merchant.user.email == "test@gmail.com") - assertTrue((event.message as AdCardEvent).meta.hasCustomer().not()) - } - - private fun generateCSMerchantEvent(guid: String): CSEvent { - return CSEvent( - guid = guid, - timestamp = Timestamp.getDefaultInstance(), - message = AdCardEvent.newBuilder() - .setMeta( - EventMeta.newBuilder() - .setApp(App.newBuilder().setVersion("4.35.0")) - .setMerchant( - Merchant.newBuilder() - .setSaudagarId("1") - .setUser( - MerchantUser.newBuilder() - .setRole(MerchantUserRole.MERCHANT_USER_ROLE_ADMIN) - .setSignedUpCountry("ID") - .setPhone("085") - .setIdentity(12) - .setEmail("test@gmail.com") - .build() - ) - .build() - ) - .build() - ) - .build() - ) - } - - private fun createCSInfo(): CSInfo { - return CSInfo( - appInfo = CSAppInfo(appVersion = "4.37.0"), - locationInfo = CSLocationInfo( - latitude = -6.1753924, - longitude = 106.8249641, - s2Ids = emptyMap() - ), sessionInfo = CSSessionInfo(sessionID = "1234"), - deviceInfo = DefaultCSDeviceInfo(), fakeUserInfo() - ) - } -} diff --git a/clickstream/src/test/kotlin/clickstream/extension/CSMessageExtTest.kt b/clickstream/src/test/kotlin/clickstream/extension/CSMessageExtTest.kt index 7071412f..bc1cfe57 100644 --- a/clickstream/src/test/kotlin/clickstream/extension/CSMessageExtTest.kt +++ b/clickstream/src/test/kotlin/clickstream/extension/CSMessageExtTest.kt @@ -1,10 +1,7 @@ package clickstream.extension -import com.gojek.clickstream.products.common.* -import com.gojek.clickstream.products.telemetry.Protocol -import com.gojek.clickstream.products.telemetry.PubSubHealth -import com.gojek.clickstream.products.telemetry.QOS -import com.gojek.clickstream.products.telemetry.Topic +import clickstream.proto.App +import clickstream.proto.User import org.junit.Test internal class CSMessageExtTest { @@ -12,60 +9,47 @@ internal class CSMessageExtTest { @Test fun `Given proto with basic data types as field check if toFlatMap returns valid map`() { - val address = Address.newBuilder().apply { - id = "1" - label = "home address" - pillPosition = 5 - changedAddressSourceOnUi = true - locationDetails = "location details" + val user = User.newBuilder().apply { + guid = "Some Guid" + name = "John Doe" + age = 35 + gender = "male" + phoneNumber = 1234567890 + email = "john.doe@example.com" }.build() - val addressMap = address.toFlatMap() + val userMap = user.toFlatMap() - assert(addressMap["id"] == "1") - assert(addressMap["label"] == "home address") - assert(addressMap["pillPosition"] == 5) - assert(addressMap["changedAddressSourceOnUi"] == true) - assert(addressMap["locationDetails"] == "location details") + assert(userMap["guid"] == "Some Guid") + assert(userMap["name"] == "John Doe") + assert(userMap["age"] == 35) + assert(userMap["gender"] == "male") + assert(userMap["phoneNumber"] == 1234567890.toLong()) + assert(userMap["email"] == "john.doe@example.com") } @Test fun `Given proto with a nested proto as field check if toFlatMap returns valid map`() { - val pubSubHealth = PubSubHealth.newBuilder().apply { - val topic = Topic.newBuilder() - .setTopic("test topic") - .setQosValue(QOS.QOS_ZERO_VALUE) - .build() + val pubSubHealth = User.newBuilder().apply { + guid = "Some Guid" + name = "John Doe" + val appProto = App.newBuilder().apply { + version = "0.0.1" + packageName = "com.clickstream" + }.build() - setTopic(topic) - protocol = Protocol.PROTOCOL_MQTT - appType = AppType.Consumer + app = appProto - }.build() - pubSubHealth.toFlatMap().run { - assert(get("topic.topic") == "test topic") - assert(get("topic.qos") == QOS.QOS_ZERO_VALUE) - assert(get("protocol") == Protocol.PROTOCOL_MQTT.ordinal) - assert(get("appType") == AppType.Consumer.ordinal) - } - } - - @Test - fun `Given proto with nested proto and list type as field check if toFlatMap returns valid map`() { - val originalBadgeList = listOf("badge1", "badge2") - val apiParameter = Outlet.newBuilder().apply { - addAllBadges(originalBadgeList) }.build() - apiParameter.toFlatMap().run { - val badgesList = get("badges") - assert(badgesList is List<*>) - (badgesList as List<*>).forEachIndexed { index, badge -> - assert(badge is String && badge == originalBadgeList[index]) - } + pubSubHealth.toFlatMap().run { + assert(get("app.version") == "0.0.1") + assert(get("app.packageName") == "com.clickstream") + assert(get("guid") == "Some Guid") + assert(get("name") == "John Doe") } } } \ No newline at end of file diff --git a/clickstream/src/test/kotlin/clickstream/fake/FakeCSHealthEventFactory.kt b/clickstream/src/test/kotlin/clickstream/fake/FakeCSHealthEventFactory.kt deleted file mode 100644 index 6ebc051a..00000000 --- a/clickstream/src/test/kotlin/clickstream/fake/FakeCSHealthEventFactory.kt +++ /dev/null @@ -1,10 +0,0 @@ -package clickstream.fake - -import clickstream.health.intermediate.CSHealthEventFactory -import com.gojek.clickstream.internal.Health - -internal class FakeCSHealthEventFactory : CSHealthEventFactory { - override suspend fun create(message: Health): Health { - return message - } -} \ No newline at end of file diff --git a/clickstream/src/test/kotlin/clickstream/fake/FakeCSMetaProvider.kt b/clickstream/src/test/kotlin/clickstream/fake/FakeCSMetaProvider.kt index d6421e89..f8a2b2d4 100644 --- a/clickstream/src/test/kotlin/clickstream/fake/FakeCSMetaProvider.kt +++ b/clickstream/src/test/kotlin/clickstream/fake/FakeCSMetaProvider.kt @@ -1,7 +1,7 @@ package clickstream.fake import clickstream.api.CSMetaProvider -import com.gojek.clickstream.internal.HealthMeta +import clickstream.health.proto.HealthMeta internal class FakeCSMetaProvider : CSMetaProvider { override suspend fun location(): HealthMeta.Location { diff --git a/clickstream/src/test/kotlin/clickstream/fake/FakeEventWrapperData.kt b/clickstream/src/test/kotlin/clickstream/fake/FakeEventWrapperData.kt index 2cb66763..687b8c17 100644 --- a/clickstream/src/test/kotlin/clickstream/fake/FakeEventWrapperData.kt +++ b/clickstream/src/test/kotlin/clickstream/fake/FakeEventWrapperData.kt @@ -2,14 +2,9 @@ package clickstream.fake import clickstream.internal.utils.CSTimeStampMessageBuilder import clickstream.model.CSEvent -import com.gojek.clickstream.common.Customer -import com.gojek.clickstream.common.Device -import com.gojek.clickstream.common.Location -import com.gojek.clickstream.common.Session -import com.gojek.clickstream.products.common.ServiceInfo -import com.gojek.clickstream.products.events.AdCardEvent -import com.gojek.clickstream.products.events.AdCardType -import com.gojek.clickstream.products.shuffle.ShuffleCard +import clickstream.proto.App +import clickstream.proto.Device +import clickstream.proto.User import java.util.UUID /** @@ -17,24 +12,28 @@ import java.util.UUID * with default data every time invoked. */ public fun defaultEventWrapperData(): CSEvent { - val event = AdCardEvent.newBuilder().apply { - meta = meta.toBuilder().apply { - val objectID = UUID.randomUUID().toString() - eventGuid = objectID - eventTimestamp = CSTimeStampMessageBuilder.build(System.currentTimeMillis()) - location = Location.getDefaultInstance() - device = Device.getDefaultInstance() - customer = Customer.getDefaultInstance() - session = Session.getDefaultInstance() + val event = User.newBuilder().apply { + guid = "Some Guid" + name = "John Doe" + age = 35 + gender = "male" + phoneNumber = 1234567890 + email = "john.doe@example.com" + app = App.newBuilder().apply { + version = "0.0.1" + packageName = "com.clickstream" + }.build() + device = Device.newBuilder().apply { + operatingSystem = "android" + operatingSystemVersion = "29" + deviceMake = "Samsung" + deviceModel = "SM2028" }.build() - type = AdCardType.Clicked - shuffleCard = ShuffleCard.getDefaultInstance() - serviceInfo = ServiceInfo.getDefaultInstance() }.build() return CSEvent( - guid = event.meta.eventGuid, - timestamp = event.eventTimestamp, + guid = UUID.randomUUID().toString(), + timestamp = CSTimeStampMessageBuilder.build(System.currentTimeMillis()), message = event ) } diff --git a/clickstream/src/test/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessorTest.kt b/clickstream/src/test/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessorTest.kt index 7edadf23..cb552f00 100644 --- a/clickstream/src/test/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessorTest.kt +++ b/clickstream/src/test/kotlin/clickstream/health/internal/DefaultCSHealthEventProcessorTest.kt @@ -93,7 +93,6 @@ public class DefaultCSHealthEventProcessorTest { assertTrue(event.healthMeta.session.sessionId == fakeCSInfo.sessionInfo.sessionID) assertTrue(event.numberOfBatches == fakeCSHealthEventDTOs.map { it.eventBatchGuid }.size.toLong()) assertTrue(event.numberOfEvents == fakeCSHealthEventDTOs.map { it.eventGuid }.size.toLong()) - assertFalse(event.traceDetails.hasErrorDetails()) } } } @@ -122,8 +121,6 @@ public class DefaultCSHealthEventProcessorTest { assertTrue(event.healthMeta.session.sessionId == fakeCSInfo.sessionInfo.sessionID) assertTrue(event.numberOfBatches == 0L) assertTrue(event.numberOfEvents == 1L) - assertTrue(event.traceDetails.errorDetails.reason == fakeCSHealthEventDTOs[index].error) - assertTrue(event.traceDetails.timeToConnection == fakeCSHealthEventDTOs[index].timeToConnection.toString()) } } } diff --git a/clickstream/src/test/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSHealthEventFactoryTest.kt b/clickstream/src/test/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSHealthEventFactoryTest.kt index a4ec596a..af0b4af9 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSHealthEventFactoryTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/eventprocessor/impl/DefaultCSHealthEventFactoryTest.kt @@ -5,14 +5,14 @@ import clickstream.extension.protoName import clickstream.health.time.CSTimeStampGenerator import clickstream.health.identity.CSGuIdGenerator import clickstream.health.internal.DefaultCSHealthEventFactory -import com.gojek.clickstream.internal.Health -import com.gojek.clickstream.internal.HealthDetails -import com.gojek.clickstream.internal.HealthMeta -import com.gojek.clickstream.internal.HealthMeta.App -import com.gojek.clickstream.internal.HealthMeta.Customer -import com.gojek.clickstream.internal.HealthMeta.Device -import com.gojek.clickstream.internal.HealthMeta.Location -import com.gojek.clickstream.internal.HealthMeta.Session +import clickstream.health.proto.Health +import clickstream.health.proto.HealthDetails +import clickstream.health.proto.HealthMeta.Location +import clickstream.health.proto.HealthMeta.Device +import clickstream.health.proto.HealthMeta.App +import clickstream.health.proto.HealthMeta.Customer +import clickstream.health.proto.HealthMeta.Session +import clickstream.health.proto.HealthMeta.newBuilder import kotlinx.coroutines.runBlocking import org.junit.Assert.assertTrue import org.junit.Before @@ -82,7 +82,7 @@ public class DefaultCSHealthEventFactoryTest { .build() ) .setHealthMeta( - HealthMeta.newBuilder() + newBuilder() .setEventGuid("123456") .build() ) diff --git a/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundEventSchedulerTest.kt b/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundEventSchedulerTest.kt index dc8646a5..c4cd632f 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundEventSchedulerTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundEventSchedulerTest.kt @@ -16,8 +16,8 @@ import clickstream.internal.utils.CSBatteryStatusObserver import clickstream.internal.utils.CSNetworkStatusObserver import clickstream.logger.CSLogLevel import clickstream.logger.CSLogger +import clickstream.proto.User import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.products.events.AdCardEvent import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.times import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -75,14 +75,14 @@ public class CSBackgroundEventSchedulerTest { @Test public fun `verify flushEvents`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEventData( eventGuid = "1", eventRequestGuid = "2", eventTimeStamp = 3L, isOnGoing = true, - messageAsBytes = adCardEvent.toByteArray(), - messageName = adCardEvent.messageName() + messageAsBytes = userEvent.toByteArray(), + messageName = userEvent.messageName() ) val events = listOf(event) diff --git a/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundSchedulerTest.kt b/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundSchedulerTest.kt index 2cd651e6..dea3d3c3 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundSchedulerTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSBackgroundSchedulerTest.kt @@ -18,6 +18,7 @@ import clickstream.health.intermediate.CSEventHealthListener import clickstream.health.intermediate.CSHealthEventProcessor import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSEventHealth +import clickstream.health.proto.Health import clickstream.health.time.CSEventGeneratedTimestampListener import clickstream.health.time.CSTimeStampGenerator import clickstream.internal.di.CSServiceLocator @@ -28,9 +29,8 @@ import clickstream.internal.utils.CSNetworkStatusObserver import clickstream.lifecycle.CSBackgroundLifecycleManager import clickstream.logger.CSLogLevel import clickstream.logger.CSLogger +import clickstream.proto.User import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.internal.Health -import com.gojek.clickstream.products.events.AdCardEvent import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.never import com.nhaarman.mockitokotlin2.times @@ -145,14 +145,14 @@ public class CSBackgroundSchedulerTest { @Test public fun `Given one event exists When scheduler is called Then One event will be forwarded to network layer`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEventData( eventGuid = "1", eventRequestGuid = "2", eventTimeStamp = 3L, isOnGoing = true, - messageAsBytes = adCardEvent.toByteArray(), - messageName = adCardEvent.messageName() + messageAsBytes = userEvent.toByteArray(), + messageName = userEvent.messageName() ) whenever(networkStatusObserver.isNetworkAvailable()).thenReturn(true) @@ -171,14 +171,14 @@ public class CSBackgroundSchedulerTest { @Test public fun `Given multiple events exists When scheduler is called Then Multiple event will be sent to network layer`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEventData( eventGuid = "1", eventRequestGuid = "2", eventTimeStamp = 3L, isOnGoing = true, - messageAsBytes = adCardEvent.toByteArray(), - messageName = adCardEvent.messageName() + messageAsBytes = userEvent.toByteArray(), + messageName = userEvent.messageName() ) whenever(networkStatusObserver.isNetworkAvailable()).thenReturn(true) @@ -215,14 +215,14 @@ public class CSBackgroundSchedulerTest { @Test public fun `Given one health event and one event exists When scheduler is called Then both will be forwarded to network layer`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEventData( eventGuid = "1", eventRequestGuid = "2", eventTimeStamp = 3L, isOnGoing = true, - messageAsBytes = adCardEvent.toByteArray(), - messageName = adCardEvent.messageName() + messageAsBytes = userEvent.toByteArray(), + messageName = userEvent.messageName() ) val health = Health.newBuilder().build() @@ -242,14 +242,14 @@ public class CSBackgroundSchedulerTest { @Test public fun `Given multiple health and app event exists When scheduler is called Then All will be forwarded to network layer`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEventData( eventGuid = "1", eventRequestGuid = "2", eventTimeStamp = 3L, isOnGoing = true, - messageAsBytes = adCardEvent.toByteArray(), - messageName = adCardEvent.messageName() + messageAsBytes = userEvent.toByteArray(), + messageName = userEvent.messageName() ) val health = Health.newBuilder().build() diff --git a/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSForegroundEventSchedulerTest.kt b/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSForegroundEventSchedulerTest.kt index 690443b2..33130e09 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSForegroundEventSchedulerTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/eventscheduler/CSForegroundEventSchedulerTest.kt @@ -20,8 +20,8 @@ import clickstream.internal.utils.CSResult import clickstream.logger.CSLogLevel import clickstream.logger.CSLogger import clickstream.model.CSEvent +import clickstream.proto.User import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.products.events.AdCardEvent import com.google.protobuf.Timestamp import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.never @@ -95,14 +95,14 @@ public class CSForegroundEventSchedulerTest { @Test public fun `Given an AdCard Event When app state is active Then verify event should went to network manager`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEventData( eventGuid = "1", eventRequestGuid = "2", eventTimeStamp = 3L, isOnGoing = true, - messageAsBytes = adCardEvent.toByteArray(), - messageName = adCardEvent.messageName() + messageAsBytes = userEvent.toByteArray(), + messageName = userEvent.messageName() ) whenever(eventRepository.getEventDataList()) @@ -175,11 +175,11 @@ public class CSForegroundEventSchedulerTest { @Test public fun `verify scheduleEvent`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEvent( guid = "1", timestamp = Timestamp.getDefaultInstance(), - message = adCardEvent + message = userEvent ) sut.scheduleEvent(event) @@ -203,11 +203,11 @@ public class CSForegroundEventSchedulerTest { @Test public fun `verify sendInstantEvent`() { coroutineRule.testDispatcher.runBlockingTest { - val adCardEvent = AdCardEvent.newBuilder().build() + val userEvent = User.newBuilder().build() val event = CSEvent( guid = "1", timestamp = Timestamp.getDefaultInstance(), - message = adCardEvent + message = userEvent ) whenever(timeStampGenerator.getTimeStamp()) diff --git a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSConnectionDroppedTest.kt b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSConnectionDroppedTest.kt index 2342d9ea..6d76a4cc 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSConnectionDroppedTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSConnectionDroppedTest.kt @@ -1,19 +1,18 @@ package clickstream.internal.networklayer import clickstream.internal.eventscheduler.CSEventData +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import clickstream.internal.utils.CSFlowStreamAdapterFactory import clickstream.internal.utils.CSTimeStampMessageBuilder import clickstream.model.CSEvent +import clickstream.proto.App +import clickstream.proto.User import clickstream.utils.TestFlowObserver import clickstream.utils.any import clickstream.utils.containingBytes import clickstream.utils.flowTest import clickstream.utils.newWebSocketFactory -import com.gojek.clickstream.common.App -import com.gojek.clickstream.common.EventMeta -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse -import com.gojek.clickstream.products.events.AdCardEvent import com.google.protobuf.Timestamp import com.tinder.scarlet.Lifecycle import com.tinder.scarlet.Scarlet @@ -53,10 +52,10 @@ internal class CSConnectionDroppedTest { public fun send_givenConnectionIsEstablished_shouldBeReceivedByTheServer() { // Given givenConnectionIsEstablished() - val testResponse: TestFlowObserver = server.observeResponse().flowTest() + val testResponse: TestFlowObserver = server.observeResponse().flowTest() - val eventRequest1: EventRequest = generatedEvent("1") - val eventRequest2: EventRequest = generatedEvent("2") + val eventRequest1: SendEventRequest = generatedEvent("1") + val eventRequest2: SendEventRequest = generatedEvent("2") // When val event1 = client.sendEvent(eventRequest1) @@ -71,7 +70,7 @@ internal class CSConnectionDroppedTest { Assertions.assertThat(event4).isTrue Assertions.assertThat(testResponse.values).allSatisfy { e -> - e is EventResponse + e is SendEventResponse } serverLifecycleRegistry.onNext(Lifecycle.State.Stopped.WithReason(ShutdownReason.GRACEFUL)) @@ -86,17 +85,15 @@ internal class CSConnectionDroppedTest { ) } - private fun generatedEvent(guid: String): EventRequest { + private fun generatedEvent(guid: String): SendEventRequest { val event = CSEvent( guid = guid, timestamp = Timestamp.getDefaultInstance(), - message = AdCardEvent.newBuilder() - .setMeta( - EventMeta.newBuilder() - .setApp(App.newBuilder().setVersion("4.35.0")) - .build() - ) - .build() + message = User.newBuilder() + .setApp( + App.newBuilder() + .setVersion("4.35.0") + ).build() ) val (eventData, eventHealthData) = CSEventData.create(event) return transformToEventRequest(eventData = listOf(eventData)) @@ -151,8 +148,8 @@ internal class CSConnectionDroppedTest { ) } - private fun transformToEventRequest(eventData: List): EventRequest { - return EventRequest.newBuilder().apply { + private fun transformToEventRequest(eventData: List): SendEventRequest { + return SendEventRequest.newBuilder().apply { reqGuid = "1011" sentTime = CSTimeStampMessageBuilder.build(System.currentTimeMillis()) addAllEvents(eventData.map { it.event() }) diff --git a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsBatchTimeoutTest.kt b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsBatchTimeoutTest.kt index dc55dac4..641a5124 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsBatchTimeoutTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsBatchTimeoutTest.kt @@ -7,16 +7,16 @@ import clickstream.health.constant.CSEventTypesConstant import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO import clickstream.health.time.CSTimeStampGenerator +import clickstream.internal.networklayer.proto.raccoon.Event +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest import clickstream.internal.utils.CSFlowStreamAdapterFactory import clickstream.logger.CSLogLevel import clickstream.logger.CSLogger +import clickstream.proto.User import clickstream.utils.CoroutineTestRule import clickstream.utils.TestFlowObserver import clickstream.utils.flowTest import clickstream.utils.newWebSocketFactory -import com.gojek.clickstream.de.Event -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.products.events.AdCardEvent import com.google.protobuf.Timestamp import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.times @@ -68,12 +68,12 @@ internal class CSHealthMetricsBatchTimeoutTest { givenConnectionIsEstablished() // When - val eventRequest = EventRequest.newBuilder() + val eventRequest = SendEventRequest.newBuilder() .setReqGuid("1234") .setSentTime(Timestamp.getDefaultInstance()) .addEvents( Event.newBuilder() - .setEventBytes(AdCardEvent.newBuilder().build().toByteString()) + .setEventBytes(User.newBuilder().build().toByteString()) .setType("AdcardEvent") .build() ) diff --git a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionClosedTest.kt b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionClosedTest.kt index 076a0abc..2b53a23f 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionClosedTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionClosedTest.kt @@ -6,9 +6,9 @@ import clickstream.health.constant.CSEventNamesConstant import clickstream.health.constant.CSEventTypesConstant import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.times @@ -86,7 +86,7 @@ internal class CSHealthMetricsConnectionClosedTest { } private class FakeCSEventService : CSEventService { - override fun observeResponse(): Flow { + override fun observeResponse(): Flow { throw IllegalAccessException("broken") } @@ -96,7 +96,7 @@ internal class CSHealthMetricsConnectionClosedTest { } } - override fun sendEvent(streamBatchEvents: EventRequest): Boolean { + override fun sendEvent(streamBatchEvents: SendEventRequest): Boolean { throw IllegalAccessException("broken") } } diff --git a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionFailedTest.kt b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionFailedTest.kt index 1449f26a..a86e6dc7 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionFailedTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionFailedTest.kt @@ -6,9 +6,9 @@ import clickstream.health.constant.CSEventNamesConstant import clickstream.health.constant.CSEventTypesConstant import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.times @@ -88,7 +88,7 @@ internal class CSHealthMetricsConnectionFailedTest { } private class FakeCSEventService : CSEventService { - override fun observeResponse(): Flow { + override fun observeResponse(): Flow { throw IllegalAccessException("broken") } @@ -98,7 +98,7 @@ internal class CSHealthMetricsConnectionFailedTest { } } - override fun sendEvent(streamBatchEvents: EventRequest): Boolean { + override fun sendEvent(streamBatchEvents: SendEventRequest): Boolean { throw IllegalAccessException("broken") } } diff --git a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionOpenedTest.kt b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionOpenedTest.kt index a2b2e22e..b0d21956 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionOpenedTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSHealthMetricsConnectionOpenedTest.kt @@ -6,14 +6,15 @@ import clickstream.health.constant.CSEventNamesConstant import clickstream.health.constant.CSEventTypesConstant import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.model.CSHealthEventDTO +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest +import clickstream.internal.networklayer.proto.raccoon.SendEventResponse import clickstream.utils.CoroutineTestRule -import com.gojek.clickstream.de.EventRequest -import com.gojek.clickstream.de.common.EventResponse import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.times import com.nhaarman.mockitokotlin2.verify import com.tinder.scarlet.WebSocket +import com.tinder.scarlet.ws.Send import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.InternalCoroutinesApi import kotlinx.coroutines.flow.Flow @@ -86,7 +87,7 @@ internal class CSHealthMetricsConnectionOpenedTest { } private class FakeCSEventService : CSEventService { - override fun observeResponse(): Flow { + override fun observeResponse(): Flow { throw IllegalAccessException("broken") } @@ -96,7 +97,7 @@ internal class CSHealthMetricsConnectionOpenedTest { } } - override fun sendEvent(streamBatchEvents: EventRequest): Boolean { + override fun sendEvent(streamBatchEvents: SendEventRequest): Boolean { throw IllegalAccessException("broken") } } diff --git a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSRetryableCallbackTest.kt b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSRetryableCallbackTest.kt index d45ed2e9..b87c7f89 100644 --- a/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSRetryableCallbackTest.kt +++ b/clickstream/src/test/kotlin/clickstream/internal/networklayer/CSRetryableCallbackTest.kt @@ -4,6 +4,7 @@ import clickstream.config.CSNetworkConfig import clickstream.fake.fakeCSInfo import clickstream.health.intermediate.CSHealthEventRepository import clickstream.health.time.CSTimeStampGenerator +import clickstream.internal.networklayer.proto.raccoon.SendEventRequest import clickstream.internal.utils.CSFlowStreamAdapterFactory import clickstream.logger.CSLogLevel.OFF import clickstream.logger.CSLogger @@ -12,7 +13,6 @@ import clickstream.utils.TestFlowObserver import clickstream.utils.any import clickstream.utils.flowTest import clickstream.utils.newWebSocketFactory -import com.gojek.clickstream.de.EventRequest import com.nhaarman.mockitokotlin2.mock import com.tinder.scarlet.Lifecycle import com.tinder.scarlet.Scarlet @@ -57,7 +57,7 @@ public class CSRetryableCallbackTest { givenConnectionIsEstablished() // When - val eventRequest = EventRequest.newBuilder() + val eventRequest = SendEventRequest.newBuilder() .build() // Then diff --git a/clickstream/src/test/kotlin/clickstream/proto/App.java b/clickstream/src/test/kotlin/clickstream/proto/App.java new file mode 100644 index 00000000..97ee92a3 --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/App.java @@ -0,0 +1,498 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: App.proto + +package clickstream.proto; + +/** + *
+ * Corresponds to the details for the app used by the user.
+ * 
+ * + * Protobuf type {@code clickstream.proto.App} + */ +public final class App extends + com.google.protobuf.GeneratedMessageLite< + App, App.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.proto.App) + AppOrBuilder { + private App() { + version_ = ""; + packageName_ = ""; + } + public static final int VERSION_FIELD_NUMBER = 1; + private String version_; + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The version. + */ + @Override + public String getVersion() { + return version_; + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The bytes for version. + */ + @Override + public com.google.protobuf.ByteString + getVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(version_); + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @param value The version to set. + */ + private void setVersion( + String value) { + Class valueClass = value.getClass(); + + version_ = value; + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + */ + private void clearVersion() { + + version_ = getDefaultInstance().getVersion(); + } + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @param value The bytes for version to set. + */ + private void setVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + version_ = value.toStringUtf8(); + + } + + public static final int PACKAGE_NAME_FIELD_NUMBER = 2; + private String packageName_; + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The packageName. + */ + @Override + public String getPackageName() { + return packageName_; + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The bytes for packageName. + */ + @Override + public com.google.protobuf.ByteString + getPackageNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(packageName_); + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @param value The packageName to set. + */ + private void setPackageName( + String value) { + Class valueClass = value.getClass(); + + packageName_ = value; + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + */ + private void clearPackageName() { + + packageName_ = getDefaultInstance().getPackageName(); + } + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @param value The bytes for packageName to set. + */ + private void setPackageNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + packageName_ = value.toStringUtf8(); + + } + + public static App parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static App 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 App parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static App 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 App parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static App parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static App parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static App 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(App prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Corresponds to the details for the app used by the user.
+   * 
+ * + * Protobuf type {@code clickstream.proto.App} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + App, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.proto.App) + AppOrBuilder { + // Construct using com.clickstream.app.proto.App.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @return The version. + */ + @Override + public String getVersion() { + return instance.getVersion(); + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @return The bytes for version. + */ + @Override + public com.google.protobuf.ByteString + getVersionBytes() { + return instance.getVersionBytes(); + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + String value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @return This builder for chaining. + */ + public Builder clearVersion() { + copyOnWrite(); + instance.clearVersion(); + return this; + } + /** + *
+     * Version of the client app. Use this property to send version with every event.
+     * This allows for segmentation based on the app version.
+     * Sample values: "1.0.0", "1.0.1".
+     * 
+ * + * string version = 1; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setVersionBytes(value); + return this; + } + + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @return The packageName. + */ + @Override + public String getPackageName() { + return instance.getPackageName(); + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @return The bytes for packageName. + */ + @Override + public com.google.protobuf.ByteString + getPackageNameBytes() { + return instance.getPackageNameBytes(); + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @param value The packageName to set. + * @return This builder for chaining. + */ + public Builder setPackageName( + String value) { + copyOnWrite(); + instance.setPackageName(value); + return this; + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @return This builder for chaining. + */ + public Builder clearPackageName() { + copyOnWrite(); + instance.clearPackageName(); + return this; + } + /** + *
+     * Package name of the client app. Use this property to send package name with every event.
+     * Sample values: "com.clickstream.app".
+     * 
+ * + * string package_name = 2; + * @param value The bytes for packageName to set. + * @return This builder for chaining. + */ + public Builder setPackageNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPackageNameBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.proto.App) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new App(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "version_", + "packageName_", + }; + String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\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 (App.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:clickstream.proto.App) + private static final App DEFAULT_INSTANCE; + static { + App defaultInstance = new App(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + App.class, defaultInstance); + } + + public static App getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream/src/test/kotlin/clickstream/proto/AppOrBuilder.java b/clickstream/src/test/kotlin/clickstream/proto/AppOrBuilder.java new file mode 100644 index 00000000..0626c1ff --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/AppOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: App.proto + +package clickstream.proto; + +public interface AppOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.proto.App) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The version. + */ + String getVersion(); + /** + *
+   * Version of the client app. Use this property to send version with every event.
+   * This allows for segmentation based on the app version.
+   * Sample values: "1.0.0", "1.0.1".
+   * 
+ * + * string version = 1; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The packageName. + */ + String getPackageName(); + /** + *
+   * Package name of the client app. Use this property to send package name with every event.
+   * Sample values: "com.clickstream.app".
+   * 
+ * + * string package_name = 2; + * @return The bytes for packageName. + */ + com.google.protobuf.ByteString + getPackageNameBytes(); +} diff --git a/clickstream/src/test/kotlin/clickstream/proto/AppProto.java b/clickstream/src/test/kotlin/clickstream/proto/AppProto.java new file mode 100644 index 00000000..127dc4e5 --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/AppProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: App.proto + +package clickstream.proto; + +public final class AppProto { + private AppProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/clickstream/src/test/kotlin/clickstream/proto/Device.java b/clickstream/src/test/kotlin/clickstream/proto/Device.java new file mode 100644 index 00000000..e1e87e53 --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/Device.java @@ -0,0 +1,784 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Device.proto + +package clickstream.proto; + +/** + *
+ * Corresponds to the device being used by the customer. Holds the respective details for the device under use.
+ * 
+ * + * Protobuf type {@code clickstream.proto.Device} + */ +public final class Device extends + com.google.protobuf.GeneratedMessageLite< + Device, Device.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.proto.Device) + DeviceOrBuilder { + private Device() { + operatingSystem_ = ""; + operatingSystemVersion_ = ""; + deviceMake_ = ""; + deviceModel_ = ""; + } + public static final int OPERATING_SYSTEM_FIELD_NUMBER = 1; + private String operatingSystem_; + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The operatingSystem. + */ + @Override + public String getOperatingSystem() { + return operatingSystem_; + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(operatingSystem_); + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @param value The operatingSystem to set. + */ + private void setOperatingSystem( + String value) { + Class valueClass = value.getClass(); + + operatingSystem_ = value; + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + */ + private void clearOperatingSystem() { + + operatingSystem_ = getDefaultInstance().getOperatingSystem(); + } + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @param value The bytes for operatingSystem to set. + */ + private void setOperatingSystemBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + operatingSystem_ = value.toStringUtf8(); + + } + + public static final int OPERATING_SYSTEM_VERSION_FIELD_NUMBER = 2; + private String operatingSystemVersion_; + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + @Override + public String getOperatingSystemVersion() { + return operatingSystemVersion_; + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(operatingSystemVersion_); + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @param value The operatingSystemVersion to set. + */ + private void setOperatingSystemVersion( + String value) { + Class valueClass = value.getClass(); + + operatingSystemVersion_ = value; + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + */ + private void clearOperatingSystemVersion() { + + operatingSystemVersion_ = getDefaultInstance().getOperatingSystemVersion(); + } + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @param value The bytes for operatingSystemVersion to set. + */ + private void setOperatingSystemVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + operatingSystemVersion_ = value.toStringUtf8(); + + } + + public static final int DEVICE_MAKE_FIELD_NUMBER = 3; + private String deviceMake_; + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The deviceMake. + */ + @Override + public String getDeviceMake() { + return deviceMake_; + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The bytes for deviceMake. + */ + @Override + public com.google.protobuf.ByteString + getDeviceMakeBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceMake_); + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @param value The deviceMake to set. + */ + private void setDeviceMake( + String value) { + Class valueClass = value.getClass(); + + deviceMake_ = value; + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + */ + private void clearDeviceMake() { + + deviceMake_ = getDefaultInstance().getDeviceMake(); + } + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @param value The bytes for deviceMake to set. + */ + private void setDeviceMakeBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceMake_ = value.toStringUtf8(); + + } + + public static final int DEVICE_MODEL_FIELD_NUMBER = 4; + private String deviceModel_; + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The deviceModel. + */ + @Override + public String getDeviceModel() { + return deviceModel_; + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The bytes for deviceModel. + */ + @Override + public com.google.protobuf.ByteString + getDeviceModelBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceModel_); + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @param value The deviceModel to set. + */ + private void setDeviceModel( + String value) { + Class valueClass = value.getClass(); + + deviceModel_ = value; + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + */ + private void clearDeviceModel() { + + deviceModel_ = getDefaultInstance().getDeviceModel(); + } + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @param value The bytes for deviceModel to set. + */ + private void setDeviceModelBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceModel_ = value.toStringUtf8(); + + } + + public static Device parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static Device 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 Device parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Device 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 Device parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static Device parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static Device parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static Device 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(Device prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Corresponds to the device being used by the customer. Holds the respective details for the device under use.
+   * 
+ * + * Protobuf type {@code clickstream.proto.Device} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Device, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.proto.Device) + DeviceOrBuilder { + // Construct using com.clickstream.app.proto.Device.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @return The operatingSystem. + */ + @Override + public String getOperatingSystem() { + return instance.getOperatingSystem(); + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemBytes() { + return instance.getOperatingSystemBytes(); + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @param value The operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystem( + String value) { + copyOnWrite(); + instance.setOperatingSystem(value); + return this; + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @return This builder for chaining. + */ + public Builder clearOperatingSystem() { + copyOnWrite(); + instance.clearOperatingSystem(); + return this; + } + /** + *
+     * Operating system of the device.
+     * Sample values: "iOS", "Android".
+     * 
+ * + * string operating_system = 1; + * @param value The bytes for operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOperatingSystemBytes(value); + return this; + } + + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + @Override + public String getOperatingSystemVersion() { + return instance.getOperatingSystemVersion(); + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + @Override + public com.google.protobuf.ByteString + getOperatingSystemVersionBytes() { + return instance.getOperatingSystemVersionBytes(); + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @param value The operatingSystemVersion to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemVersion( + String value) { + copyOnWrite(); + instance.setOperatingSystemVersion(value); + return this; + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @return This builder for chaining. + */ + public Builder clearOperatingSystemVersion() { + copyOnWrite(); + instance.clearOperatingSystemVersion(); + return this; + } + /** + *
+     * Version of the Operating system.
+     * Sample values: "29", "15.1".
+     * 
+ * + * string operating_system_version = 2; + * @param value The bytes for operatingSystemVersion to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOperatingSystemVersionBytes(value); + return this; + } + + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @return The deviceMake. + */ + @Override + public String getDeviceMake() { + return instance.getDeviceMake(); + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @return The bytes for deviceMake. + */ + @Override + public com.google.protobuf.ByteString + getDeviceMakeBytes() { + return instance.getDeviceMakeBytes(); + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @param value The deviceMake to set. + * @return This builder for chaining. + */ + public Builder setDeviceMake( + String value) { + copyOnWrite(); + instance.setDeviceMake(value); + return this; + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @return This builder for chaining. + */ + public Builder clearDeviceMake() { + copyOnWrite(); + instance.clearDeviceMake(); + return this; + } + /** + *
+     * Device manufacturer name.
+     * Sample values: "Samsung", "HMD Global", "Apple"
+     * 
+ * + * string device_make = 3; + * @param value The bytes for deviceMake to set. + * @return This builder for chaining. + */ + public Builder setDeviceMakeBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceMakeBytes(value); + return this; + } + + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @return The deviceModel. + */ + @Override + public String getDeviceModel() { + return instance.getDeviceModel(); + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @return The bytes for deviceModel. + */ + @Override + public com.google.protobuf.ByteString + getDeviceModelBytes() { + return instance.getDeviceModelBytes(); + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @param value The deviceModel to set. + * @return This builder for chaining. + */ + public Builder setDeviceModel( + String value) { + copyOnWrite(); + instance.setDeviceModel(value); + return this; + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceModel() { + copyOnWrite(); + instance.clearDeviceModel(); + return this; + } + /** + *
+     * Device model information.
+     * Sample values: "iPhone 11", "Samsung M90".
+     * 
+ * + * string device_model = 4; + * @param value The bytes for deviceModel to set. + * @return This builder for chaining. + */ + public Builder setDeviceModelBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceModelBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.proto.Device) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new Device(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "operatingSystem_", + "operatingSystemVersion_", + "deviceMake_", + "deviceModel_", + }; + String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208\u0004\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 (Device.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:clickstream.proto.Device) + private static final Device DEFAULT_INSTANCE; + static { + Device defaultInstance = new Device(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Device.class, defaultInstance); + } + + public static Device getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream/src/test/kotlin/clickstream/proto/DeviceOrBuilder.java b/clickstream/src/test/kotlin/clickstream/proto/DeviceOrBuilder.java new file mode 100644 index 00000000..d8060a6e --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/DeviceOrBuilder.java @@ -0,0 +1,97 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Device.proto + +package clickstream.proto; + +public interface DeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.proto.Device) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The operatingSystem. + */ + String getOperatingSystem(); + /** + *
+   * Operating system of the device.
+   * Sample values: "iOS", "Android".
+   * 
+ * + * string operating_system = 1; + * @return The bytes for operatingSystem. + */ + com.google.protobuf.ByteString + getOperatingSystemBytes(); + + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The operatingSystemVersion. + */ + String getOperatingSystemVersion(); + /** + *
+   * Version of the Operating system.
+   * Sample values: "29", "15.1".
+   * 
+ * + * string operating_system_version = 2; + * @return The bytes for operatingSystemVersion. + */ + com.google.protobuf.ByteString + getOperatingSystemVersionBytes(); + + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The deviceMake. + */ + String getDeviceMake(); + /** + *
+   * Device manufacturer name.
+   * Sample values: "Samsung", "HMD Global", "Apple"
+   * 
+ * + * string device_make = 3; + * @return The bytes for deviceMake. + */ + com.google.protobuf.ByteString + getDeviceMakeBytes(); + + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The deviceModel. + */ + String getDeviceModel(); + /** + *
+   * Device model information.
+   * Sample values: "iPhone 11", "Samsung M90".
+   * 
+ * + * string device_model = 4; + * @return The bytes for deviceModel. + */ + com.google.protobuf.ByteString + getDeviceModelBytes(); +} diff --git a/clickstream/src/test/kotlin/clickstream/proto/DeviceProto.java b/clickstream/src/test/kotlin/clickstream/proto/DeviceProto.java new file mode 100644 index 00000000..504da281 --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/DeviceProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Device.proto + +package clickstream.proto; + +public final class DeviceProto { + private DeviceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/clickstream/src/test/kotlin/clickstream/proto/User.java b/clickstream/src/test/kotlin/clickstream/proto/User.java new file mode 100644 index 00000000..bc892c82 --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/User.java @@ -0,0 +1,1316 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package clickstream.proto; + +/** + *
+ * Corresponds to the details for the user.
+ * 
+ * + * Protobuf type {@code clickstream.proto.User} + */ +public final class User extends + com.google.protobuf.GeneratedMessageLite< + User, User.Builder> implements + // @@protoc_insertion_point(message_implements:clickstream.proto.User) + UserOrBuilder { + private User() { + guid_ = ""; + name_ = ""; + gender_ = ""; + email_ = ""; + } + public static final int GUID_FIELD_NUMBER = 1; + private String guid_; + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The guid. + */ + @Override + public String getGuid() { + return guid_; + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The bytes for guid. + */ + @Override + public com.google.protobuf.ByteString + getGuidBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(guid_); + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @param value The guid to set. + */ + private void setGuid( + String value) { + Class valueClass = value.getClass(); + + guid_ = value; + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + */ + private void clearGuid() { + + guid_ = getDefaultInstance().getGuid(); + } + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @param value The bytes for guid to set. + */ + private void setGuidBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + guid_ = value.toStringUtf8(); + + } + + public static final int NAME_FIELD_NUMBER = 2; + private String name_; + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The name. + */ + @Override + public String getName() { + return name_; + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @Override + public com.google.protobuf.ByteString + getNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(name_); + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @param value The name to set. + */ + private void setName( + String value) { + Class valueClass = value.getClass(); + + name_ = value; + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + */ + private void clearName() { + + name_ = getDefaultInstance().getName(); + } + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @param value The bytes for name to set. + */ + private void setNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + name_ = value.toStringUtf8(); + + } + + public static final int AGE_FIELD_NUMBER = 3; + private int age_; + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + * @return The age. + */ + @Override + public int getAge() { + return age_; + } + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + * @param value The age to set. + */ + private void setAge(int value) { + + age_ = value; + } + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + */ + private void clearAge() { + + age_ = 0; + } + + public static final int GENDER_FIELD_NUMBER = 4; + private String gender_; + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The gender. + */ + @Override + public String getGender() { + return gender_; + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The bytes for gender. + */ + @Override + public com.google.protobuf.ByteString + getGenderBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(gender_); + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @param value The gender to set. + */ + private void setGender( + String value) { + Class valueClass = value.getClass(); + + gender_ = value; + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + */ + private void clearGender() { + + gender_ = getDefaultInstance().getGender(); + } + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @param value The bytes for gender to set. + */ + private void setGenderBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + gender_ = value.toStringUtf8(); + + } + + public static final int PHONE_NUMBER_FIELD_NUMBER = 5; + private long phoneNumber_; + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + * @return The phoneNumber. + */ + @Override + public long getPhoneNumber() { + return phoneNumber_; + } + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + * @param value The phoneNumber to set. + */ + private void setPhoneNumber(long value) { + + phoneNumber_ = value; + } + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + */ + private void clearPhoneNumber() { + + phoneNumber_ = 0L; + } + + public static final int EMAIL_FIELD_NUMBER = 6; + private String email_; + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The email. + */ + @Override + public String getEmail() { + return email_; + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The bytes for email. + */ + @Override + public com.google.protobuf.ByteString + getEmailBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(email_); + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @param value The email to set. + */ + private void setEmail( + String value) { + Class valueClass = value.getClass(); + + email_ = value; + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + */ + private void clearEmail() { + + email_ = getDefaultInstance().getEmail(); + } + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @param value The bytes for email to set. + */ + private void setEmailBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + email_ = value.toStringUtf8(); + + } + + public static final int APP_FIELD_NUMBER = 7; + private App app_; + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public boolean hasApp() { + return app_ != null; + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public App getApp() { + return app_ == null ? App.getDefaultInstance() : app_; + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + private void setApp(App value) { + value.getClass(); + app_ = value; + + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeApp(App value) { + value.getClass(); + if (app_ != null && + app_ != App.getDefaultInstance()) { + app_ = + App.newBuilder(app_).mergeFrom(value).buildPartial(); + } else { + app_ = value; + } + + } + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + */ + private void clearApp() { app_ = null; + + } + + public static final int DEVICE_FIELD_NUMBER = 8; + private Device device_; + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public boolean hasDevice() { + return device_ != null; + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public Device getDevice() { + return device_ == null ? Device.getDefaultInstance() : device_; + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + private void setDevice(Device value) { + value.getClass(); + device_ = value; + + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeDevice(Device value) { + value.getClass(); + if (device_ != null && + device_ != Device.getDefaultInstance()) { + device_ = + Device.newBuilder(device_).mergeFrom(value).buildPartial(); + } else { + device_ = value; + } + + } + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + */ + private void clearDevice() { device_ = null; + + } + + public static final int DEVICE_TIMESTAMP_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp deviceTimestamp_; + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public boolean hasDeviceTimestamp() { + return deviceTimestamp_ != null; + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public com.google.protobuf.Timestamp getDeviceTimestamp() { + return deviceTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deviceTimestamp_; + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + private void setDeviceTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + deviceTimestamp_ = value; + + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @SuppressWarnings({"ReferenceEquality"}) + private void mergeDeviceTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (deviceTimestamp_ != null && + deviceTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + deviceTimestamp_ = + com.google.protobuf.Timestamp.newBuilder(deviceTimestamp_).mergeFrom(value).buildPartial(); + } else { + deviceTimestamp_ = value; + } + + } + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + private void clearDeviceTimestamp() { deviceTimestamp_ = null; + + } + + public static User parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static User 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 User parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static User 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 User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static User 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 User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static User 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 User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static User parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static User parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static User 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(User prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Corresponds to the details for the user.
+   * 
+ * + * Protobuf type {@code clickstream.proto.User} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + User, Builder> implements + // @@protoc_insertion_point(builder_implements:clickstream.proto.User) + UserOrBuilder { + // Construct using com.clickstream.app.proto.User.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @return The guid. + */ + @Override + public String getGuid() { + return instance.getGuid(); + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @return The bytes for guid. + */ + @Override + public com.google.protobuf.ByteString + getGuidBytes() { + return instance.getGuidBytes(); + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @param value The guid to set. + * @return This builder for chaining. + */ + public Builder setGuid( + String value) { + copyOnWrite(); + instance.setGuid(value); + return this; + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @return This builder for chaining. + */ + public Builder clearGuid() { + copyOnWrite(); + instance.clearGuid(); + return this; + } + /** + *
+     * Unique identy of the user.
+     * 
+ * + * string guid = 1; + * @param value The bytes for guid to set. + * @return This builder for chaining. + */ + public Builder setGuidBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setGuidBytes(value); + return this; + } + + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @return The name. + */ + @Override + public String getName() { + return instance.getName(); + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @Override + public com.google.protobuf.ByteString + getNameBytes() { + return instance.getNameBytes(); + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + String value) { + copyOnWrite(); + instance.setName(value); + return this; + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + copyOnWrite(); + instance.clearName(); + return this; + } + /** + *
+     * User's full name.
+     * 
+ * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNameBytes(value); + return this; + } + + /** + *
+     * User's age.
+     * 
+ * + * int32 age = 3; + * @return The age. + */ + @Override + public int getAge() { + return instance.getAge(); + } + /** + *
+     * User's age.
+     * 
+ * + * int32 age = 3; + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + copyOnWrite(); + instance.setAge(value); + return this; + } + /** + *
+     * User's age.
+     * 
+ * + * int32 age = 3; + * @return This builder for chaining. + */ + public Builder clearAge() { + copyOnWrite(); + instance.clearAge(); + return this; + } + + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @return The gender. + */ + @Override + public String getGender() { + return instance.getGender(); + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @return The bytes for gender. + */ + @Override + public com.google.protobuf.ByteString + getGenderBytes() { + return instance.getGenderBytes(); + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @param value The gender to set. + * @return This builder for chaining. + */ + public Builder setGender( + String value) { + copyOnWrite(); + instance.setGender(value); + return this; + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @return This builder for chaining. + */ + public Builder clearGender() { + copyOnWrite(); + instance.clearGender(); + return this; + } + /** + *
+     * User's gender.
+     * 
+ * + * string gender = 4; + * @param value The bytes for gender to set. + * @return This builder for chaining. + */ + public Builder setGenderBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setGenderBytes(value); + return this; + } + + /** + *
+     * User's phone number.
+     * 
+ * + * int64 phone_number = 5; + * @return The phoneNumber. + */ + @Override + public long getPhoneNumber() { + return instance.getPhoneNumber(); + } + /** + *
+     * User's phone number.
+     * 
+ * + * int64 phone_number = 5; + * @param value The phoneNumber to set. + * @return This builder for chaining. + */ + public Builder setPhoneNumber(long value) { + copyOnWrite(); + instance.setPhoneNumber(value); + return this; + } + /** + *
+     * User's phone number.
+     * 
+ * + * int64 phone_number = 5; + * @return This builder for chaining. + */ + public Builder clearPhoneNumber() { + copyOnWrite(); + instance.clearPhoneNumber(); + return this; + } + + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @return The email. + */ + @Override + public String getEmail() { + return instance.getEmail(); + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @return The bytes for email. + */ + @Override + public com.google.protobuf.ByteString + getEmailBytes() { + return instance.getEmailBytes(); + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail( + String value) { + copyOnWrite(); + instance.setEmail(value); + return this; + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @return This builder for chaining. + */ + public Builder clearEmail() { + copyOnWrite(); + instance.clearEmail(); + return this; + } + /** + *
+     * User's email address.
+     * 
+ * + * string email = 6; + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEmailBytes(value); + return this; + } + + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public boolean hasApp() { + return instance.hasApp(); + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + @Override + public App getApp() { + return instance.getApp(); + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder setApp(App value) { + copyOnWrite(); + instance.setApp(value); + return this; + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder setApp( + App.Builder builderForValue) { + copyOnWrite(); + instance.setApp(builderForValue.build()); + return this; + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder mergeApp(App value) { + copyOnWrite(); + instance.mergeApp(value); + return this; + } + /** + *
+     * User's app details.
+     * 
+ * + * .clickstream.proto.App app = 7; + */ + public Builder clearApp() { copyOnWrite(); + instance.clearApp(); + return this; + } + + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public boolean hasDevice() { + return instance.hasDevice(); + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + @Override + public Device getDevice() { + return instance.getDevice(); + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder setDevice(Device value) { + copyOnWrite(); + instance.setDevice(value); + return this; + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder setDevice( + Device.Builder builderForValue) { + copyOnWrite(); + instance.setDevice(builderForValue.build()); + return this; + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder mergeDevice(Device value) { + copyOnWrite(); + instance.mergeDevice(value); + return this; + } + /** + *
+     * User's device details.
+     * 
+ * + * .clickstream.proto.Device device = 8; + */ + public Builder clearDevice() { copyOnWrite(); + instance.clearDevice(); + return this; + } + + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public boolean hasDeviceTimestamp() { + return instance.hasDeviceTimestamp(); + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + @Override + public com.google.protobuf.Timestamp getDeviceTimestamp() { + return instance.getDeviceTimestamp(); + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder setDeviceTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setDeviceTimestamp(value); + return this; + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder setDeviceTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setDeviceTimestamp(builderForValue.build()); + return this; + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder mergeDeviceTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeDeviceTimestamp(value); + return this; + } + /** + *
+     * Timestamp for the event.
+     * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + */ + public Builder clearDeviceTimestamp() { copyOnWrite(); + instance.clearDeviceTimestamp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:clickstream.proto.User) + } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) + protected final Object dynamicMethod( + MethodToInvoke method, + Object arg0, Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new User(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "guid_", + "name_", + "age_", + "gender_", + "phoneNumber_", + "email_", + "app_", + "device_", + "deviceTimestamp_", + }; + String info = + "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0000\u0000\u0001\u0208\u0002\u0208\u0003\u0004" + + "\u0004\u0208\u0005\u0002\u0006\u0208\u0007\t\b\t\t\t"; + 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 (User.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:clickstream.proto.User) + private static final User DEFAULT_INSTANCE; + static { + User defaultInstance = new User(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + User.class, defaultInstance); + } + + public static User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/clickstream/src/test/kotlin/clickstream/proto/UserOrBuilder.java b/clickstream/src/test/kotlin/clickstream/proto/UserOrBuilder.java new file mode 100644 index 00000000..3c604a4c --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/UserOrBuilder.java @@ -0,0 +1,166 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package clickstream.proto; + +public interface UserOrBuilder extends + // @@protoc_insertion_point(interface_extends:clickstream.proto.User) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The guid. + */ + String getGuid(); + /** + *
+   * Unique identy of the user.
+   * 
+ * + * string guid = 1; + * @return The bytes for guid. + */ + com.google.protobuf.ByteString + getGuidBytes(); + + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The name. + */ + String getName(); + /** + *
+   * User's full name.
+   * 
+ * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * User's age.
+   * 
+ * + * int32 age = 3; + * @return The age. + */ + int getAge(); + + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The gender. + */ + String getGender(); + /** + *
+   * User's gender.
+   * 
+ * + * string gender = 4; + * @return The bytes for gender. + */ + com.google.protobuf.ByteString + getGenderBytes(); + + /** + *
+   * User's phone number.
+   * 
+ * + * int64 phone_number = 5; + * @return The phoneNumber. + */ + long getPhoneNumber(); + + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The email. + */ + String getEmail(); + /** + *
+   * User's email address.
+   * 
+ * + * string email = 6; + * @return The bytes for email. + */ + com.google.protobuf.ByteString + getEmailBytes(); + + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + * @return Whether the app field is set. + */ + boolean hasApp(); + /** + *
+   * User's app details.
+   * 
+ * + * .clickstream.proto.App app = 7; + * @return The app. + */ + App getApp(); + + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + * @return Whether the device field is set. + */ + boolean hasDevice(); + /** + *
+   * User's device details.
+   * 
+ * + * .clickstream.proto.Device device = 8; + * @return The device. + */ + Device getDevice(); + + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + * @return Whether the deviceTimestamp field is set. + */ + boolean hasDeviceTimestamp(); + /** + *
+   * Timestamp for the event.
+   * 
+ * + * .google.protobuf.Timestamp device_timestamp = 9; + * @return The deviceTimestamp. + */ + com.google.protobuf.Timestamp getDeviceTimestamp(); +} diff --git a/clickstream/src/test/kotlin/clickstream/proto/UserProto.java b/clickstream/src/test/kotlin/clickstream/proto/UserProto.java new file mode 100644 index 00000000..f41bdc21 --- /dev/null +++ b/clickstream/src/test/kotlin/clickstream/proto/UserProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package clickstream.proto; + +public final class UserProto { + private UserProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/libs/proto-sdk-1.18.6.jar b/libs/proto-sdk-1.18.6.jar deleted file mode 100644 index 501f270f..00000000 Binary files a/libs/proto-sdk-1.18.6.jar and /dev/null differ diff --git a/protos/client/App.proto b/protos/client/App.proto new file mode 100644 index 00000000..c911352c --- /dev/null +++ b/protos/client/App.proto @@ -0,0 +1,28 @@ + +syntax = "proto3"; + +package clickstream.proto; + +option java_multiple_files = true; +option java_package = "com.clickstream.app.proto"; +option java_outer_classname = "AppProto"; + + +// +// Corresponds to the details for the app used by the user. +// +message App { + + // + // Version of the client app. Use this property to send version with every event. + // This allows for segmentation based on the app version. + // Sample values: "1.0.0", "1.0.1". + // + string version = 1; + + // + // Package name of the client app. Use this property to send package name with every event. + // Sample values: "com.clickstream.app". + // + string package_name = 2; +} \ No newline at end of file diff --git a/protos/client/Device.proto b/protos/client/Device.proto new file mode 100644 index 00000000..68e7b6f5 --- /dev/null +++ b/protos/client/Device.proto @@ -0,0 +1,38 @@ + +syntax = "proto3"; + +package clickstream.proto; + +option java_multiple_files = true; +option java_package = "com.clickstream.app.proto"; +option java_outer_classname = "DeviceProto"; + +// +// Corresponds to the device being used by the customer. Holds the respective details for the device under use. +// +message Device { + + // + // Operating system of the device. + // Sample values: "iOS", "Android". + // + string operating_system = 1; + + // + // Version of the Operating system. + // Sample values: "29", "15.1". + // + string operating_system_version = 2; + + // + // Device manufacturer name. + // Sample values: "Samsung", "HMD Global", "Apple" + // + string device_make = 3; + + // + // Device model information. + // Sample values: "iPhone 11", "Samsung M90". + // + string device_model = 4; +} \ No newline at end of file diff --git a/protos/client/User.proto b/protos/client/User.proto new file mode 100644 index 00000000..ccaa42d3 --- /dev/null +++ b/protos/client/User.proto @@ -0,0 +1,64 @@ + +syntax = "proto3"; + +package clickstream.proto; + +option java_multiple_files = true; +option java_package = "com.clickstream.app.proto"; +option java_outer_classname = "UserProto"; + + +import "App.proto"; +import "Device.proto"; +import "google/protobuf/timestamp.proto"; + +// +// Corresponds to the details for the user. +// +message User { + + // + // Unique identy of the user. + // + string guid = 1; + + // + // User's full name. + // + string name = 2; + + // + // User's age. + // + int32 age = 3; + + // + // User's gender. + // + string gender = 4; + + // + // User's phone number. + // + int64 phone_number = 5; + + // + // User's email address. + // + string email = 6; + + // + // User's app details. + // + App app = 7; + + // + // User's device details. + // + Device device = 8; + + // + // Timestamp for the event. + // + google.protobuf.Timestamp device_timestamp = 9; +} diff --git a/protos/health/Health.proto b/protos/health/Health.proto new file mode 100644 index 00000000..df75fa3c --- /dev/null +++ b/protos/health/Health.proto @@ -0,0 +1,40 @@ +//platform="ios,android" +syntax = "proto3"; + +package clickstream.health.proto; + +option java_multiple_files = true; +option java_package = "clickstream.health.proto"; +option java_outer_classname = "HealthProto"; + +option go_package = "source.golabs.io/mobile/clickstream-go-proto/sdk-internal/clickstream"; + +import "HealthMeta.proto"; +import "google/protobuf/timestamp.proto"; + +message HealthDetails { + // Array of event guids. + repeated string event_guids = 1; + // Array of event batch guids. + repeated string event_batch_guids = 2; +} + +message Health { + + // Name of the health event. + string event_name = 1; + // Health details, captured by the SDK when the mode is verbose. + HealthDetails healthDetails = 2; + // Number of events tracked. + int64 number_of_events = 3; + // Number of event batches tracked. + int64 number_of_batches = 4; + + // Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden. + google.protobuf.Timestamp event_timestamp = 101; + // Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden. + + clickstream.health.proto.HealthMeta healthMeta = 103; + // Note: Auto-filled by the ClickStream SDK, need not be set by the products for every event! If set, will be overridden. + google.protobuf.Timestamp device_timestamp = 104; +} \ No newline at end of file diff --git a/protos/health/HealthMeta.proto b/protos/health/HealthMeta.proto new file mode 100644 index 00000000..f62ad7a4 --- /dev/null +++ b/protos/health/HealthMeta.proto @@ -0,0 +1,49 @@ +//platform="ios,android" +syntax = "proto3"; + +package clickstream.health.proto; + +option java_multiple_files = true; +option java_package = "clickstream.health.proto"; +option java_outer_classname = "HealthMetaProto"; + +option go_package = "source.golabs.io/mobile/clickstream-go-proto/sdk-internal/clickstream"; + +message HealthMeta { + + message App { + string version = 1; + } + + message Customer { + string signed_up_country = 1; + string current_country = 2; + int32 identity = 3; + string email = 4; + } + + message Device { + string operating_system = 1; + string operating_system_version = 2; + string device_make = 3; + string device_model = 4; + } + + message Location { + double latitude = 1; + double longitude = 2; + } + + message Session { + string session_id = 1; + } + + string event_guid = 1; + + Location location = 4; + Customer customer = 5; + Device device = 6; + Session session = 7; + App app = 8; +} + diff --git a/settings.gradle b/settings.gradle index 84fe6b9e..6c005b65 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,5 +13,6 @@ include ':clickstream-event-listener' include ':clickstream-event-visualiser-ui' include ':clickstream-event-visualiser-noop' include ':clickstream-event-visualiser-ui-noop' +include ':clickstream-health-proto' enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")