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

     1  syntax = "proto3";
     2  
     3  import "google/protobuf/empty.proto";
     4  
     5  import "google/api/annotations.proto";
     6  
     7  package uberapi;
     8  
     9  message GetEstimatesPriceRequest {
    10      // Latitude component of end location.
    11      double end_latitude = 1;
    12      // Longitude component of end location.
    13      double end_longitude = 2;
    14      // Latitude component of start location.
    15      double start_latitude = 3;
    16      // Longitude component of start location.
    17      double start_longitude = 4;
    18  }
    19  
    20  message GetEstimatesPriceResponse {
    21      repeated PriceEstimate items = 1;
    22  }
    23  
    24  message GetEstimatesTimeRequest {
    25      // Unique customer identifier to be used for experience customization.
    26      string customer_uuid = 1;
    27      // Unique identifier representing a specific product for a given latitude & longitude.
    28      string product_id = 2;
    29      // Latitude component of start location.
    30      double start_latitude = 3;
    31      // Longitude component of start location.
    32      double start_longitude = 4;
    33  }
    34  
    35  message GetEstimatesTimeResponse {
    36      repeated Product items = 1;
    37  }
    38  
    39  message GetHistoryRequest {
    40      // Number of items to retrieve. Default is 5, maximum is 100.
    41      int32 limit = 1;
    42      // Offset the list of returned results by this amount. Default is zero.
    43      int32 offset = 2;
    44  }
    45  
    46  message PutMeRequest {
    47      Profile profile = 1;
    48  }
    49  
    50  message GetProductsRequest {
    51      // Latitude component of location.
    52      double latitude = 1;
    53      // Longitude component of location.
    54      double longitude = 2;
    55  }
    56  
    57  message GetProductsResponse {
    58      repeated Product items = 1;
    59  }
    60  
    61  message Activities {
    62      // Total number of items available.
    63      int32 count = 1;
    64      repeated Activity history = 2;
    65      // Number of items to retrieve (100 max).
    66      int32 limit = 3;
    67      // Position in pagination.
    68      int32 offset = 4;
    69  }
    70  
    71  message Activity {
    72      // Unique identifier for the activity
    73      string uuid = 1;
    74  }
    75  
    76  message Error {
    77      int32 code = 1;
    78      string fields = 2;
    79      string message = 3;
    80  }
    81  
    82  message PriceEstimate {
    83      // [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.
    84      string currency_code = 1;
    85      // Display name of product.
    86      string display_name = 2;
    87      // 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.
    88      string estimate = 3;
    89      // Upper bound of the estimated price.
    90      double high_estimate = 4;
    91      // Lower bound of the estimated price.
    92      double low_estimate = 5;
    93      // 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
    94      string product_id = 6;
    95      // Expected surge multipflier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
    96      double surge_multiplier = 7;
    97  }
    98  
    99  message Product {
   100      // Capacity of product. For example, 4 people.
   101      string capacity = 1;
   102      // Description of product.
   103      string description = 2;
   104      // Display name of product.
   105      string display_name = 3;
   106      // Image URL representing the product.
   107      string image = 4;
   108      // 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.
   109      string product_id = 5;
   110  }
   111  
   112  message Profile {
   113      // Email address of the Uber user
   114      string email = 1;
   115      // First name of the Uber user.
   116      string first_name = 2;
   117      // Last name of the Uber user.
   118      string last_name = 3;
   119      // Image URL of the Uber user.
   120      string picture = 4;
   121      // Promo code of the Uber user.
   122      string promo_code = 5;
   123  }
   124  
   125  service UberAPIService {
   126      // Price Estimates
   127      // 
   128      // The Price Estimates endpoint returns an estimated price range
   129      // for each product offered at a given location. The price estimate is
   130      // provided as a formatted string with the full price range and the localized
   131      // currency symbol.<br><br>The response also includes low and high estimates,
   132      // and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for
   133      // situations requiring currency conversion. When surge is active for a particular
   134      // product, its surge_multiplier will be greater than 1, but the price estimate
   135      // already factors in this multiplier.
   136      rpc GetEstimatesPrice(GetEstimatesPriceRequest) returns (GetEstimatesPriceResponse) {
   137        option (google.api.http) = {
   138          get: "/v1/estimates/price"
   139        };
   140      }
   141      // Time Estimates
   142      // 
   143      // 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.
   144      rpc GetEstimatesTime(GetEstimatesTimeRequest) returns (GetEstimatesTimeResponse) {
   145        option (google.api.http) = {
   146          get: "/v1/estimates/time"
   147        };
   148      }
   149      // User Activity
   150      // 
   151      // 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.
   152      rpc GetHistory(GetHistoryRequest) returns (Activities) {
   153        option (google.api.http) = {
   154          get: "/v1/history"
   155        };
   156      }
   157      // User Profile
   158      // 
   159      // The User Profile endpoint returns information about the Uber user that has authorized with the application.
   160      rpc GetMe(google.protobuf.Empty) returns (Profile) {
   161        option (google.api.http) = {
   162          get: "/v1/me"
   163        };
   164      }
   165      // Save User Profile
   166      // 
   167      // The User Profile endpoint returns information about the Uber user that has authorized with the application.
   168      rpc PutMe(PutMeRequest) returns (Profile) {
   169        option (google.api.http) = {
   170          put: "/v1/me"
   171          body: "profile"
   172        };
   173      }
   174      // Product Types
   175      // 
   176      // The Products endpoint returns information about the *Uber* products
   177      // offered at a given location. The response includes the display name
   178      // and other details about each product, and lists the products in the
   179      // proper display order.
   180      rpc GetProducts(GetProductsRequest) returns (GetProductsResponse) {
   181        option (google.api.http) = {
   182          get: "/v1/products"
   183        };
   184      }
   185  }