github.com/sanposhiho/openapi2proto@v0.0.0-20230521044535-d1080a134e37/fixtures/petstore/swagger.proto (about)

     1  syntax = "proto3";
     2  
     3  package swaggerpetstore;
     4  
     5  import "google/protobuf/empty.proto";
     6  
     7  message AddPetRequest {
     8      message PetMessage {
     9          int64 id = 1;
    10          string name = 2;
    11          string tag = 3;
    12      }
    13  
    14      // Pet to add to the store
    15      PetMessage pet = 1;
    16  }
    17  
    18  message AddPetResponse {
    19      int64 id = 1;
    20      string name = 2;
    21      string tag = 3;
    22  }
    23  
    24  message DeletePetRequest {
    25      // ID of pet to delete
    26      int64 id = 1;
    27  }
    28  
    29  message FindPetByIdRequest {
    30      // ID of pet to fetch
    31      int64 id = 1;
    32  }
    33  
    34  message FindPetByIdResponse {
    35      int64 id = 1;
    36      string name = 2;
    37      string tag = 3;
    38  }
    39  
    40  message FindPetsByIdsRequest {
    41      repeated string ids = 1;
    42  
    43      // maximum number of results to return
    44      int32 limit = 2;
    45  }
    46  
    47  message FindPetsByIdsResponse {
    48      message PetsMessage {
    49          int64 id = 1;
    50          string name = 2;
    51          string tag = 3;
    52      }
    53  
    54      repeated PetsMessage pets = 1;
    55  }
    56  
    57  message FindPetsRequest {
    58      // maximum number of results to return
    59      int32 limit = 1;
    60  
    61      // tags to filter by
    62      repeated string tags = 2;
    63  }
    64  
    65  message FindPetsResponse {
    66      message PetsMessage {
    67          int64 id = 1;
    68          string name = 2;
    69          string tag = 3;
    70      }
    71  
    72      repeated PetsMessage pets = 1;
    73  }
    74  
    75  service SwaggerPetstoreService {
    76      // Creates a new pet in the store.  Duplicates are allowed
    77      rpc AddPet(AddPetRequest) returns (AddPetResponse) {}
    78  
    79      // deletes a single pet based on the ID supplied
    80      rpc DeletePet(DeletePetRequest) returns (google.protobuf.Empty) {}
    81  
    82      // Returns a user based on a single ID, if the user does not have access to the pet
    83      rpc FindPetById(FindPetByIdRequest) returns (FindPetByIdResponse) {}
    84  
    85      // Returns all pets from the system that the user has access to
    86      rpc FindPets(FindPetsRequest) returns (FindPetsResponse) {}
    87  
    88      // Returns all pets from the system that the user has access to
    89      rpc FindPetsByIds(FindPetsByIdsRequest) returns (FindPetsByIdsResponse) {}
    90  }