github.com/chrusty/openapi2proto@v0.0.0-20171127225041-f5804f48ccdb/fixtures/books-options.proto (about)

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