Files
services/holidays/proto/holidays.proto
Dominic Wong a423dd9e99 docs
2021-09-21 20:15:36 +01:00

53 lines
1.3 KiB
Protocol Buffer

syntax = "proto3";
package holidays;
option go_package = "./proto;holidays";
service Holidays {
rpc Countries(CountriesRequest) returns (CountriesResponse) {}
rpc List(ListRequest) returns (ListResponse) {}
}
// Get the list of countries that are supported by this API
message CountriesRequest {
}
message CountriesResponse {
repeated Country countries = 1;
}
message Country {
// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
string code = 1;
// The English name of the country
string name = 2;
}
// List the holiday dates for a given country and year
message ListRequest {
// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
string country_code = 1;
// The year to list holidays for
int64 year = 2;
}
message ListResponse {
repeated Holiday holidays = 1;
}
message Holiday {
// date of the holiday in yyyy-mm-dd format
string date = 1;
// the name of the holiday in English
string name = 2;
// the local name of the holiday
string local_name = 3;
// the country this holiday occurs in
string country_code = 4;
// the regions within the country that observe this holiday (if not all of them)
repeated string regions = 5;
// the type of holiday Public, Bank, School, Authorities, Optional, Observance
repeated string types = 6;
}