syntax = "proto3";
package pgml;

import "google/protobuf/descriptor.proto";

extend google.protobuf.FileOptions {
	optional bool enable = 1091;
}

// Arg is a single argument to a CLI. These are added explicitly to a message
// using the `cli` field.
message Arg {
	// Name of the argument. This is the name of the argument as it appears on the CLI.
    string name = 1;
	// Path is the dotted path to the argument from the root of the message
	// that enables the CLI extension.
    string path = 2;
}

// CLI enables the CLI extension for a message. This is used to add arguments
// to a CLI. Arguments are added explicitly or implicitly.
message CLI {
	// Explicitly added arguments.
    repeated Arg arg = 1;
	// If true, the CLI extension will be enabled for this message. The extension will
	// cause a CLI Pydantic model and parser to be generated for the message.
	bool enable = 2;
}

extend google.protobuf.MessageOptions {
	// Python import path for a class to instantiate using the values
	// of this message.
	string factory = 1091;
    // Map of argument names to paths. The path is the dotted path to the argument
    // from the root of the CLI args class.
    CLI cli = 1092;
}

// Defaults values applied at the field level
extend google.protobuf.FieldOptions {
	// Value specify the default value to set on this field. By default,
	// none is set on a field.
	optional FieldDefaults default = 1171;
	// If true, and builder is set, the field will be treated as a varargs field.
	bool as_varargs = 1172;
}

// FieldDefaults encapsulates the default values for each type of field. Depending on the
// field, the correct set should be used to ensure proper defaults generation.
message FieldDefaults {
	oneof type {
		// Scalar Field Types
		float float = 1;
		double double = 2;
		int32 int32 = 3;
		int64 int64 = 4;
		uint32 uint32 = 5;
		uint64 uint64 = 6;
		sint32 sint32 = 7;
		sint64 sint64 = 8;
		fixed32 fixed32 = 9;
		fixed64 fixed64 = 10;
		sfixed32 sfixed32 = 11;
		sfixed64 sfixed64 = 12;
		bool bool = 13;
		string string = 14;
		bytes bytes = 15;
		string enum = 16;
	}
	reserved 18 to 20;
}
