package com.snap.kit.sdk.model;

import X.C1989Poo;
import X.PBO;
import X.Q1J;
import com.bytedance.covode.number.Covode;
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;
import java.util.List;

public final class SnapKitStorySnapViews extends Message<SnapKitStorySnapViews, Builder> {
    public static final ProtoAdapter<SnapKitStorySnapViews> ADAPTER = new ProtoAdapter_SnapKitStorySnapViews();
    public static final long serialVersionUID = 0;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 3)
    public final String app_id;
    @WireField(adapter = "com.squareup.wire.ProtoAdapter#STRING", tag = 2)
    public final String client_id;
    @WireField(adapter = "com.snap.kit.common.model.DeviceEnvironmentInfo#ADAPTER", tag = 1)
    public final C1989Poo device_environment_info;
    @WireField(adapter = "com.snap.kit.sdk.model.SnapKitStorySnapView#ADAPTER", label = WireField.Label.REPEATED, tag = 4)
    public final List<SnapKitStorySnapView> views;

    public static final class ProtoAdapter_SnapKitStorySnapViews extends ProtoAdapter<SnapKitStorySnapViews> {
        static {
            Covode.recordClassIndex(47362);
        }

        public ProtoAdapter_SnapKitStorySnapViews() {
            super(FieldEncoding.LENGTH_DELIMITED, SnapKitStorySnapViews.class);
        }

        public final int encodedSize(SnapKitStorySnapViews snapKitStorySnapViews) {
            return C1989Poo.ADAPTER.encodedSizeWithTag(1, snapKitStorySnapViews.device_environment_info) + ProtoAdapter.STRING.encodedSizeWithTag(2, snapKitStorySnapViews.client_id) + ProtoAdapter.STRING.encodedSizeWithTag(3, snapKitStorySnapViews.app_id) + SnapKitStorySnapView.ADAPTER.asRepeated().encodedSizeWithTag(4, snapKitStorySnapViews.views) + snapKitStorySnapViews.unknownFields().size();
        }

        public final SnapKitStorySnapViews redact(SnapKitStorySnapViews snapKitStorySnapViews) {
            Builder newBuilder = snapKitStorySnapViews.newBuilder();
            if (newBuilder.device_environment_info != null) {
                newBuilder.device_environment_info = C1989Poo.ADAPTER.redact(newBuilder.device_environment_info);
            }
            PBO.LIZ(newBuilder.views, SnapKitStorySnapView.ADAPTER);
            newBuilder.clearUnknownFields();
            return newBuilder.build();
        }

        public final SnapKitStorySnapViews 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 == 1) {
                    builder.device_environment_info(C1989Poo.ADAPTER.decode(protoReader));
                } else if (nextTag == 2) {
                    builder.client_id(ProtoAdapter.STRING.decode(protoReader));
                } else if (nextTag == 3) {
                    builder.app_id(ProtoAdapter.STRING.decode(protoReader));
                } else if (nextTag != 4) {
                    FieldEncoding peekFieldEncoding = protoReader.peekFieldEncoding();
                    builder.addUnknownField(nextTag, peekFieldEncoding, peekFieldEncoding.rawProtoAdapter().decode(protoReader));
                } else {
                    builder.views.add(SnapKitStorySnapView.ADAPTER.decode(protoReader));
                }
            }
        }

        public final void encode(ProtoWriter protoWriter, SnapKitStorySnapViews snapKitStorySnapViews) {
            C1989Poo.ADAPTER.encodeWithTag(protoWriter, 1, snapKitStorySnapViews.device_environment_info);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 2, snapKitStorySnapViews.client_id);
            ProtoAdapter.STRING.encodeWithTag(protoWriter, 3, snapKitStorySnapViews.app_id);
            SnapKitStorySnapView.ADAPTER.asRepeated().encodeWithTag(protoWriter, 4, snapKitStorySnapViews.views);
            protoWriter.writeBytes(snapKitStorySnapViews.unknownFields());
        }
    }

    static {
        Covode.recordClassIndex(47360);
    }

    public static final class Builder extends Message.Builder<SnapKitStorySnapViews, Builder> {
        public String app_id;
        public String client_id;
        public C1989Poo device_environment_info;
        public List<SnapKitStorySnapView> views = PBO.LIZ();

        static {
            Covode.recordClassIndex(47361);
        }

        public final SnapKitStorySnapViews build() {
            return new SnapKitStorySnapViews(this.device_environment_info, this.client_id, this.app_id, this.views, buildUnknownFields());
        }

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

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

        public final Builder device_environment_info(C1989Poo poo) {
            this.device_environment_info = poo;
            return this;
        }

        public final Builder views(List<SnapKitStorySnapView> list) {
            PBO.LIZ((List<?>) list);
            this.views = list;
            return this;
        }
    }

    public final int hashCode() {
        int i;
        int i2;
        int i3 = this.hashCode;
        if (i3 != 0) {
            return i3;
        }
        int hashCode = unknownFields().hashCode() * 37;
        C1989Poo poo = this.device_environment_info;
        int i4 = 0;
        if (poo != null) {
            i = poo.hashCode();
        } else {
            i = 0;
        }
        int i5 = (hashCode + i) * 37;
        String str = this.client_id;
        if (str != null) {
            i2 = str.hashCode();
        } else {
            i2 = 0;
        }
        int i6 = (i5 + i2) * 37;
        String str2 = this.app_id;
        if (str2 != null) {
            i4 = str2.hashCode();
        }
        int hashCode2 = ((i6 + i4) * 37) + this.views.hashCode();
        this.hashCode = hashCode2;
        return hashCode2;
    }

    public final Builder newBuilder() {
        Builder builder = new Builder();
        builder.device_environment_info = this.device_environment_info;
        builder.client_id = this.client_id;
        builder.app_id = this.app_id;
        builder.views = PBO.LIZ("views", this.views);
        builder.addUnknownFields(unknownFields());
        return builder;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder();
        if (this.device_environment_info != null) {
            sb.append(", device_environment_info=");
            sb.append(this.device_environment_info);
        }
        if (this.client_id != null) {
            sb.append(", client_id=");
            sb.append(this.client_id);
        }
        if (this.app_id != null) {
            sb.append(", app_id=");
            sb.append(this.app_id);
        }
        if (!this.views.isEmpty()) {
            sb.append(", views=");
            sb.append(this.views);
        }
        sb.replace(0, 2, "SnapKitStorySnapViews{");
        sb.append('}');
        return sb.toString();
    }

    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof SnapKitStorySnapViews)) {
            return false;
        }
        SnapKitStorySnapViews snapKitStorySnapViews = (SnapKitStorySnapViews) obj;
        if (!unknownFields().equals(snapKitStorySnapViews.unknownFields()) || !PBO.LIZ((Object) this.device_environment_info, (Object) snapKitStorySnapViews.device_environment_info) || !PBO.LIZ((Object) this.client_id, (Object) snapKitStorySnapViews.client_id) || !PBO.LIZ((Object) this.app_id, (Object) snapKitStorySnapViews.app_id) || !this.views.equals(snapKitStorySnapViews.views)) {
            return false;
        }
        return true;
    }

    /* JADX WARNING: Illegal instructions before constructor call */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public SnapKitStorySnapViews(X.C1989Poo r7, java.lang.String r8, java.lang.String r9, java.util.List<com.snap.kit.sdk.model.SnapKitStorySnapView> r10) {
        /*
            r6 = this;
            X.Q1J r5 = X.Q1J.EMPTY
            r0 = r6
            r2 = r8
            r1 = r7
            r4 = r10
            r3 = r9
            r0.<init>(r1, r2, r3, r4, r5)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.snap.kit.sdk.model.SnapKitStorySnapViews.<init>(X.Poo, java.lang.String, java.lang.String, java.util.List):void");
    }

    public SnapKitStorySnapViews(C1989Poo poo, String str, String str2, List<SnapKitStorySnapView> list, Q1J q1j) {
        super(ADAPTER, q1j);
        this.device_environment_info = poo;
        this.client_id = str;
        this.app_id = str2;
        this.views = PBO.LIZIZ("views", list);
    }
}
