Skip to content

Commit

Permalink
Merge pull request #24 from SkNuwanTissera/slalpha5
Browse files Browse the repository at this point in the history
Migrate connector on SLAlpha5 branch to SLBeta3 with backward compatibility
  • Loading branch information
abeykoon authored Sep 23, 2021
2 parents aa429b6 + f8917b0 commit dd803de
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@slalpha5
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
build -c
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@slalpha5
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
build -c
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@slalpha5
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
build -c --skip-tests
Expand All @@ -21,7 +21,7 @@ jobs:
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
- name: Ballerina Push
uses: ballerina-platform/ballerina-action/@slalpha5
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
push
Expand Down
2 changes: 1 addition & 1 deletion Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org= "ballerinax"
name= "googleapis.people"
version= "0.1.3"
version= "0.1.4"
license= ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["google", "people", "contact"]
Expand Down
31 changes: 0 additions & 31 deletions Dependencies.toml

This file was deleted.

4 changes: 2 additions & 2 deletions Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Google People Ballerina Connector allows you to access the Google People API
* Java 11 Installed
Java Development Kit (JDK) with version 11 is required.

* Download the Ballerina [distribution](https://ballerinalang.org/downloads/) SLAlpha5
* Download the Ballerina [distribution](https://ballerinalang.org/downloads/) SLBeta3
Ballerina Swan Lake Alpha Version 5 is required.

* Instantiate the connector by giving authentication details in the HTTP client config. The HTTP client config has built-in support for BasicAuth and OAuth 2.0. Google People uses OAuth 2.0 to authenticate and authorize requests.
Expand All @@ -36,7 +36,7 @@ The Google People Ballerina Connector allows you to access the Google People API

| | Versions |
|:---------------------------:|:-------------------------------:|
| Ballerina Language | Swan Lake Alpha 5 |
| Ballerina Language | Swan Lake Beta 3 |
| Google People API | V1 |


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The Google People Ballerina Connector allows you to access the Google People API
* Java 11 Installed
Java Development Kit (JDK) with version 11 is required.

* Download the Ballerina [distribution](https://ballerinalang.org/downloads/) SLAlpha5
* Download the Ballerina [distribution](https://ballerinalang.org/downloads/) SLBeta3
Ballerina Swan Lake Alpha Version 5 is required.

* Instantiate the connector by giving authentication details in the HTTP client config. The HTTP client config has built-in support for BasicAuth and OAuth 2.0. Google People uses OAuth 2.0 to authenticate and authorize requests.
Expand All @@ -38,7 +38,7 @@ The Google People Ballerina Connector allows you to access the Google People API

| | Versions |
|:---------------------------:|:-------------------------------:|
| Ballerina Language | Swan Lake Alpha 5 |
| Ballerina Language | Swan Lake Beta 3 |
| Google People API | V1 |


Expand Down
8 changes: 4 additions & 4 deletions utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ isolated function convertImageToBase64String(string imagePath) returns @tainted
function getContacts(http:Client googleContactClient, @tainted PersonResponse[] persons, string pathProvided = EMPTY_STRING,
ContactListOptions? options = ()) returns @tainted stream<PersonResponse>|ContactsTriggerResponse|error {
string path = <@untainted>prepareUrlWithContactOptions(pathProvided, options);
var httpResponse = googleContactClient->get(path);
http:Response httpResponse = check googleContactClient->get(path);
json getResponse = check checkAndSetErrors(httpResponse);
ConnectionsResponse|ContactsTriggerResponse|error response = getResponse.cloneWithType(ConnectionsResponse);
if (response is ConnectionsResponse) {
Expand Down Expand Up @@ -229,7 +229,7 @@ function getContacts(http:Client googleContactClient, @tainted PersonResponse[]
isolated function getContactsStream(http:Client googleContactClient, @tainted PersonResponse[] persons, string pathProvided = EMPTY_STRING,
ContactListOptions? options = ()) returns @tainted stream<PersonResponse>|error {
string path = <@untainted>prepareUrlWithContactOptions(pathProvided, options);
var httpResponse = googleContactClient->get(path);
http:Response httpResponse = check googleContactClient->get(path);
json response = check checkAndSetErrors(httpResponse);
map<json> mapResponse = <map<json>> response;
if (mapResponse.length() != 0) {
Expand Down Expand Up @@ -266,7 +266,7 @@ isolated function getOtherContactsStream(http:Client googleContactClient, @taint
string pathProvided = EMPTY_STRING, ContactListOptions? options = ())
returns @tainted stream<PersonResponse>|error {
string path = <@untainted>prepareUrlWithContactOptions(pathProvided, options);
var httpResponse = googleContactClient->get(path);
http:Response httpResponse = check googleContactClient->get(path);
json response = check checkAndSetErrors(httpResponse);
map<json> mapResponse = <map<json>> response;
if (mapResponse.length() != 0) {
Expand Down Expand Up @@ -303,7 +303,7 @@ isolated function getContactGroupStream(http:Client googleContactClient, @tainte
string pathProvided = EMPTY_STRING, ContactListOptions? options = ())
returns @tainted stream<ContactGroup>|error {
string path = <@untainted>prepareUrlWithContactOptions(pathProvided, options);
var httpResponse = googleContactClient->get(path);
http:Response httpResponse = check googleContactClient->get(path);
json response = check checkAndSetErrors(httpResponse);
map<json> mapResponse = <map<json>> response;
if (mapResponse.length() != 0) {
Expand Down

0 comments on commit dd803de

Please sign in to comment.