github.com/Axway/agent-sdk@v1.1.101/pkg/apic/testdata/petstore.proto (about)

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