Skip to content

Commit 9d1dbb6

Browse files
authored
Merge pull request #74 from chamil321/120
Change org/module and Migrate to b7a v1.2.0
2 parents 23dde29 + de5e453 commit 9d1dbb6

File tree

17 files changed

+103
-63
lines changed

17 files changed

+103
-63
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Ballerina Build
13+
uses: ballerina-platform/ballerina-action/@master
14+
with:
15+
args:
16+
build -a -c --skip-tests
17+
env:
18+
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deployment
2+
3+
on: [release]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Ballerina Build
13+
uses: ballerina-platform/ballerina-action/@master
14+
with:
15+
args:
16+
build -a -c --skip-tests
17+
- name: Ballerina Push
18+
uses: ballerina-platform/ballerina-action/@master
19+
with:
20+
args:
21+
push -a
22+
env:
23+
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
24+
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
script:
16-
- wget https://product-dist.ballerina.io/downloads/1.1.0/ballerina-linux-installer-x64-1.1.0.deb
17-
- sudo dpkg -i ballerina-linux-installer-x64-1.1.0.deb
16+
- wget https://product-dist.ballerina.io/downloads/1.2.0/ballerina-linux-installer-x64-1.2.0.deb
17+
- sudo dpkg -i ballerina-linux-installer-x64-1.2.0.deb
1818
- sudo apt-get install -f
1919
- ballerina --version
20-
- ballerina build -c --skip-tests gmail
20+
- ballerina build -c --skip-tests googleapis.gmail

Ballerina.lock

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
org_name = "wso2"
2-
version = "0.11.0"
3-
lockfile_version = "1.0.0"
4-
ballerina_version = "1.1.0"
5-
6-
[[imports."wso2/gmail:0.11.0"]]
7-
org_name = "ballerinax"
8-
name = "java"
9-
version = "0.0.0"
10-
11-
[[imports."wso2/gmail:0.11.0"]]
121
org_name = "ballerinax"
13-
name = "java.arrays"
14-
version = "0.0.0"
15-
16-
[[imports."ballerinax/java.arrays:0.0.0"]]
17-
org_name = "ballerinax"
18-
name = "java"
19-
version = "0.0.0"
2+
version = "0.12.0"
3+
lockfile_version = "1.0.0"
4+
ballerina_version = "1.2.0"

Ballerina.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
2-
org-name= "wso2"
3-
version= "0.11.0"
4-
authors = ["WSO2"]
5-
repository = "https://github.com/wso2-ballerina/module-gmail"
2+
org-name= "ballerinax"
3+
version= "0.12.0"
4+
authors = ["Ballerina"]
5+
repository = "https://github.com/ballerina-platform/module-gmail"
66
keywords = ["gmail","email"]
77
license = ["Apache-2.0"]
88

Readme.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
[![Build Status](https://travis-ci.org/wso2-ballerina/module-gmail.svg?branch=master)](https://travis-ci.org/wso2-ballerina/module-gmail)
1+
[![Build Status](https://travis-ci.org/ballerina-platform/module-gmail.svg?branch=master)](https://travis-ci.org/ballerina-platform/module-gmail)
22

33
# Ballerina Gmail Connector
44

5-
Ballerina Gmail Connector provides the capability to send, read and delete emails through the Gmail REST API. It also provides the ability to read, trash, untrash and delete threads, ability to get the Gmail profile and mailbox history, etc. The connector handles OAuth 2.0 authentication.
5+
Ballerina Gmail Connector provides the capability to send, read and delete emails through the Gmail REST API.
6+
It also provides the ability to read, trash, untrash and delete threads, ability to get the Gmail profile and
7+
mailbox history, etc. The connector handles OAuth 2.0 authentication.
68

79
The following sections provide you with information on how to use the Ballerina Gmail Connector.
810

@@ -15,56 +17,66 @@ The following sections provide you with information on how to use the Ballerina
1517

1618
| Ballerina Language Versions | Gmail API Version |
1719
|:---------------------------:|:------------------------------:|
18-
| 1.0.x, 1.1.x | v1 |
20+
| 1.0.x, 1.1.x, 1.2.x | v1 |
1921

2022
## Feature Overview
2123

2224
#### Working with Emails
2325

24-
The `wso2/gmail` module contains operations to send emails in Text and HTML formats with attachments and inline images. It supports searching and reading emails in Gmail using Gmail filters. The module also supports trashing, untrashing, deleting, and modifying emails.
26+
The `ballerinax/googleapis.gmail` module contains operations to send emails in Text and HTML formats with
27+
attachments and inline images. It supports searching and reading emails in Gmail using Gmail filters. The module
28+
also supports trashing, untrashing, deleting, and modifying emails.
2529

2630
#### Working with Threads
2731

28-
The `wso2/gmail` module contains operations to read, search, trash, untrash, modify and delete email threads in Gmail.
32+
The `ballerinax/googleapis.gmail` module contains operations to read, search, trash, untrash, modify and delete
33+
email threads in Gmail.
2934

3035
#### Working with Drafts
3136

32-
The `wso2/gmail` module contains operations to search, read, delete, create, update and send drafts in Gmail.
37+
The `ballerinax/googleapis.gmail` module contains operations to search, read, delete, create, update and send
38+
drafts in Gmail.
3339

3440
#### Working with Labels
3541

36-
The `wso2/gmail` module containes operations to list, read, create, update and delete labels in Gmail.
42+
The `ballerinax/googleapis.gmail` module contains operations to list, read, create, update and delete labels in Gmail.
3743

3844
#### Working with User Profiles
3945

40-
The `wso2/gmail` module contains operations to get Gmail user profile details.
46+
The `ballerinax/googleapis.gmail` module contains operations to get Gmail user profile details.
4147

4248
#### Working with Mailbox History
4349

44-
The `wso2/gmail` module contains operations to lists the history of changes to the user's mailbox.
50+
The `ballerinax/googleapis.gmail` module contains operations to lists the history of changes to the user's mailbox.
4551

4652
## Getting Started
4753

4854
## Sample
49-
First, import the `wso2/gmail` module into the Ballerina project.
55+
First, import the `ballerinax/googleapis.gmail` module into the Ballerina project.
5056
```ballerina
51-
import wso2/gmail;
57+
import ballerinax/googleapis.gmail;
5258
```
53-
Instantiate the connector by giving authentication details in the Gmail client config, which has built-in support for OAuth 2.0. Gmail uses OAuth 2.0 to authenticate and authorize requests. The Gmail connector can be minimally instantiated in the Gmail client config using the Access Token or by using the Client ID, Client Secret and Refresh Token.
59+
Instantiate the connector by giving authentication details in the Gmail client config, which has built-in support
60+
for OAuth 2.0. Gmail uses OAuth 2.0 to authenticate and authorize requests. The Gmail connector can be minimally
61+
instantiated in the Gmail client config using the Access Token or by using the Client ID, Client Secret and Refresh Token.
5462

5563
**Obtaining Tokens to Run the Sample**
5664

57-
1. Visit [Google API Console](https://console.developers.google.com), click **Create Project**, and follow the wizard to create a new project.
65+
1. Visit [Google API Console](https://console.developers.google.com), click **Create Project**, and follow the wizard
66+
to create a new project.
5867
2. Go to **Credentials -> OAuth Consent Screen**, enter a product name to be shown to users, and click **Save**.
5968
3. On the **Credentials** tab, click **Create Credentials** and select **OAuth Client ID**.
60-
4. Select an application type, enter a name for the application, and specify a redirect URI (enter https://developers.google.com/oauthplayground if you want to use
69+
4. Select an application type, enter a name for the application, and specify a redirect URI
70+
(enter https://developers.google.com/oauthplayground if you want to use
6171
[OAuth 2.0 Playground](https://developers.google.com/oauthplayground) to receive the Authorization Code and obtain the
6272
Access Token and Refresh Token).
6373
5. Click **Create**. Your Client ID and Client Secret will appear.
64-
6. In a separate browser window or tab, visit [OAuth 2.0 Playground](https://developers.google.com/oauthplayground). Click on the `OAuth 2.0 Configuration`
65-
icon in the top right corner and click on `Use your own OAuth credentials` and provide your `OAuth Client ID` and `OAuth Client Secret`.
74+
6. In a separate browser window or tab, visit [OAuth 2.0 Playground](https://developers.google.com/oauthplayground).
75+
Click on the `OAuth 2.0 Configuration` icon in the top right corner and click on `Use your own OAuth credentials` and
76+
provide your `OAuth Client ID` and `OAuth Client Secret`.
6677
7. Select the required Gmail API scopes from the list of API's, and then click **Authorize APIs**.
67-
8. When you receive your authorization code, click **Exchange authorization code for tokens** to obtain the refresh token and access token.
78+
8. When you receive your authorization code, click **Exchange authorization code for tokens** to obtain the
79+
refresh token and access token.
6880

6981
You can now enter the credentials in the Gmail client config.
7082
```ballerina
@@ -115,7 +127,8 @@ if (sendMessageResponse is [string, string]) {
115127
}
116128
```
117129

118-
The `readMessage` remote function reads messages. It returns the `Message` object when successful or an `error` when unsuccessful.
130+
The `readMessage` remote function reads messages. It returns the `Message` object when successful or an `error`
131+
when unsuccessful.
119132

120133
```ballerina
121134
var response = gmailClient->readMessage(userId, <@untainted>messageId);

src/gmail/resources/.keep

Whitespace-only changes.

src/gmail/tests/resources/.keep

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ gmail:Client gmailClient = new (gmailConfig);
5050

5151
```ballerina
5252
import ballerina/io;
53-
import wso2/gmail;
53+
import ballerinax/googleapis.gmail;
5454
5555
gmail:GmailConfiguration gmailConfig = {
5656
oauthClientConfig: {

src/gmail/external_functions.bal renamed to src/googleapis.gmail/external_functions.bal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ballerinax/java;
1+
import ballerina/java;
22

33
function split(handle receiver, handle delimeter) returns handle = @java:Method {
44
class: "java.lang.String"

0 commit comments

Comments
 (0)