Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add replying back to a message in a thread & Introduce module specific errors #248

Merged
merged 17 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ The `ballerinax/googleapis.gmail` package offers APIs to connect and interact wi
To use the `gmail` connector in your Ballerina application, modify the `.bal` file as follows:

### Step 1: Import the connector

Import the `ballerinax/googleapis.gmail` package into your Ballerina project.

```ballerina
import ballerinax/googleapis.gmail;
```

### Step 2: Instantiate a new connector

Create a `gmail:ConnectionConfig` with the obtained OAuth2.0 tokens and initialize the connector with it.

```ballerina
gmail:Client gmailClient = check new gmail:Client (
config = {
Expand All @@ -37,7 +41,9 @@ gmail:Client gmailClient = check new gmail:Client (
```

### Step 3: Invoke the connector operation

Now, utilize the available connector operations.

```ballerina
gmail:MessageListPage messageList = check gmailClient->/users/me/messages(q = "label:INBOX is:unread");
```
Expand All @@ -49,7 +55,6 @@ The `gmail` connector provides practical examples illustrating usage in various
1. [Process customer feedback emails](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/examples/process-mails/main.bal)
Manage customer feedback emails by processing unread emails in the inbox, extracting details, and marking them as read.


2. [Send maintenance break notifications](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/examples/send-mails/main.bal)
Automatically send emails for scheduled maintenance breaks.

Expand All @@ -73,9 +78,9 @@ To use the `gmail` connector, create Gmail credentials to interact with Gmail.

For detailed steps, including necessary links, refer to the [Setup guide](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/docs/setup/setup.md).

## Issues and projects
## Issues and projects

The **Issues** and **Projects** tabs are disabled for this repository as this is part of the Ballerina library. To report bugs, request new features, start new discussions, view project boards, etc., visit the Ballerina library [parent repository](https://github.com/ballerina-platform/ballerina-library).
The **Issues** and **Projects** tabs are disabled for this repository as this is part of the Ballerina library. To report bugs, request new features, start new discussions, view project boards, etc., visit the Ballerina library [parent repository](https://github.com/ballerina-platform/ballerina-library).

This repository only contains the source code for the package.

Expand All @@ -101,37 +106,44 @@ This repository only contains the source code for the package.
Execute the commands below to build from the source.

1. To build the package:
```

```bash
./gradlew clean build
```

2. To run the tests:
```

```bash
./gradlew clean test
```

3. To build the without the tests:
```

```bash
./gradlew clean build -x test
```

5. To debug package with a remote debugger:
```
4. To debug package with a remote debugger:

```bash
./gradlew clean build -Pdebug=<port>
```

6. To debug with the Ballerina language:
```
5. To debug with the Ballerina language:

```bash
./gradlew clean build -PbalJavaDebug=<port>
```

7. Publish the generated artifacts to the local Ballerina Central repository:
```
6. Publish the generated artifacts to the local Ballerina Central repository:

```bash
./gradlew clean build -PpublishToLocalCentral=true
```

8. Publish the generated artifacts to the Ballerina Central repository:
```
7. Publish the generated artifacts to the Ballerina Central repository:

```bash
./gradlew clean build -PpublishToCentral=true
```

Expand Down
9 changes: 7 additions & 2 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Overview
# Overview

[Gmail](https://blog.google/products/gmail/) is a widely-used email service provided by Google LLC, enabling users to send and receive emails over the internet.

Expand All @@ -11,13 +11,17 @@ The `ballerinax/googleapis.gmail` package offers APIs to connect and interact wi
To use the `gmail` connector in your Ballerina application, modify the `.bal` file as follows:

### Step 1: Import the connector

Import the `ballerinax/googleapis.gmail` package into your Ballerina project.

```ballerina
import ballerinax/googleapis.gmail;
```

### Step 2: Instantiate a new connector

Create a `gmail:ConnectionConfig` with the obtained OAuth2.0 tokens and initialize the connector with it.

```ballerina
gmail:Client gmailClient = check new gmail:Client (
config = {
Expand All @@ -31,7 +35,9 @@ gmail:Client gmailClient = check new gmail:Client (
```

### Step 3: Invoke the connector operation

Now, utilize the available connector operations.

```ballerina
gmail:MessageListPage messageList = check gmailClient->/users/me/messages(q = "label:INBOX is:unread");
```
Expand All @@ -43,7 +49,6 @@ The `gmail` connector provides practical examples illustrating usage in various
1. [Process customer feedback emails](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/examples/process-mails/main.bal)
Manage customer feedback emails by processing unread emails in the inbox, extracting details, and marking them as read.


2. [Send maintenance break notifications](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/examples/send-mails/main.bal)
Automatically send emails for scheduled maintenance breaks.

Expand Down
13 changes: 11 additions & 2 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Package overview

[Gmail](https://blog.google/products/gmail/) is a widely-used email service provided by Google LLC, enabling users to send and receive emails over the internet.

The `ballerinax/googleapis.gmail` package offers APIs to connect and interact with [Gmail API](https://developers.google.com/gmail/api/guides) endpoints.
Expand All @@ -9,13 +11,17 @@ The `ballerinax/googleapis.gmail` package offers APIs to connect and interact wi
To use the `gmail` connector in your Ballerina application, modify the `.bal` file as follows:

### Step 1: Import the connector

Import the `ballerinax/googleapis.gmail` package into your Ballerina project.

```ballerina
import ballerinax/googleapis.gmail;
```

### Step 2: Instantiate a new connector

Create a `gmail:ConnectionConfig` with the obtained OAuth2.0 tokens and initialize the connector with it.

```ballerina
gmail:Client gmailClient = check new gmail:Client (
config = {
Expand All @@ -29,7 +35,9 @@ gmail:Client gmailClient = check new gmail:Client (
```

### Step 3: Invoke the connector operation

Now, utilize the available connector operations.

```ballerina
gmail:MessageListPage messageList = check gmailClient->/users/me/messages(q = "label:INBOX is:unread");
```
Expand All @@ -41,7 +49,6 @@ The `gmail` connector provides practical examples illustrating usage in various
1. [Process customer feedback emails](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/examples/process-mails/main.bal)
Manage customer feedback emails by processing unread emails in the inbox, extracting details, and marking them as read.


2. [Send maintenance break notifications](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/examples/send-mails/main.bal)
Automatically send emails for scheduled maintenance breaks.

Expand All @@ -66,8 +73,10 @@ To use the `gmail` connector, create Gmail credentials to interact with Gmail.
For detailed steps, including necessary links, refer to the [Setup guide](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/tree/master/docs/setup/setup.md).

## Report Issues

To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina library parent repository](https://github.com/ballerina-platform/ballerina-library).

## Useful Links

- Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
29 changes: 19 additions & 10 deletions ballerina/constants.bal
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,36 @@ const string UNDERSCORE = "_";
const string SEMICOLON = ";";
# Holds the value for "\"" string.
const string DOUBLE_QUOTE = "\"";
# Holds the value for "," string.
const string COMMA = ",";

# Holds name for header To.
const string TO = "To";
const string TO = "to";
# Holds name for header From.
const string FROM = "From";
const string FROM = "from";
# Holds name for header Cc.
const string CC = "Cc";
const string CC = "cc";
# Holds name for header Bcc.
const string BCC = "Bcc";
const string BCC = "bcc";
# Holds name for header Subject.
const string SUBJECT = "Subject";
const string SUBJECT = "subject";
# Holds name for header Date.
const string DATE = "Date";
const string DATE = "date";
# Holds name for header Message-ID.
const string MESSAGE_ID = "message-id";
# Holds value for Content-Type.
const string CONTENT_TYPE = "Content-Type";
const string CONTENT_TYPE = "content-type";
# Holds value for Content-Disposition.
const string CONTENT_DISPOSITION = "Content-Disposition";
const string CONTENT_DISPOSITION = "content-disposition";
# Holds value for Content-Transfer-Encoding.
const string CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding";
const string CONTENT_TRANSFER_ENCODING = "content-transfer-encoding";
# Holds value for Content-ID.
const string CONTENT_ID = "Content-ID";
const string CONTENT_ID = "content-id";
# Holds value for 'References' header.
const string REFERENCES = "references";
# RepHolds value for 'In-Reply-To' header.
const string IN_REPLY_TO = "in-reply-to";

# Holds value for attachment.
const string ATTACHMENT = "attachment";
# Holds value for base 64 encoding.
Expand Down
Loading
Loading