package com.snapchat.kit.sdk.core.metrics.model;

import X.PBO;
import X.Q1J;
import com.bytedance.covode.number.Covode;
import com.bytedance.ugc.glue.monitor.UGCMonitor;
import com.squareup.wire.FieldEncoding;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoAdapter;
import com.squareup.wire.ProtoReader;
import com.squareup.wire.ProtoWriter;
import com.squareup.wire.WireField;

public final class ServerEvent extends Message<ServerEvent, Builder> {
    public static final ProtoAdapter<ServerEvent> ADAPTER = new ProtoAdapter_ServerEvent();
    public static final Long DEFAULT_SEQUENCE_ID = 0L;
    public static final Double DEFAULT_SERVER_TS = Double.valueOf(0.0d);
    public static final long serialVersionUID = 0;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 15)
    public final String app_build;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 14)
    public final String app_version;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 7)
    public final String city;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 6)
    public final String country;
    @WireField(adapter = "com.snapchat.kit.sdk.core.metrics.model.ServerEventData#ADAPTER", tag = 100)
    public final ServerEventData event_data;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 9)
    public final String event_id;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 1)
    public final String event_name;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 10)
    public final String instance_id;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 12)
    public final String os_type;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 13)
    public final String os_version;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 8)
    public final String region;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 2)
    public final String request_id;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#UINT64", tag = 11)
    public final Long sequence_id;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#DOUBLE", tag = 3)
    public final Double server_ts;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 5)
    public final String user_agent;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 4)
    public final String user_id;

    public static final class ProtoAdapter_ServerEvent extends ProtoAdapter<ServerEvent> {
        static {
            Covode.recordClassIndex(47555);
        }

        public ProtoAdapter_ServerEvent() {
            super(FieldEncoding.LENGTH_DELIMITED, ServerEvent.class);
        }

        public final ServerEvent redact(ServerEvent serverEvent) {
            Builder newBuilder = serverEvent.newBuilder();
            if (newBuilder.event_data != null) {
                newBuilder.event_data = (ServerEventData) ServerEventData.ADAPTER.redact(newBuilder.event_data);
            }
            newBuilder.clearUnknownFields();
            return newBuilder.build();
        }

        public final int encodedSize(ServerEvent serverEvent) {
            return ProtoAdapter.STRING.encodedSizeWithTag(1, serverEvent.event_name) + ProtoAdapter.STRING.encodedSizeWithTag(2, serverEvent.request_id) + ProtoAdapter.DOUBLE.encodedSizeWithTag(3, serverEvent.server_ts) + ProtoAdapter.STRING.encodedSizeWithTag(4, serverEvent.user_id) + ProtoAdapter.STRING.encodedSizeWithTag(5, serverEvent.user_agent) + ProtoAdapter.STRING.encodedSizeWithTag(6, serverEvent.country) + ProtoAdapter.STRING.encodedSizeWithTag(7, serverEvent.city) + ProtoAdapter.STRING.encodedSizeWithTag(8, serverEvent.region) + ProtoAdapter.STRING.encodedSizeWithTag(9, serverEvent.event_id) + ProtoAdapter.STRING.encodedSizeWithTag(10, serverEvent.instance_id) + ProtoAdapter.UINT64.encodedSizeWithTag(11, serverEvent.sequence_id) + ProtoAdapter.STRING.encodedSizeWithTag(12, serverEvent.os_type) + ProtoAdapter.STRING.encodedSizeWithTag(13, serverEvent.os_version) + ProtoAdapter.STRING.encodedSizeWithTag(14, serverEvent.app_version) + ProtoAdapter.STRING.encodedSizeWithTag(15, serverEvent.app_build) + ServerEventData.ADAPTER.encodedSizeWithTag(100, serverEvent.event_data) + serverEvent.unknownFields().size();
        }

        public final ServerEvent decode(ProtoReader protoReader) {
            Builder builder = new Builder();
            long beginMessage = protoReader.beginMessage();
            while (true) {
                int nextTag = protoReader.nextTag();
                if (nextTag == -1) {
                    protoReader.endMessage(beginMessage);
                    return builder.build();
                } else if (nextTag != 100) {
                    switch (nextTag) {
                        case 1:
                            builder.event_name((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 2:
                            builder.request_id((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case UGCMonitor.STATUS_RESPONSE:
                            builder.server_ts((Double) ProtoAdapter.DOUBLE.decode(protoReader));
                            break;
                        case UGCMonitor.STATUS_FINISH:
                            builder.user_id((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 5:
                            builder.user_agent((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 6:
                            builder.country((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 7:
                            builder.city((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 8:
                            builder.region((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 9:
                            builder.event_id((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 10:
                            builder.instance_id((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 11:
                            builder.sequence_id((Long) ProtoAdapter.UINT64.decode(protoReader));
                            break;
                        case 12:
                            builder.os_type((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 13:
                            builder.os_version((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 14:
                            builder.app_version((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        case 15:
                            builder.app_build((String) ProtoAdapter.STRING.decode(protoReader));
                            break;
                        default:
                            FieldEncoding peekFieldEncoding = protoReader.peekFieldEncoding();
                            builder.addUnknownField(nextTag, peekFieldEncoding, peekFieldEncoding.rawProtoAdapter().decode(protoReader));
                            break;
                    }
                } else {
                    builder.event_data((ServerEventData) ServerEventData.ADAPTER.decode(protoReader));
                }
            }
        }

        public final void encode(ProtoWriter protoWriter, ServerEvent serverEvent) {
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 1, serverEvent.event_name);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 2, serverEvent.request_id);
            ProtoAdapter.DOUBLE.encodeWithTag(protoWriter, 3, serverEvent.server_ts);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 4, serverEvent.user_id);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 5, serverEvent.user_agent);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 6, serverEvent.country);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 7, serverEvent.city);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 8, serverEvent.region);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 9, serverEvent.event_id);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 10, serverEvent.instance_id);
            ProtoAdapter.UINT64.encodeWithTag(protoWriter, 11, serverEvent.sequence_id);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 12, serverEvent.os_type);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 13, serverEvent.os_version);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 14, serverEvent.app_version);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 15, serverEvent.app_build);
            ServerEventData.ADAPTER.encodeWithTag(protoWriter, 100, serverEvent.event_data);
            protoWriter.writeBytes(serverEvent.unknownFields());
        }
    }

    static {
        Covode.recordClassIndex(47553);
    }

    public static final class Builder extends Message.Builder<ServerEvent, Builder> {
        public String app_build;
        public String app_version;
        public String city;
        public String country;
        public ServerEventData event_data;
        public String event_id;
        public String event_name;
        public String instance_id;
        public String os_type;
        public String os_version;
        public String region;
        public String request_id;
        public Long sequence_id;
        public Double server_ts;
        public String user_agent;
        public String user_id;

        static {
            Covode.recordClassIndex(47554);
        }

        public final ServerEvent build() {
            String str = this.event_name;
            String str2 = this.request_id;
            Double d = this.server_ts;
            String str3 = this.user_id;
            String str4 = this.user_agent;
            String str5 = this.country;
            String str6 = this.city;
            String str7 = this.region;
            String str8 = this.event_id;
            String str9 = this.instance_id;
            Long l = this.sequence_id;
            String str10 = this.os_type;
            String str11 = this.os_version;
            String str12 = this.app_version;
            String str13 = this.app_build;
            return new ServerEvent(str, str2, d, str3, str4, str5, str6, str7, str8, str9, l, str10, str11, str12, str13, this.event_data, buildUnknownFields());
        }

        public final Builder app_build(String str) {
            this.app_build = str;
            return this;
        }

        public final Builder app_version(String str) {
            this.app_version = str;
            return this;
        }

        public final Builder city(String str) {
            this.city = str;
            return this;
        }

        public final Builder country(String str) {
            this.country = str;
            return this;
        }

        public final Builder event_data(ServerEventData serverEventData) {
            this.event_data = serverEventData;
            return this;
        }

        public final Builder event_id(String str) {
            this.event_id = str;
            return this;
        }

        public final Builder event_name(String str) {
            this.event_name = str;
            return this;
        }

        public final Builder instance_id(String str) {
            this.instance_id = str;
            return this;
        }

        public final Builder os_type(String str) {
            this.os_type = str;
            return this;
        }

        public final Builder os_version(String str) {
            this.os_version = str;
            return this;
        }

        public final Builder region(String str) {
            this.region = str;
            return this;
        }

        public final Builder request_id(String str) {
            this.request_id = str;
            return this;
        }

        public final Builder sequence_id(Long l) {
            this.sequence_id = l;
            return this;
        }

        public final Builder server_ts(Double d) {
            this.server_ts = d;
            return this;
        }

        public final Builder user_agent(String str) {
            this.user_agent = str;
            return this;
        }

        public final Builder user_id(String str) {
            this.user_id = str;
            return this;
        }
    }

    public final Builder newBuilder() {
        Builder builder = new Builder();
        builder.event_name = this.event_name;
        builder.request_id = this.request_id;
        builder.server_ts = this.server_ts;
        builder.user_id = this.user_id;
        builder.user_agent = this.user_agent;
        builder.country = this.country;
        builder.city = this.city;
        builder.region = this.region;
        builder.event_id = this.event_id;
        builder.instance_id = this.instance_id;
        builder.sequence_id = this.sequence_id;
        builder.os_type = this.os_type;
        builder.os_version = this.os_version;
        builder.app_version = this.app_version;
        builder.app_build = this.app_build;
        builder.event_data = this.event_data;
        builder.addUnknownFields(unknownFields());
        return builder;
    }

    public final int hashCode() {
        int i;
        int i2;
        int i3;
        int i4;
        int i5;
        int i6;
        int i7;
        int i8;
        int i9;
        int i10;
        int i11;
        int i12;
        int i13;
        int i14;
        int i15;
        int i16 = this.hashCode;
        if (i16 != 0) {
            return i16;
        }
        int hashCode = unknownFields().hashCode() * 37;
        String str = this.event_name;
        int i17 = 0;
        if (str != null) {
            i = str.hashCode();
        } else {
            i = 0;
        }
        int i18 = (hashCode + i) * 37;
        String str2 = this.request_id;
        if (str2 != null) {
            i2 = str2.hashCode();
        } else {
            i2 = 0;
        }
        int i19 = (i18 + i2) * 37;
        Double d = this.server_ts;
        if (d != null) {
            i3 = d.hashCode();
        } else {
            i3 = 0;
        }
        int i20 = (i19 + i3) * 37;
        String str3 = this.user_id;
        if (str3 != null) {
            i4 = str3.hashCode();
        } else {
            i4 = 0;
        }
        int i21 = (i20 + i4) * 37;
        String str4 = this.user_agent;
        if (str4 != null) {
            i5 = str4.hashCode();
        } else {
            i5 = 0;
        }
        int i22 = (i21 + i5) * 37;
        String str5 = this.country;
        if (str5 != null) {
            i6 = str5.hashCode();
        } else {
            i6 = 0;
        }
        int i23 = (i22 + i6) * 37;
        String str6 = this.city;
        if (str6 != null) {
            i7 = str6.hashCode();
        } else {
            i7 = 0;
        }
        int i24 = (i23 + i7) * 37;
        String str7 = this.region;
        if (str7 != null) {
            i8 = str7.hashCode();
        } else {
            i8 = 0;
        }
        int i25 = (i24 + i8) * 37;
        String str8 = this.event_id;
        if (str8 != null) {
            i9 = str8.hashCode();
        } else {
            i9 = 0;
        }
        int i26 = (i25 + i9) * 37;
        String str9 = this.instance_id;
        if (str9 != null) {
            i10 = str9.hashCode();
        } else {
            i10 = 0;
        }
        int i27 = (i26 + i10) * 37;
        Long l = this.sequence_id;
        if (l != null) {
            i11 = l.hashCode();
        } else {
            i11 = 0;
        }
        int i28 = (i27 + i11) * 37;
        String str10 = this.os_type;
        if (str10 != null) {
            i12 = str10.hashCode();
        } else {
            i12 = 0;
        }
        int i29 = (i28 + i12) * 37;
        String str11 = this.os_version;
        if (str11 != null) {
            i13 = str11.hashCode();
        } else {
            i13 = 0;
        }
        int i30 = (i29 + i13) * 37;
        String str12 = this.app_version;
        if (str12 != null) {
            i14 = str12.hashCode();
        } else {
            i14 = 0;
        }
        int i31 = (i30 + i14) * 37;
        String str13 = this.app_build;
        if (str13 != null) {
            i15 = str13.hashCode();
        } else {
            i15 = 0;
        }
        int i32 = (i31 + i15) * 37;
        ServerEventData serverEventData = this.event_data;
        if (serverEventData != null) {
            i17 = serverEventData.hashCode();
        }
        int i33 = i32 + i17;
        this.hashCode = i33;
        return i33;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder();
        if (this.event_name != null) {
            sb.append(", event_name=");
            sb.append(this.event_name);
        }
        if (this.request_id != null) {
            sb.append(", request_id=");
            sb.append(this.request_id);
        }
        if (this.server_ts != null) {
            sb.append(", server_ts=");
            sb.append(this.server_ts);
        }
        if (this.user_id != null) {
            sb.append(", user_id=");
            sb.append(this.user_id);
        }
        if (this.user_agent != null) {
            sb.append(", user_agent=");
            sb.append(this.user_agent);
        }
        if (this.country != null) {
            sb.append(", country=");
            sb.append(this.country);
        }
        if (this.city != null) {
            sb.append(", city=");
            sb.append(this.city);
        }
        if (this.region != null) {
            sb.append(", region=");
            sb.append(this.region);
        }
        if (this.event_id != null) {
            sb.append(", event_id=");
            sb.append(this.event_id);
        }
        if (this.instance_id != null) {
            sb.append(", instance_id=");
            sb.append(this.instance_id);
        }
        if (this.sequence_id != null) {
            sb.append(", sequence_id=");
            sb.append(this.sequence_id);
        }
        if (this.os_type != null) {
            sb.append(", os_type=");
            sb.append(this.os_type);
        }
        if (this.os_version != null) {
            sb.append(", os_version=");
            sb.append(this.os_version);
        }
        if (this.app_version != null) {
            sb.append(", app_version=");
            sb.append(this.app_version);
        }
        if (this.app_build != null) {
            sb.append(", app_build=");
            sb.append(this.app_build);
        }
        if (this.event_data != null) {
            sb.append(", event_data=");
            sb.append(this.event_data);
        }
        sb.replace(0, 2, "ServerEvent{");
        sb.append('}');
        return sb.toString();
    }

    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof ServerEvent)) {
            return false;
        }
        ServerEvent serverEvent = (ServerEvent) obj;
        if (!unknownFields().equals(serverEvent.unknownFields()) || !PBO.LIZ(this.event_name, serverEvent.event_name) || !PBO.LIZ(this.request_id, serverEvent.request_id) || !PBO.LIZ(this.server_ts, serverEvent.server_ts) || !PBO.LIZ(this.user_id, serverEvent.user_id) || !PBO.LIZ(this.user_agent, serverEvent.user_agent) || !PBO.LIZ(this.country, serverEvent.country) || !PBO.LIZ(this.city, serverEvent.city) || !PBO.LIZ(this.region, serverEvent.region) || !PBO.LIZ(this.event_id, serverEvent.event_id) || !PBO.LIZ(this.instance_id, serverEvent.instance_id) || !PBO.LIZ(this.sequence_id, serverEvent.sequence_id) || !PBO.LIZ(this.os_type, serverEvent.os_type) || !PBO.LIZ(this.os_version, serverEvent.os_version) || !PBO.LIZ(this.app_version, serverEvent.app_version) || !PBO.LIZ(this.app_build, serverEvent.app_build) || !PBO.LIZ(this.event_data, serverEvent.event_data)) {
            return false;
        }
        return true;
    }

    /* JADX WARNING: Illegal instructions before constructor call */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public ServerEvent(java.lang.String r19, java.lang.String r20, java.lang.Double r21, java.lang.String r22, java.lang.String r23, java.lang.String r24, java.lang.String r25, java.lang.String r26, java.lang.String r27, java.lang.String r28, java.lang.Long r29, java.lang.String r30, java.lang.String r31, java.lang.String r32, java.lang.String r33, com.snapchat.kit.sdk.core.metrics.model.ServerEventData r34) {
        /*
            r18 = this;
            r0 = r18
            X.Q1J r17 = X.Q1J.EMPTY
            r6 = r24
            r5 = r23
            r4 = r22
            r3 = r21
            r1 = r19
            r2 = r20
            r7 = r25
            r8 = r26
            r9 = r27
            r10 = r28
            r15 = r33
            r16 = r34
            r14 = r32
            r13 = r31
            r12 = r30
            r11 = r29
            r0.<init>(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.snapchat.kit.sdk.core.metrics.model.ServerEvent.<init>(java.lang.String, java.lang.String, java.lang.Double, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.snapchat.kit.sdk.core.metrics.model.ServerEventData):void");
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public ServerEvent(String str, String str2, Double d, String str3, String str4, String str5, String str6, String str7, String str8, String str9, Long l, String str10, String str11, String str12, String str13, ServerEventData serverEventData, Q1J q1j) {
        super(ADAPTER, q1j);
        this.event_name = str;
        this.request_id = str2;
        this.server_ts = d;
        this.user_id = str3;
        this.user_agent = str4;
        this.country = str5;
        this.city = str6;
        this.region = str7;
        this.event_id = str8;
        this.instance_id = str9;
        this.sequence_id = l;
        this.os_type = str10;
        this.os_version = str11;
        this.app_version = str12;
        this.app_build = str13;
        this.event_data = serverEventData;
    }
}
