This commit is contained in:
2022-05-22 21:15:26 +02:00
parent 9ffdabdda5
commit b7ffb014ea
13 changed files with 1412 additions and 0 deletions

11
petapis/buf.lock Normal file
View File

@@ -0,0 +1,11 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: acme
repository: paymentapis
commit: 6e230f46113f498392c82d12b1a07b70
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 68946673f2d94bb2b24e6e97a208b752

11
petapis/buf.yaml Normal file
View File

@@ -0,0 +1,11 @@
version: v1
name: buf.build/acme/petapis
deps:
- buf.build/googleapis/googleapis
- buf.build/acme/paymentapis
lint:
use:
- DEFAULT
breaking:
use:
- FILE

60
petapis/pet/v1/pet.proto Normal file
View File

@@ -0,0 +1,60 @@
syntax = "proto3";
package pet.v1;
import "payment/v1/payment.proto";
import "google/type/datetime.proto";
// PetType represents the different types of pets in the pet store.
enum PetType {
PET_TYPE_UNSPECIFIED = 0;
PET_TYPE_CAT = 1;
PET_TYPE_DOG = 2;
PET_TYPE_SNAKE = 3;
PET_TYPE_HAMSTER = 4;
}
// Pet represents a pet in the pet store.
message Pet {
PetType pet_type = 1;
string pet_id = 2;
string name = 3;
google.type.DateTime created_at = 4;
}
message GetPetRequest {
string pet_id = 1;
}
message GetPetResponse {
Pet pet = 1;
}
message PutPetRequest {
PetType pet_type = 1;
string name = 2;
}
message PutPetResponse {
Pet pet = 1;
}
message DeletePetRequest {
string pet_id = 1;
}
message DeletePetResponse {}
message PurchasePetRequest {
string pet_id = 1;
payment.v1.Order order = 2;
}
message PurchasePetResponse {}
service PetStoreService {
rpc GetPet(GetPetRequest) returns (GetPetResponse) {}
rpc PutPet(PutPetRequest) returns (PutPetResponse) {}
rpc DeletePet(DeletePetRequest) returns (DeletePetResponse) {}
rpc PurchasePet(PurchasePetRequest) returns (PurchasePetResponse) {}
}