// Code generated by Wire protocol buffer compiler, do not edit.
// Source file: protos-repo/mcs.proto
package org.microg.gms.gcm.mcs;

import com.squareup.wire.Message;
import com.squareup.wire.ProtoField;
import java.util.Collections;
import java.util.List;

import static com.squareup.wire.Message.Datatype.STRING;
import static com.squareup.wire.Message.Label.REPEATED;

/**
 * Included in IQ sent after LoginResponse from server with ID 12.
 */
public final class SelectiveAck extends Message {

  public static final List<String> DEFAULT_ID = Collections.emptyList();

  @ProtoField(tag = 1, type = STRING, label = REPEATED)
  public final List<String> id;

  public SelectiveAck(List<String> id) {
    this.id = immutableCopyOf(id);
  }

  private SelectiveAck(Builder builder) {
    this(builder.id);
    setBuilder(builder);
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof SelectiveAck)) return false;
    return equals(id, ((SelectiveAck) other).id);
  }

  @Override
  public int hashCode() {
    int result = hashCode;
    return result != 0 ? result : (hashCode = id != null ? id.hashCode() : 1);
  }

  public static final class Builder extends Message.Builder<SelectiveAck> {

    public List<String> id;

    public Builder() {
    }

    public Builder(SelectiveAck message) {
      super(message);
      if (message == null) return;
      this.id = copyOf(message.id);
    }

    public Builder id(List<String> id) {
      this.id = checkForNulls(id);
      return this;
    }

    @Override
    public SelectiveAck build() {
      return new SelectiveAck(this);
    }
  }
}
