github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/_testdata/rules/indentrule/issue_280_mix_lineending.proto (about)

     1  // https://github.com/pseudomuto/protoc-gen-doc/blob/master/examples/proto/Booking.proto
     2  
     3  /**
     4   * Booking related messages.
     5   *
     6   * This file is really just an example. The data model is completely
     7   * fictional.
     8   */
     9  syntax = "proto3";
    10  
    11  package com.example;
    12  
    13  import "google/api/annotations.proto";
    14  import "github.com/mwitkow/go-proto-validators/validator.proto";
    15  
    16  /**
    17   * Represents the booking status ID.
    18   */
    19  message BookingStatusID {
    20    int32 id = 1; /// Unique booking status ID.
    21  }
    22  
    23  /**
    24   * Represents the status of a vehicle booking.
    25   */
    26  message BookingStatus {
    27      int32 id           = 1; /// Unique booking status ID.
    28    string description = 2 [(validator.field) = {string_not_empty: true, length_lt: 255}]; /// Booking status description. E.g. "Active".
    29  }
    30  
    31  /**
    32   * Represents the booking of a vehicle.
    33   *
    34   * Vehicles are some cool shit. But drive carefully!
    35   */
    36  message Booking {
    37    int32 vehicle_id     = 1; /// ID of booked vehicle.
    38    int32 customer_id    = 2; /// Customer that booked the vehicle.
    39    BookingStatus status = 3; /// Status of the booking.
    40  
    41    /** Has booking confirmation been sent? */
    42    bool confirmation_sent = 4;
    43  
    44    /** Has payment been received? */
    45    bool payment_received = 5;
    46  
    47    string color_preference = 6 [deprecated=true]; // Color preference of the customer.
    48  }
    49  
    50  // An empty message for testing
    51  message EmptyBookingMessage {
    52  }
    53  
    54  /**
    55   * Service for handling vehicle bookings.
    56   */
    57  service BookingService {
    58    /// Used to book a vehicle. Pass in a Booking and a BookingStatus will be returned.
    59    rpc BookVehicle (Booking) returns (BookingStatus) {
    60      option (google.api.http) = {
    61        post: "/api/bookings/vehicle/{vehicle_id}"
    62        body: "*"
    63      };
    64    }
    65  
    66    /// Used to subscribe to updates of the BookingStatus.
    67    rpc BookingUpdates (BookingStatusID) returns (stream BookingStatus);
    68  }