All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.app.cash.backfila.protos.service.CheckBackfillStatusResponse Maven / Gradle / Ivy

Go to download

Backfila is a service that manages backfill state, calling into other services to do batched work.

There is a newer version: 2024.10.28.205607-fab304f
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: app.cash.backfila.protos.service.CheckBackfillStatusResponse in app/cash/backfila/service.proto
package app.cash.backfila.protos.service;

import com.squareup.wire.EnumAdapter;
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.ReverseProtoWriter;
import com.squareup.wire.Syntax;
import com.squareup.wire.WireEnum;
import com.squareup.wire.WireField;
import com.squareup.wire.internal.Internal;
import java.io.IOException;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import okio.ByteString;

public final class CheckBackfillStatusResponse extends Message {
  public static final ProtoAdapter ADAPTER = new ProtoAdapter_CheckBackfillStatusResponse();

  private static final long serialVersionUID = 0L;

  public static final Status DEFAULT_STATUS = Status.PAUSED;

  @WireField(
      tag = 1,
      adapter = "app.cash.backfila.protos.service.CheckBackfillStatusResponse$Status#ADAPTER"
  )
  public final Status status;

  public CheckBackfillStatusResponse(Status status) {
    this(status, ByteString.EMPTY);
  }

  public CheckBackfillStatusResponse(Status status, ByteString unknownFields) {
    super(ADAPTER, unknownFields);
    this.status = status;
  }

  @Override
  public Builder newBuilder() {
    Builder builder = new Builder();
    builder.status = status;
    builder.addUnknownFields(unknownFields());
    return builder;
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof CheckBackfillStatusResponse)) return false;
    CheckBackfillStatusResponse o = (CheckBackfillStatusResponse) other;
    return unknownFields().equals(o.unknownFields())
        && Internal.equals(status, o.status);
  }

  @Override
  public int hashCode() {
    int result = super.hashCode;
    if (result == 0) {
      result = unknownFields().hashCode();
      result = result * 37 + (status != null ? status.hashCode() : 0);
      super.hashCode = result;
    }
    return result;
  }

  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    if (status != null) builder.append(", status=").append(status);
    return builder.replace(0, 2, "CheckBackfillStatusResponse{").append('}').toString();
  }

  public static final class Builder extends Message.Builder {
    public Status status;

    public Builder() {
    }

    public Builder status(Status status) {
      this.status = status;
      return this;
    }

    @Override
    public CheckBackfillStatusResponse build() {
      return new CheckBackfillStatusResponse(status, super.buildUnknownFields());
    }
  }

  public enum Status implements WireEnum {
    PAUSED(1),

    RUNNING(2),

    COMPLETE(3);

    public static final ProtoAdapter ADAPTER = new ProtoAdapter_Status();

    private final int value;

    Status(int value) {
      this.value = value;
    }

    /**
     * Return the constant for {@code value} or null.
     */
    public static Status fromValue(int value) {
      switch (value) {
        case 1: return PAUSED;
        case 2: return RUNNING;
        case 3: return COMPLETE;
        default: return null;
      }
    }

    @Override
    public int getValue() {
      return value;
    }

    private static final class ProtoAdapter_Status extends EnumAdapter {
      ProtoAdapter_Status() {
        super(Status.class, Syntax.PROTO_2, null);
      }

      @Override
      protected Status fromValue(int value) {
        return Status.fromValue(value);
      }
    }
  }

  private static final class ProtoAdapter_CheckBackfillStatusResponse extends ProtoAdapter {
    public ProtoAdapter_CheckBackfillStatusResponse() {
      super(FieldEncoding.LENGTH_DELIMITED, CheckBackfillStatusResponse.class, "type.googleapis.com/app.cash.backfila.protos.service.CheckBackfillStatusResponse", Syntax.PROTO_2, null, "app/cash/backfila/service.proto");
    }

    @Override
    public int encodedSize(CheckBackfillStatusResponse value) {
      int result = 0;
      result += Status.ADAPTER.encodedSizeWithTag(1, value.status);
      result += value.unknownFields().size();
      return result;
    }

    @Override
    public void encode(ProtoWriter writer, CheckBackfillStatusResponse value) throws IOException {
      Status.ADAPTER.encodeWithTag(writer, 1, value.status);
      writer.writeBytes(value.unknownFields());
    }

    @Override
    public void encode(ReverseProtoWriter writer, CheckBackfillStatusResponse value) throws
        IOException {
      writer.writeBytes(value.unknownFields());
      Status.ADAPTER.encodeWithTag(writer, 1, value.status);
    }

    @Override
    public CheckBackfillStatusResponse decode(ProtoReader reader) throws IOException {
      Builder builder = new Builder();
      long token = reader.beginMessage();
      for (int tag; (tag = reader.nextTag()) != -1;) {
        switch (tag) {
          case 1: {
            try {
              builder.status(Status.ADAPTER.decode(reader));
            } catch (ProtoAdapter.EnumConstantNotFoundException e) {
              builder.addUnknownField(tag, FieldEncoding.VARINT, (long) e.value);
            }
            break;
          }
          default: {
            reader.readUnknownField(tag);
          }
        }
      }
      builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));
      return builder.build();
    }

    @Override
    public CheckBackfillStatusResponse redact(CheckBackfillStatusResponse value) {
      Builder builder = value.newBuilder();
      builder.clearUnknownFields();
      return builder.build();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy