// PureLife Device Provisioning Protocol, version 1.0 (Draft).
//
// Definitions shared by all `pld-*` endpoints. See the Device Provisioning Protocol (pld-provisioning.html).
//
// Conventions for all PLD protobuf files:
//
//   * Every endpoint has exactly one payload message (`*Payload`) with a
//     `msg` type field and a `oneof` holding the command or response. This
//     mirrors the Espressif endpoints (`prov-config`, `prov-scan`, ...).
//   * Every response carries `status` and `detail` as fields 1 and 2.
//     `detail` MUST be empty when `status` is `STATUS_OK`.
//   * Enum values carry the enum name as prefix. Value 0 is `UNSPECIFIED`
//     where an unset value must be detectable, and `NONE` where "nothing"
//     is the meaningful default (for example "no error").
//   * `optional` is used only where an unset field means "leave unchanged"
//     and must be distinguishable from an empty value. For all other
//     fields the proto3 default (empty string, 0, false) means "not set".
//   * String lengths are given in bytes of the UTF-8 encoding.

syntax = "proto3";

package pld;

// Result of a PLD command. Carried by every response message.
enum Status {
  // Not set. A response with this status is invalid.
  STATUS_UNSPECIFIED = 0;

  // The command succeeded.
  STATUS_OK = 1;

  // A field is missing, malformed or out of range. `detail` names the
  // field.
  STATUS_INVALID_ARGUMENT = 2;

  // The command is not allowed in the current state, for example Finish
  // before Commit.
  STATUS_INVALID_STATE = 3;

  // The Device does not support this command or capability.
  STATUS_NOT_SUPPORTED = 4;

  // An asynchronous operation is still running. Retry later.
  STATUS_BUSY = 5;

  // Any other error inside the Device. `detail` should explain.
  STATUS_INTERNAL_ERROR = 6;
}
