carsales.proto 2.49 KB
// Copyright (c) 2013, Kenton Varda <temporal@gmail.com>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package capnp.benchmark.protobuf;

message ParkingLot {
  repeated Car car = 1;
}

message TotalValue {
  required uint64 amount = 1;
}

message Car {
  optional string make = 1;
  optional string model = 2;
  optional Color color = 3;
  optional uint32 seats = 4;
  optional uint32 doors = 5;
  repeated Wheel wheel = 6;
  optional uint32 length = 7;
  optional uint32 width = 8;
  optional uint32 height = 9;
  optional uint32 weight = 10;
  optional Engine engine = 11;
  optional float fuel_capacity = 12;
  optional float fuel_level = 13;
  optional bool has_power_windows = 14;
  optional bool has_power_steering = 15;
  optional bool has_cruise_control = 16;
  optional uint32 cup_holders = 17;
  optional bool has_nav_system = 18;
}

enum Color {
  BLACK = 0;
  WHITE = 1;
  RED = 2;
  GREEN = 3;
  BLUE = 4;
  CYAN = 5;
  MAGENTA = 6;
  YELLOW = 7;
  SILVER = 8;
}

message Wheel {
  optional uint32 diameter = 1;
  optional float air_pressure = 2;
  optional bool snow_tires = 3;
}

message Engine {
  optional uint32 horsepower = 1;
  optional uint32 cylinders = 2;
  optional uint32 cc = 3;
  optional bool uses_gas = 4;
  optional bool uses_electric = 5;
}