Google Calendar is a time-management and scheduling calendar service developed by Google. It lets users to organize their schedule and share events with others.
This connector provides the capability to programmatically manage events and calendars. For more information about configuration and operations, go to the module.
- googleapis.calendar - Perform Google Calendar related operations programmatically
-
Download and install Java SE Development Kit (JDK) version 11. You can install either OpenJDK or Oracle JDK.
Note: Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.
-
Download and install Ballerina Swan Lake
-
Generate a Github access token with read package permissions, then set the following
env
variables:export packageUser=<Your GitHub Username> export packagePAT=<GitHub Personal Access Token>
To utilize the calendar
connector in your Ballerina application, modify the .bal
file as follows:
Import the ballerinax/googleapis.calendar
package into your Ballerina project.
import ballerinax/googleapis.calendar;
Create a calendar:ConnectionConfig
with the obtained OAuth2.0 tokens and initialize the connector with it.
calendar:Client calendarClient = check new ({
auth: {
clientId: clientId,
clientSecret: clientSecret,
refreshToken: refreshToken,
refreshUrl: refreshUrl
}
});
You can now utilize the operations available within the connector.
calendar:Calendar calendarResult = check calendarClient->/calendars.post({
summary: "Work Schedule"
});
The calendar
connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering use cases like creating calendar, scheduling meeting events, and adding reminders.
-
Project Management This example shows how to use Google calendar APIs to efficiently manage work schedule of a person. It interacts with the API for various tasks related to scheduling and organizing work-related events and meetings.
-
Work Schedule This example shows how to use Google calendar APIs to managing personal project schedule and collaborating with team members.
Execute the commands below to build from the source.
-
To build the package:
./gradlew clean build
-
To run the tests:
./gradlew clean test
-
To run a group of tests
./gradlew clean test -Pgroups=<test_group_names>
-
To build the without the tests:
./gradlew clean build -x test
-
To debug package with a remote debugger:
./gradlew clean build -Pdebug=<port>
-
To debug with Ballerina language:
./gradlew clean build -PbalJavaDebug=<port>
-
Publish the generated artifacts to the local Ballerina central repository:
./gradlew clean build -PpublishToLocalCentral=true
-
Publish the generated artifacts to the Ballerina central repository:
./gradlew clean build -PpublishToCentral=true
As an open source project, Ballerina welcomes contributions from the community.
For more information, go to the contribution guidelines.
All contributors are encouraged to read the Ballerina Code of Conduct.
- Discuss code changes of the Ballerina project in ballerina-dev@googlegroups.com.
- Chat live with us via our Discord server.
- Post all technical questions on Stack Overflow with the #ballerina tag.