package ThingModel.Proto;
option java_package = "org.thingmodel.proto";
option java_outer_classname = "ProtoProperty";

message Property {

	required int32 string_key = 1;

	enum Type {
		LOCATION_POINT = 0;
		LOCATION_LATLNG = 1;
		LOCATION_EQUATORIAL = 2;
		STRING = 3;
		DOUBLE = 4;
		INT = 5;
		BOOLEAN = 6;
		DATETIME = 7;
	}

	required Type type = 2 [default = STRING];

	message Location {

		required double x = 1 [default = 0.0];
		required double y = 2 [default = 0.0];
		optional double z = 3 [default = 0.0];

		// WGS84 by default
		optional int32 string_system = 4;

		// When the z attribute is not present
		optional bool z_null = 5 [default = false];
	}

	message String {
		optional string value = 1;

		/**
		 *	A string can be cached using StringDeclaration
		 *	It's just an option, and a developer
		 *	is allowed to ignore this feature
		 *	when he want to send a string property.
		 */
		optional int32 string_value = 2 [default = 0];	
	}

	optional Location location_value = 3;
	optional String string_value = 4;
	optional double double_value = 5;
	optional sint32 int_value = 6;
	optional bool boolean_value = 7;
	optional int64 datetime_value = 8;


}
