github.com/chrusty/openapi2proto@v0.0.0-20171127225041-f5804f48ccdb/fixtures/books.proto (about) 1 syntax = "proto3"; 2 3 import "google/protobuf/struct.proto"; 4 5 package booksapi; 6 7 message GetListsformatRequest { 8 // YYYY-MM-DD 9 // 10 // The week-ending date for the sales reflected on list-name. Times best-seller lists are compiled using available book sale data. The bestsellers-date may be significantly earlier than published-date. For additional information, see the explanation at the bottom of any best-seller list page on NYTimes.com (example: Hardcover Fiction, published Dec. 5 but reflecting sales to Nov. 29). 11 string bestsellers_date = 1; 12 // YYYY-MM-DD The date the best-seller list was published on NYTimes.com (compare bestsellers-date) 13 string date = 2; 14 enum GetListsformatRequest_Format { 15 GETLISTSFORMATREQUEST_FORMAT_JSON = 0; 16 GETLISTSFORMATREQUEST_FORMAT_JSONP = 1; 17 } 18 GetListsformatRequest_Format format = 3; 19 // International Standard Book Number, 10 or 13 digits 20 string isbn = 4; 21 // The name of the Times best-seller list. To get valid values, use a list names request. 22 // 23 // Be sure to replace spaces with hyphens (e.g., e-book-fiction or hardcover-fiction, not E-Book Fiction or Hardcover Fiction). (The parameter is not case sensitive.) 24 string list = 5; 25 // Sets the starting point of the result set 26 int32 offset = 6; 27 // YYYY-MM-DD 28 // 29 // The date the best-seller list was published on NYTimes.com (compare bestsellers-date) 30 string published_date = 7; 31 // The rank of the best seller on list-name as of bestsellers-date 32 int32 rank = 8; 33 // The rank of the best seller on list-name one week prior to bestsellers-date 34 int32 rank_last_week = 9; 35 // Sets the sort order of the result set 36 enum GetListsformatRequest_Sort_order { 37 GETLISTSFORMATREQUEST_SORT_ORDER_ASC = 0; 38 GETLISTSFORMATREQUEST_SORT_ORDER_DESC = 1; 39 } 40 GetListsformatRequest_Sort_order sort_order = 10; 41 // The number of weeks that the best seller has been on list-name, as of bestsellers-date 42 int32 weeks_on_list = 11; 43 } 44 45 message GetListsformatResponse { 46 string copyright = 1; 47 string last_modified = 2; 48 int32 num_results = 3; 49 message Result { 50 string amazon_product_url = 1; 51 int32 asterisk = 2; 52 string bestsellers_date = 3; 53 message Book_detail { 54 string age_group = 1; 55 string author = 2; 56 string contributor = 3; 57 string contributor_note = 4; 58 string description = 5; 59 int32 price = 6; 60 string primary_isbn10 = 7; 61 string primary_isbn13 = 8; 62 string publisher = 9; 63 string title = 10; 64 } 65 repeated Book_detail book_details = 4; 66 int32 dagger = 5; 67 string display_name = 6; 68 message Isbn { 69 string isbn10 = 1; 70 string isbn13 = 2; 71 } 72 repeated Isbn isbns = 7; 73 string list_name = 8; 74 string published_date = 9; 75 int32 rank = 10; 76 int32 rank_last_week = 11; 77 message Review { 78 string article_chapter_link = 1; 79 string book_review_link = 2; 80 string first_chapter_link = 3; 81 string sunday_review_link = 4; 82 } 83 repeated Review reviews = 12; 84 int32 weeks_on_list = 13; 85 } 86 repeated Result results = 4; 87 string status = 5; 88 } 89 90 message GetListsBestSellersHistoryRequest { 91 // The target age group for the best seller. 92 string age_group = 1; 93 // The author of the best seller. The author field does not include additional contributors (see Data Structure for more details about the author and contributor fields). 94 // 95 // When searching the author field, you can specify any combination of first, middle and last names. 96 // 97 // When sort-by is set to author, the results will be sorted by author's first name. 98 string author = 2; 99 // The author of the best seller, as well as other contributors such as the illustrator (to search or sort by author name only, use author instead). 100 // 101 // When searching, you can specify any combination of first, middle and last names of any of the contributors. 102 // 103 // When sort-by is set to contributor, the results will be sorted by the first name of the first contributor listed. 104 string contributor = 3; 105 // International Standard Book Number, 10 or 13 digits 106 // 107 // A best seller may have both 10-digit and 13-digit ISBNs, and may have multiple ISBNs of each type. To search on multiple ISBNs, separate the ISBNs with semicolons (example: 9780446579933;0061374229). 108 string isbn = 4; 109 // The publisher's list price of the best seller, including decimal point 110 string price = 5; 111 // The standardized name of the publisher 112 string publisher = 6; 113 // The title of the best seller 114 // 115 // When searching, you can specify a portion of a title or a full title. 116 string title = 7; 117 } 118 119 message GetListsBestSellersHistoryResponse { 120 string copyright = 1; 121 int32 num_results = 2; 122 message Result { 123 string age_group = 1; 124 string author = 2; 125 string contributor = 3; 126 string contributor_note = 4; 127 string description = 5; 128 message Isbn { 129 string isbn10 = 1; 130 string isbn13 = 2; 131 } 132 repeated Isbn isbns = 6; 133 int32 price = 7; 134 string publisher = 8; 135 message Ranks_history { 136 int32 asterisk = 1; 137 string bestsellers_date = 2; 138 int32 dagger = 3; 139 string display_name = 4; 140 string list_name = 5; 141 string primary_isbn10 = 6; 142 string primary_isbn13 = 7; 143 string published_date = 8; 144 int32 rank = 9; 145 google.protobuf.NullValue ranks_last_week = 10; 146 int32 weeks_on_list = 11; 147 } 148 repeated Ranks_history ranks_history = 9; 149 message Review { 150 string article_chapter_link = 1; 151 string book_review_link = 2; 152 string first_chapter_link = 3; 153 string sunday_review_link = 4; 154 } 155 repeated Review reviews = 10; 156 string title = 11; 157 } 158 repeated Result results = 3; 159 string status = 4; 160 } 161 162 message GetListsNamesformatRequest { 163 string api_key = 1; 164 enum GetListsNamesformatRequest_Format { 165 GETLISTSNAMESFORMATREQUEST_FORMAT_JSON = 0; 166 GETLISTSNAMESFORMATREQUEST_FORMAT_JSONP = 1; 167 } 168 GetListsNamesformatRequest_Format format = 2; 169 } 170 171 message GetListsNamesformatResponse { 172 string copyright = 1; 173 int32 num_results = 2; 174 message Result { 175 string display_name = 1; 176 string list_name = 2; 177 string list_name_encoded = 3; 178 string newest_published_date = 4; 179 string oldest_published_date = 5; 180 string updated = 6; 181 } 182 repeated Result results = 3; 183 string status = 4; 184 } 185 186 message GetListsOverviewformatRequest { 187 string api_key = 1; 188 enum GetListsOverviewformatRequest_Format { 189 GETLISTSOVERVIEWFORMATREQUEST_FORMAT_JSON = 0; 190 GETLISTSOVERVIEWFORMATREQUEST_FORMAT_JSONP = 1; 191 } 192 GetListsOverviewformatRequest_Format format = 2; 193 // The best-seller list publication date. YYYY-MM-DD 194 // 195 // You do not have to specify the exact date the list was published. The service will search forward (into the future) for the closest publication date to the date you specify. For example, a request for lists/overview/2013-05-22 will retrieve the list that was published on 05-26. 196 // 197 // If you do not include a published_date, the current week's best-sellers lists will be returned. 198 string published_date = 3; 199 } 200 201 message GetListsOverviewformatResponse { 202 string copyright = 1; 203 int32 num_results = 2; 204 message Results { 205 string bestsellers_date = 1; 206 message List { 207 message Book { 208 string age_group = 1; 209 string author = 2; 210 string contributor = 3; 211 string contributor_note = 4; 212 string created_date = 5; 213 string description = 6; 214 int32 price = 7; 215 string primary_isbn10 = 8; 216 string primary_isbn13 = 9; 217 string publisher = 10; 218 int32 rank = 11; 219 string title = 12; 220 string updated_date = 13; 221 } 222 repeated Book books = 1; 223 string display_name = 2; 224 int32 list_id = 3; 225 string list_image = 4; 226 string list_name = 5; 227 string updated = 6; 228 } 229 repeated List lists = 2; 230 string published_date = 3; 231 } 232 Results results = 3; 233 string status = 4; 234 } 235 236 message GetListsDateListRequest { 237 // YYYY-MM-DD 238 // 239 // The week-ending date for the sales reflected on list-name. Times best-seller lists are compiled using available book sale data. The bestsellers-date may be significantly earlier than published-date. For additional information, see the explanation at the bottom of any best-seller list page on NYTimes.com (example: Hardcover Fiction, published Dec. 5 but reflecting sales to Nov. 29). 240 string bestsellers_date = 1; 241 string date = 2; 242 // International Standard Book Number, 10 or 13 digits 243 int32 isbn = 3; 244 // Name of the Best Sellers List. You can get the full list from /lists/names.json 245 string list = 4; 246 // The name of the Times best-seller list. To get valid values, use a list names request. 247 // 248 // Be sure to replace spaces with hyphens (e.g., e-book-fiction or hardcover-fiction, not E-Book Fiction or Hardcover Fiction). (The parameter is not case sensitive.) 249 string list_name = 5; 250 // Sets the starting point of the result set 251 int32 offset = 6; 252 // YYYY-MM-DD 253 // 254 // The date the best-seller list was published on NYTimes.com (compare bestsellers-date) 255 string published_date = 7; 256 // The rank of the best seller on list-name as of bestsellers-date 257 string rank = 8; 258 // The rank of the best seller on list-name one week prior to bestsellers-date 259 int32 rank_last_week = 9; 260 // The default is ASC (ascending). The sort-order parameter is used with the sort-by parameter — for details, see each request type. 261 enum GetListsDateListRequest_Sort_order { 262 GETLISTSDATELISTREQUEST_SORT_ORDER_ASC = 0; 263 GETLISTSDATELISTREQUEST_SORT_ORDER_DESC = 1; 264 } 265 GetListsDateListRequest_Sort_order sort_order = 10; 266 // The number of weeks that the best seller has been on list-name, as of bestsellers-date 267 int32 weeks_on_list = 11; 268 } 269 270 message GetListsDateListResponse { 271 string copyright = 1; 272 string last_modified = 2; 273 int32 num_results = 3; 274 message Results { 275 string bestsellers_date = 1; 276 message Book { 277 string age_group = 1; 278 string amazon_product_url = 2; 279 string article_chapter_link = 3; 280 int32 asterisk = 4; 281 string author = 5; 282 string book_image = 6; 283 string book_review_link = 7; 284 string contributor = 8; 285 string contributor_note = 9; 286 int32 dagger = 10; 287 string description = 11; 288 string first_chapter_link = 12; 289 message Isbn { 290 string isbn10 = 1; 291 string isbn13 = 2; 292 } 293 repeated Isbn isbns = 13; 294 int32 price = 14; 295 string primary_isbn10 = 15; 296 string primary_isbn13 = 16; 297 string publisher = 17; 298 int32 rank = 18; 299 int32 rank_last_week = 19; 300 string sunday_review_link = 20; 301 string title = 21; 302 int32 weeks_on_list = 22; 303 } 304 repeated Book books = 2; 305 message Correction { 306 } 307 repeated Correction corrections = 3; 308 string display_name = 4; 309 string list_name = 5; 310 int32 normal_list_ends_at = 6; 311 string published_date = 7; 312 string updated = 8; 313 } 314 Results results = 4; 315 string status = 5; 316 } 317 318 message GetReviewsformatRequest { 319 string api_key = 1; 320 // You’ll need to enter the author’s first and last name, separated by a space. This space will be converted into the characters %20. 321 string author = 2; 322 enum GetReviewsformatRequest_Format { 323 GETREVIEWSFORMATREQUEST_FORMAT_JSON = 0; 324 GETREVIEWSFORMATREQUEST_FORMAT_JSONP = 1; 325 } 326 GetReviewsformatRequest_Format format = 3; 327 // Searching by ISBN is the recommended method. You can enter 10- or 13-digit ISBNs. 328 int32 isbn = 4; 329 // You’ll need to enter the full title of the book. Spaces in the title will be converted into the characters %20. 330 string title = 5; 331 } 332 333 message GetReviewsformatResponse { 334 string copyright = 1; 335 int32 num_results = 2; 336 message Result { 337 string book_author = 1; 338 string book_title = 2; 339 string byline = 3; 340 repeated string isbn13 = 4; 341 string publication_dt = 5; 342 string summary = 6; 343 string url = 7; 344 } 345 repeated Result results = 3; 346 string status = 4; 347 } 348 349 service BooksAPIService { 350 // Best Seller List 351 rpc GetListsformat(GetListsformatRequest) returns (GetListsformatResponse) {} 352 // Best Seller History List 353 rpc GetListsBestSellersHistory(GetListsBestSellersHistoryRequest) returns (GetListsBestSellersHistoryResponse) {} 354 // Best Seller List Names 355 rpc GetListsNamesformat(GetListsNamesformatRequest) returns (GetListsNamesformatResponse) {} 356 // Best Seller List Overview 357 rpc GetListsOverviewformat(GetListsOverviewformatRequest) returns (GetListsOverviewformatResponse) {} 358 // Best Seller List by Date 359 rpc GetListsDateList(GetListsDateListRequest) returns (GetListsDateListResponse) {} 360 // Reviews 361 rpc GetReviewsformat(GetReviewsformatRequest) returns (GetReviewsformatResponse) {} 362 }