Skip to content

Commit

Permalink
Merge pull request #21 from aneeshafedo/worldbank-date-optional
Browse files Browse the repository at this point in the history
Make date parameter optional with default value
  • Loading branch information
indikasampath2000 authored Jun 22, 2021
2 parents 81c0d89 + d6910bd commit 312f933
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions openapi/worldbank/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Population of each countries
@display {label: "Get Population"}
remote isolated function getPopulation(@display {label: "Date"} string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns CountryPopulation[]|error {
remote isolated function getPopulation(@display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns CountryPopulation[]|error {
string path = string `/country/all/indicator/SP.POP.TOTL`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -76,7 +76,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Yearly population of the given country
@display {label: "Get Country Population"}
remote isolated function getPopulationByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string date, @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns CountryPopulation[]|error {
remote isolated function getPopulationByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns CountryPopulation[]|error {
string path = string `/country/${country_code}/indicator/SP.POP.TOTL`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -104,7 +104,7 @@ public client class Client {
# + per_page - Per page record count
# + return - GDP of each country
@display {label: "Get GDP"}
remote isolated function getGDP(string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns GrossDomesticProduct[]|error {
remote isolated function getGDP(@display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns GrossDomesticProduct[]|error {
string path = string `/country/all/indicator/NY.GDP.MKTP.CD`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -133,7 +133,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Yearly GDP of the given country
@display {label: "Get GDP By Country"}
remote isolated function getGDPByCountry(@display {label: "Country Code"} string country_code, string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns GrossDomesticProduct[]|error {
remote isolated function getGDPByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns GrossDomesticProduct[]|error {
string path = string `/country/${country_code}/indicator/NY.GDP.MKTP.CD`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -161,7 +161,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Population percentage having electricity of each country.
@display {label: "Get Population% Having Electricity"}
remote isolated function getAccessToElectricityPercentage(string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns AccessToElectricity[]|error {
remote isolated function getAccessToElectricityPercentage(@display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns AccessToElectricity[]|error {
string path = string `/country/all/indicator/1.1_ACCESS.ELECTRICITY.TOT`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -190,7 +190,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Yearly population percentage having electricity of the given country.
@display {label: "Get Population% Having Electricity By Country"}
remote isolated function getAccessToElectricityPercentageByCountry(@display {label: "Country Code"} string country_code, string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns AccessToElectricity[]|error {
remote isolated function getAccessToElectricityPercentageByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns AccessToElectricity[]|error {
string path = string `/country/${country_code}/indicator/1.1_ACCESS.ELECTRICITY.TOT`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -218,7 +218,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Youth literacy rate of each country.
@display {label: "Get Youth Literacy Rate"}
remote isolated function getYouthLiteracyRate(@display {label: "Date"} string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns YouthLiteracyRate[]|error {
remote isolated function getYouthLiteracyRate(@display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns YouthLiteracyRate[]|error {
string path = string `/country/all/indicator/1.1_YOUTH.LITERACY.RATE`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -247,7 +247,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Youth literacy rate of the given country.
@display {label: "Get Youth Literacy Rate By Country"}
remote isolated function getYouthLiteracyRateByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns YouthLiteracyRate[]|error {
remote isolated function getYouthLiteracyRateByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns YouthLiteracyRate[]|error {
string path = string `/country/${country_code}/indicator/1.1_YOUTH.LITERACY.RATE`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -275,7 +275,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Government expenditure on primary education of each country.
@display {label: "Get Government Expenditure On Education"}
remote isolated function getGovernmentExpenditureOnPrimaryEducation(@display {label: "Date"} string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns PrimaryEducationExpenditure[]|error {
remote isolated function getGovernmentExpenditureOnPrimaryEducation(@display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns PrimaryEducationExpenditure[]|error {
string path = string `/country/all/indicator/UIS.X.PPP.1.FSGOV`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down Expand Up @@ -304,7 +304,7 @@ public client class Client {
# + per_page - Per page record count
# + return - Government expenditure on primary education of a country.
@display {label: "Get Government Expenditure On Education By Country"}
remote isolated function getGovernmentExpenditureOnPrimaryEducationByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date = (), @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns PrimaryEducationExpenditure[]|error {
remote isolated function getGovernmentExpenditureOnPrimaryEducationByCountry(@display {label: "Country Code"} string country_code, @display {label: "Date"} string? date="2010", @display {label: "Page Number"} int? page = (), @display {label: "Per Page Record Count"} int? per_page = ()) returns PrimaryEducationExpenditure[]|error {
string path = string `/country/${country_code}/indicator/UIS.X.PPP.1.FSGOV`;
map<anydata> queryParam = {date: date, format: "json", page: page, per_page: per_page};
path = path + check getPathForQueryParam(queryParam);
Expand Down

0 comments on commit 312f933

Please sign in to comment.