Skip to content

Commit

Permalink
Merge pull request #139 from Nuvindu/gcalendar
Browse files Browse the repository at this point in the history
Change the package name to `googleapis.gcalendar`
  • Loading branch information
dilanSachi authored Dec 22, 2023
2 parents 5fd1afc + c67061f commit b41620e
Show file tree
Hide file tree
Showing 25 changed files with 208 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-with-bal-test-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit
with:
additional-test-flags: "-x :googleapis.calendar-examples:build -Pgroups=mock"
additional-test-flags: "-x :googleapis.gcalendar-examples:build -Pgroups=mock"
2 changes: 1 addition & 1 deletion .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
additional-publish-flags: "-x :googleapis.calendar-examples:build -Pgroups=mock"
additional-publish-flags: "-x :googleapis.gcalendar-examples:build -Pgroups=mock"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
uses: ballerina-platform/ballerina-standard-library/.github/workflows/release-package-connector-template.yml@main
secrets: inherit
with:
package-name: googleapis.calendar
package-name: googleapis.gcalendar
package-org: ballerinax
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
uses: ballerina-platform/ballerina-standard-library/.github/workflows/trivy-scan-template.yml@main
secrets: inherit
with:
additional-build-flags: "-x :googleapis.calendar-examples:build -Pgroups=mock"
additional-build-flags: "-x :googleapis.gcalendar-examples:build -Pgroups=mock"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#Config file
Config.toml
# Modules
/modules/googleapis.calendar
/modules/googleapis.gcalendar

# BlueJ files
*.ctxt
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[Google Calendar](https://developers.google.com/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](calendar/Module.md) - Perform Google Calendar related operations programmatically
- [googleapis.gcalendar](calendar/Module.md) - Perform Google Calendar related operations programmatically

## Overview

Expand All @@ -23,7 +23,7 @@ To utilize the Calendar connector, you must have access to the Calendar REST API

### Step 1: Create a Google Cloud Platform Project

In order to use the `calendar` connector, you need to first create the Calendar credentials for the connector to interact with Calendar.
In order to use the Google Calendar connector, you need to first create the Calendar credentials for the connector to interact with Calendar.

1. Open the [Google Cloud Platform Console](https://console.cloud.google.com/).

Expand Down Expand Up @@ -87,23 +87,23 @@ This sample demonstrates a scenario of creating a secondary calendar and adding

### Step 1: Import the package

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

```ballerina
import ballerinax/googleapis.calendar;
import ballerinax/googleapis.gcalendar;
```

### Step 2: Instantiate a new connector

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

```ballerina
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
configurable string refreshUrl = ?;
calendar:Client calendarClient = check new ({
gcalendar:Client calendarClient = check new ({
auth: {
clientId,
clientSecret,
Expand All @@ -119,29 +119,29 @@ You can now utilize the operations available within the connector.

```ballerina
public function main() returns error? {
calendar:Client calendarClient = ...//
gcalendar:Client calendarClient = ...//
// create a calendar
calendar:Calendar calendar = check calendarClient->/calendars.post({
summary: "Work Schedule"
});
// create a calendar
gcalendar:Calendar calendar = check calendarClient->/calendars.post({
summary: "Work Schedule"
});
// quick add new event
string eventTitle = "Sample Event";
calendar:Event event = check calendarClient->/calendars/[calendarId]/events/quickAdd.post(eventTitle);
// quick add new event
string eventTitle = "Sample Event";
gcalendar:Event event = check calendarClient->/calendars/[calendarId]/events/quickAdd.post(eventTitle);
}
```

## Examples

The `calendar` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples), covering use cases like creating calendar, scheduling meeting events, and adding reminders.
The Google calendar connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples), covering use cases like creating calendar, scheduling meeting events, and adding reminders.

1. [Project Management With Calendar API](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples/project-management-with-calendar/main.bal)
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.
2. [Work Schedule Management With Calendar API](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples/work-schedule-management-with-calendar/main.bal)
This example shows how to use Google calendar APIs to manage personal project schedule and collaborate with team members.

For comprehensive information about the connector's functionality, configuration, and usage in Ballerina programs, refer to the `calendar` connector's reference guide in [Ballerina Central](https://central.ballerina.io/ballerinax/googleapis.calendar/latest).
For comprehensive information about the connector's functionality, configuration, and usage in Ballerina programs, refer to the Google Calendar connector's reference guide in [Ballerina Central](https://central.ballerina.io/ballerinax/googleapis.calendar/latest).

## Issues and projects

Expand Down Expand Up @@ -173,7 +173,7 @@ This repository only contains the source code for the package.
export packagePAT=<GitHub Personal Access Token>
```

To utilize the `calendar` connector in your Ballerina application, modify the `.bal` file as follows:
To utilize the Google Calendar connector in your Ballerina application, modify the `.bal` file as follows:

### Build options

Expand Down
2 changes: 1 addition & 1 deletion ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
distribution = "2201.8.0"
org = "ballerinax"
name = "googleapis.calendar"
name = "googleapis.gcalendar"
version = "4.0.0"
license = ["Apache-2.0"]
authors = ["Ballerina"]
Expand Down
10 changes: 5 additions & 5 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ dependencies = [
[[package]]
org = "ballerina"
name = "constraint"
version = "1.4.0"
version = "1.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "crypto"
version = "2.5.0"
version = "2.6.2"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand Down Expand Up @@ -313,7 +313,7 @@ modules = [

[[package]]
org = "ballerinax"
name = "googleapis.calendar"
name = "googleapis.gcalendar"
version = "4.0.0"
dependencies = [
{org = "ballerina", name = "http"},
Expand All @@ -324,7 +324,7 @@ dependencies = [
{org = "ballerinai", name = "observe"}
]
modules = [
{org = "ballerinax", packageName = "googleapis.calendar", moduleName = "googleapis.calendar"},
{org = "ballerinax", packageName = "googleapis.calendar", moduleName = "googleapis.calendar.mock"}
{org = "ballerinax", packageName = "googleapis.gcalendar", moduleName = "googleapis.gcalendar"},
{org = "ballerinax", packageName = "googleapis.gcalendar", moduleName = "googleapis.gcalendar.mock"}
]

20 changes: 10 additions & 10 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To utilize the Calendar connector, you must have access to the Calendar REST API

### Step 1: Create a Google Cloud Platform Project

In order to use the `calendar` connector, you need to first create the Calendar credentials for the connector to interact with Calendar.
In order to use the Google Calendar connector, you need to first create the Calendar credentials for the connector to interact with Calendar.

1. Open the [Google Cloud Platform Console](https://console.cloud.google.com/).

Expand Down Expand Up @@ -74,23 +74,23 @@ This sample demonstrates a scenario of creating a secondary calendar and adding

### Step 1: Import the package

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

```ballerina
import ballerinax/googleapis.calendar;
import ballerinax/googleapis.gcalendar;
```

### Step 2: Instantiate a new connector

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

```ballerina
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
configurable string refreshUrl = ?;
calendar:Client calendarClient = check new ({
gcalendar:Client calendarClient = check new ({
auth: {
clientId,
clientSecret,
Expand All @@ -106,26 +106,26 @@ You can now utilize the operations available within the connector.

```ballerina
public function main() returns error? {
calendar:Client calendarClient = ...//
gcalendar:Client calendarClient = ...//
// create a calendar
calendar:Calendar calendar = check calendarClient->/calendars.post({
gcalendar:Calendar calendar = check calendarClient->/calendars.post({
summary: "Work Schedule"
});
// quick add new event
string eventTitle = "Sample Event";
calendar:Event event = check calendarClient->/calendars/[calendarId]/events/quickAdd.post(eventTitle);
gcalendar:Event event = check calendarClient->/calendars/[calendarId]/events/quickAdd.post(eventTitle);
}
```

## Examples

The `calendar` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples), covering use cases like creating calendar, scheduling meeting events, and adding reminders.
The Google Calendar connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples), covering use cases like creating calendar, scheduling meeting events, and adding reminders.

1. [Project Management With Calendar API](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples/project-management-with-calendar/main.bal)
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.
2. [Work Schedule Management With Calendar API](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples/work-schedule-management-with-calendar/main.bal)
This example shows how to use Google calendar APIs to managing personal project schedule and collaborating with team members.

For comprehensive information about the connector's functionality, configuration, and usage in Ballerina programs, refer to the `calendar` connector's reference guide in [Ballerina Central](https://central.ballerina.io/ballerinax/googleapis.calendar/latest).
For comprehensive information about the connector's functionality, configuration, and usage in Ballerina programs, refer to the Google Calendar connector's reference guide in [Ballerina Central](https://central.ballerina.io/ballerinax/googleapis.calendar/latest).
20 changes: 10 additions & 10 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To utilize the Calendar connector, you must have access to the Calendar REST API

### Step 1: Create a Google Cloud Platform Project

In order to use the `calendar` connector, you need to first create the Calendar credentials for the connector to interact with Calendar.
In order to use the Google Calendar connector, you need to first create the Calendar credentials for the connector to interact with Calendar.

1. Open the [Google Cloud Platform Console](https://console.cloud.google.com/).

Expand Down Expand Up @@ -74,23 +74,23 @@ This sample demonstrates a scenario of creating a secondary calendar and adding

### Step 1: Import the package

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

```ballerina
import ballerinax/googleapis.calendar;
import ballerinax/googleapis.gcalendar;
```

### Step 2: Instantiate a new connector

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

```ballerina
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
configurable string refreshUrl = ?;
calendar:Client calendarClient = check new ({
gcalendar:Client calendarClient = check new ({
auth: {
clientId,
clientSecret,
Expand All @@ -106,26 +106,26 @@ You can now utilize the operations available within the connector.

```ballerina
public function main() returns error? {
calendar:Client calendarClient = ...//
gcalendar:Client calendarClient = ...//
// create a calendar
calendar:Calendar calendar = check calendarClient->/calendars.post({
gcalendar:Calendar calendar = check calendarClient->/calendars.post({
summary: "Work Schedule"
});
// quick add new event
string eventTitle = "Sample Event";
calendar:Event event = check calendarClient->/calendars/[calendarId]/events/quickAdd.post(eventTitle);
gcalendar:Event event = check calendarClient->/calendars/[calendarId]/events/quickAdd.post(eventTitle);
}
```

## Examples

The `calendar` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples), covering use cases like creating calendar, scheduling meeting events, and adding reminders.
The Google Calendar connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples), covering use cases like creating calendar, scheduling meeting events, and adding reminders.

1. [Project Management With Calendar API](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples/project-management-with-calendar/main.bal)
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.
2. [Work Schedule Management With Calendar API](https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar/tree/main/examples/work-schedule-management-with-calendar/main.bal)
This example shows how to use Google calendar APIs to managing personal project schedule and collaborating with team members.

For comprehensive information about the connector's functionality, configuration, and usage in Ballerina programs, refer to the `calendar` connector's reference guide in [Ballerina Central](https://central.ballerina.io/ballerinax/googleapis.calendar/latest).
For comprehensive information about the connector's functionality, configuration, and usage in Ballerina programs, refer to the Google Calendar connector's reference guide in [Ballerina Central](https://central.ballerina.io/ballerinax/googleapis.calendar/latest).
2 changes: 1 addition & 1 deletion ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {

description = 'Calendar - Ballerina'

def packageName = "googleapis.calendar"
def packageName = "googleapis.gcalendar"
def packageOrg = "ballerinax"
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/Ballerina.toml")
Expand Down
Loading

0 comments on commit b41620e

Please sign in to comment.