github.com/cbroglie/openapi2proto@v0.0.0-20171004221549-76b8501da882/fixtures/spec.proto (about)

     1  syntax = "proto3";
     2  
     3  import "google/protobuf/empty.proto";
     4  
     5  package uberapi;
     6  
     7  message GetEstimatesPriceRequest {
     8      // Latitude component of end location.
     9      double end_latitude = 1;
    10      // Longitude component of end location.
    11      double end_longitude = 2;
    12      // Latitude component of start location.
    13      double start_latitude = 3;
    14      // Longitude component of start location.
    15      double start_longitude = 4;
    16  }
    17  
    18  message GetEstimatesPriceResponse {
    19      repeated PriceEstimate items = 1;
    20  }
    21  
    22  message GetEstimatesTimeRequest {
    23      // Unique customer identifier to be used for experience customization.
    24      string customer_uuid = 1;
    25      // Unique identifier representing a specific product for a given latitude & longitude.
    26      string product_id = 2;
    27      // Latitude component of start location.
    28      double start_latitude = 3;
    29      // Longitude component of start location.
    30      double start_longitude = 4;
    31  }
    32  
    33  message GetEstimatesTimeResponse {
    34      repeated Product items = 1;
    35  }
    36  
    37  message GetHistoryRequest {
    38      // Number of items to retrieve. Default is 5, maximum is 100.
    39      int32 limit = 1;
    40      // Offset the list of returned results by this amount. Default is zero.
    41      int32 offset = 2;
    42  }
    43  
    44  message PutMeRequest {
    45      Profile profile = 1;
    46  }
    47  
    48  message GetProductsRequest {
    49      // Latitude component of location.
    50      double latitude = 1;
    51      // Longitude component of location.
    52      double longitude = 2;
    53  }
    54  
    55  message GetProductsResponse {
    56      repeated Product items = 1;
    57  }
    58  
    59  message Activities {
    60      // Total number of items available.
    61      int32 count = 1;
    62      repeated Activity history = 2;
    63      // Number of items to retrieve (100 max).
    64      int32 limit = 3;
    65      // Position in pagination.
    66      int32 offset = 4;
    67  }
    68  
    69  message Activity {
    70      // Unique identifier for the activity
    71      string uuid = 1;
    72  }
    73  
    74  message Error {
    75      int32 code = 1;
    76      string fields = 2;
    77      string message = 3;
    78  }
    79  
    80  message PriceEstimate {
    81      // [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.
    82      string currency_code = 1;
    83      // Display name of product.
    84      string display_name = 2;
    85      // Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
    86      string estimate = 3;
    87      // Upper bound of the estimated price.
    88      double high_estimate = 4;
    89      // Lower bound of the estimated price.
    90      double low_estimate = 5;
    91      // Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles
    92      string product_id = 6;
    93      // Expected surge multipflier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
    94      double surge_multiplier = 7;
    95  }
    96  
    97  message Product {
    98      // Capacity of product. For example, 4 people.
    99      string capacity = 1;
   100      // Description of product.
   101      string description = 2;
   102      // Display name of product.
   103      string display_name = 3;
   104      // Image URL representing the product.
   105      string image = 4;
   106      // Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
   107      string product_id = 5;
   108  }
   109  
   110  message Profile {
   111      // Email address of the Uber user
   112      string email = 1;
   113      // First name of the Uber user.
   114      string first_name = 2;
   115      // Last name of the Uber user.
   116      string last_name = 3;
   117      // Image URL of the Uber user.
   118      string picture = 4;
   119      // Promo code of the Uber user.
   120      string promo_code = 5;
   121  }
   122  
   123  service UberAPIService {
   124      // Price Estimates
   125      // 
   126      // The Price Estimates endpoint returns an estimated price range
   127      // for each product offered at a given location. The price estimate is
   128      // provided as a formatted string with the full price range and the localized
   129      // currency symbol.<br><br>The response also includes low and high estimates,
   130      // and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for
   131      // situations requiring currency conversion. When surge is active for a particular
   132      // product, its surge_multiplier will be greater than 1, but the price estimate
   133      // already factors in this multiplier.
   134      rpc GetEstimatesPrice(GetEstimatesPriceRequest) returns (GetEstimatesPriceResponse) {}
   135      // Time Estimates
   136      // 
   137      // The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.
   138      rpc GetEstimatesTime(GetEstimatesTimeRequest) returns (GetEstimatesTimeResponse) {}
   139      // User Activity
   140      // 
   141      // The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
   142      rpc GetHistory(GetHistoryRequest) returns (Activities) {}
   143      // User Profile
   144      // 
   145      // The User Profile endpoint returns information about the Uber user that has authorized with the application.
   146      rpc GetMe(google.protobuf.Empty) returns (Profile) {}
   147      // Save User Profile
   148      // 
   149      // The User Profile endpoint returns information about the Uber user that has authorized with the application.
   150      rpc PutMe(PutMeRequest) returns (Profile) {}
   151      // Product Types
   152      // 
   153      // The Products endpoint returns information about the *Uber* products
   154      // offered at a given location. The response includes the display name
   155      // and other details about each product, and lists the products in the
   156      // proper display order.
   157      rpc GetProducts(GetProductsRequest) returns (GetProductsResponse) {}
   158  }