diff --git a/.github/workflows/build-with-bal-test-native.yml b/.github/workflows/build-with-bal-test-native.yml index 52f93bc0..f127c8bb 100644 --- a/.github/workflows/build-with-bal-test-native.yml +++ b/.github/workflows/build-with-bal-test-native.yml @@ -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" diff --git a/.github/workflows/dev-stg-release.yml b/.github/workflows/dev-stg-release.yml index 1d810b16..42141598 100644 --- a/.github/workflows/dev-stg-release.yml +++ b/.github/workflows/dev-stg-release.yml @@ -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" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9fa5eb6..989f1e0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index b1ccbe7d..23055a8d 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -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" diff --git a/.gitignore b/.gitignore index 1bfb99d8..2e56300e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ #Config file Config.toml # Modules -/modules/googleapis.calendar +/modules/googleapis.gcalendar # BlueJ files *.ctxt diff --git a/README.md b/README.md index daf90949..691efea6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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/). @@ -87,15 +87,15 @@ 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 = ?; @@ -103,7 +103,7 @@ configurable string clientSecret = ?; configurable string refreshToken = ?; configurable string refreshUrl = ?; -calendar:Client calendarClient = check new ({ +gcalendar:Client calendarClient = check new ({ auth: { clientId, clientSecret, @@ -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 @@ -173,7 +173,7 @@ This repository only contains the source code for the package. export packagePAT= ``` -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 diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index f04e8fcd..d512f2ac 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -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"] diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index ecf7aa69..cbf00913 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -33,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.4.0" +version = "1.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -41,7 +41,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.5.0" +version = "2.6.2" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -313,7 +313,7 @@ modules = [ [[package]] org = "ballerinax" -name = "googleapis.calendar" +name = "googleapis.gcalendar" version = "4.0.0" dependencies = [ {org = "ballerina", name = "http"}, @@ -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"} ] diff --git a/ballerina/Module.md b/ballerina/Module.md index 31509786..49ad0216 100644 --- a/ballerina/Module.md +++ b/ballerina/Module.md @@ -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/). @@ -74,15 +74,15 @@ 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 = ?; @@ -90,7 +90,7 @@ configurable string clientSecret = ?; configurable string refreshToken = ?; configurable string refreshUrl = ?; -calendar:Client calendarClient = check new ({ +gcalendar:Client calendarClient = check new ({ auth: { clientId, clientSecret, @@ -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). diff --git a/ballerina/Package.md b/ballerina/Package.md index 269ae20b..d3a3fbad 100644 --- a/ballerina/Package.md +++ b/ballerina/Package.md @@ -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/). @@ -74,15 +74,15 @@ 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 = ?; @@ -90,7 +90,7 @@ configurable string clientSecret = ?; configurable string refreshToken = ?; configurable string refreshUrl = ?; -calendar:Client calendarClient = check new ({ +gcalendar:Client calendarClient = check new ({ auth: { clientId, clientSecret, @@ -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). diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 062ab3db..cb6d1d7b 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -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") diff --git a/ballerina/client.bal b/ballerina/client.bal index 7a0b3d9e..a512249c 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -63,7 +63,7 @@ public isolated client class Client { # + oauth_token - OAuth 2.0 token for the current user. # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - # + return - A `calendar:Calendar` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` resource isolated function post calendars(Calendar payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Calendar|Error { string resourcePath = string `/calendars`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -87,7 +87,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - A `calendar:Calendar` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` resource isolated function get calendars/[string calendarId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Calendar|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -109,7 +109,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - A `calendar:Calendar` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` resource isolated function put calendars/[string calendarId](Calendar payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Calendar|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -133,7 +133,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - If successful `()`, otherwise a `calendar:Error` + # + return - If successful `()`, otherwise a `gcalendar:Error` resource isolated function delete calendars/[string calendarId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Error? { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -155,7 +155,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - A `calendar:Calendar` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` resource isolated function patch calendars/[string calendarId](Calendar payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Calendar|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -186,7 +186,7 @@ public isolated client class Client { # If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. # Learn more about incremental synchronization. # Optional. The default is to return all entries. - # + return - A `calendar:Acl` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Acl` if successful, otherwise a `gcalendar:Error` resource isolated function get calendars/[string calendarId]/acl("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? maxResults = (), string? pageToken = (), boolean? showDeleted = (), string? syncToken = ()) returns Acl|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "maxResults": maxResults, "pageToken": pageToken, "showDeleted": showDeleted, "syncToken": syncToken}; @@ -209,7 +209,7 @@ public isolated client class Client { # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + sendNotifications - Whether to send notifications about the calendar sharing change. Optional. The default is True. - # + return - A `calendar:AclRule` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` resource isolated function post calendars/[string calendarId]/acl(AclRule payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), boolean? sendNotifications = ()) returns AclRule|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "sendNotifications": sendNotifications}; @@ -234,7 +234,7 @@ public isolated client class Client { # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + ruleId - ACL rule identifier. - # + return - A `calendar:AclRule` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` resource isolated function get calendars/[string calendarId]/acl/[string ruleId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns AclRule|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -258,7 +258,7 @@ public isolated client class Client { # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + ruleId - ACL rule identifier. # + sendNotifications - Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. - # + return - A `calendar:AclRule` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` resource isolated function put calendars/[string calendarId]/acl/[string ruleId](AclRule payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), boolean? sendNotifications = ()) returns AclRule|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "sendNotifications": sendNotifications}; @@ -283,7 +283,7 @@ public isolated client class Client { # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + ruleId - ACL rule identifier. - # + return - If successful `()`, otherwise a `calendar:Error` + # + return - If successful `()`, otherwise a `gcalendar:Error` resource isolated function delete calendars/[string calendarId]/acl/[string ruleId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Error? { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -307,7 +307,7 @@ public isolated client class Client { # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + ruleId - ACL rule identifier. # + sendNotifications - Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. - # + return - A `calendar:AclRule` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` resource isolated function patch calendars/[string calendarId]/acl/[string ruleId](AclRule payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), boolean? sendNotifications = ()) returns AclRule|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "sendNotifications": sendNotifications}; @@ -331,7 +331,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - If successful `()`, otherwise a `calendar:Error` + # + return - If successful `()`, otherwise a `gcalendar:Error` resource isolated function post calendars/[string calendarId]/clear("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Error? { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/clear`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -390,7 +390,7 @@ public isolated client class Client { # + timeMin - Lower bound (exclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, for example, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but are ignored. If timeMax is set, timeMin must be smaller than timeMax. # + timeZone - Time zone used in the response. Optional. The default is the time zone of the calendar. # + updatedMin - Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. - # + return - A `calendar:Events` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Events` if successful, otherwise a `gcalendar:Error` resource isolated function get calendars/[string calendarId]/events("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string[]? eventTypes = (), string? iCalUID = (), int? maxAttendees = (), int? maxResults = (), "startTime"|"updated"? orderBy = (), string? pageToken = (), string[]? privateExtendedProperty = (), string? q = (), string[]? sharedExtendedProperty = (), boolean? showDeleted = (), boolean? showHiddenInvitations = (), boolean? singleEvents = (), string? syncToken = (), string? timeMax = (), string? timeMin = (), string? timeZone = (), string? updatedMin = ()) returns Events|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "eventTypes": eventTypes, "iCalUID": iCalUID, "maxAttendees": maxAttendees, "maxResults": maxResults, "orderBy": orderBy, "pageToken": pageToken, "privateExtendedProperty": privateExtendedProperty, "q": q, "sharedExtendedProperty": sharedExtendedProperty, "showDeleted": showDeleted, "showHiddenInvitations": showHiddenInvitations, "singleEvents": singleEvents, "syncToken": syncToken, "timeMax": timeMax, "timeMin": timeMin, "timeZone": timeZone, "updatedMin": updatedMin}; @@ -417,7 +417,7 @@ public isolated client class Client { # + maxAttendees - The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. # + sendUpdates - Whether to send notifications about the creation of the new event. Note that some emails might still be sent. The default is false. # + supportsAttachments - Whether API client performing operation supports event attachments. Optional. The default is False. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function post calendars/[string calendarId]/events(Event payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? conferenceDataVersion = (), int? maxAttendees = (), "all"|"externalOnly"|"none"? sendUpdates = (), boolean? supportsAttachments = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "conferenceDataVersion": conferenceDataVersion, "maxAttendees": maxAttendees, "sendUpdates": sendUpdates, "supportsAttachments": supportsAttachments}; @@ -444,7 +444,7 @@ public isolated client class Client { # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + conferenceDataVersion - Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. # + supportsAttachments - Whether API client performing operation supports event attachments. Optional. The default is False. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function post calendars/[string calendarId]/events/'import(Event payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? conferenceDataVersion = (), boolean? supportsAttachments = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/import`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "conferenceDataVersion": conferenceDataVersion, "supportsAttachments": supportsAttachments}; @@ -470,7 +470,7 @@ public isolated client class Client { # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + text - The text describing the event to be created. # + sendUpdates - Guests who should receive notifications about the creation of the new event. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function post calendars/[string calendarId]/events/quickAdd(string text, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), "all"|"externalOnly"|"none"? sendUpdates = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/quickAdd`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "text": text, "sendUpdates": sendUpdates}; @@ -495,7 +495,7 @@ public isolated client class Client { # + eventId - Event identifier. # + maxAttendees - The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. # + timeZone - Time zone used in the response. Optional. The default is the time zone of the calendar. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function get calendars/[string calendarId]/events/[string eventId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? maxAttendees = (), string? timeZone = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "maxAttendees": maxAttendees, "timeZone": timeZone}; @@ -522,7 +522,7 @@ public isolated client class Client { # + maxAttendees - The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. # + sendUpdates - Guests who should receive notifications about the event update (for example, title changes, etc.). # + supportsAttachments - Whether API client performing operation supports event attachments. Optional. The default is False. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function put calendars/[string calendarId]/events/[string eventId](Event payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? conferenceDataVersion = (), int? maxAttendees = (), "all"|"externalOnly"|"none"? sendUpdates = (), boolean? supportsAttachments = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "conferenceDataVersion": conferenceDataVersion, "maxAttendees": maxAttendees, "sendUpdates": sendUpdates, "supportsAttachments": supportsAttachments}; @@ -548,7 +548,7 @@ public isolated client class Client { # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + eventId - Event identifier. # + sendUpdates - Guests who should receive notifications about the deletion of the event. - # + return - if successful `()`, otherwise a `calendar:Error` + # + return - if successful `()`, otherwise a `gcalendar:Error` resource isolated function delete calendars/[string calendarId]/events/[string eventId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), "all"|"externalOnly"|"none"? sendUpdates = ()) returns Error? { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "sendUpdates": sendUpdates}; @@ -575,7 +575,7 @@ public isolated client class Client { # + maxAttendees - The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. # + sendUpdates - Guests who should receive notifications about the event update (for example, title changes, etc.). # + supportsAttachments - Whether API client performing operation supports event attachments. Optional. The default is False. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function patch calendars/[string calendarId]/events/[string eventId](Event payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? conferenceDataVersion = (), int? maxAttendees = (), "all"|"externalOnly"|"none"? sendUpdates = (), boolean? supportsAttachments = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "conferenceDataVersion": conferenceDataVersion, "maxAttendees": maxAttendees, "sendUpdates": sendUpdates, "supportsAttachments": supportsAttachments}; @@ -608,7 +608,7 @@ public isolated client class Client { # + timeMax - Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset. # + timeMin - Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset. # + timeZone - Time zone used in the response. Optional. The default is the time zone of the calendar. - # + return - A `calendar:Events` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Events` if successful, otherwise a `gcalendar:Error` resource isolated function get calendars/[string calendarId]/events/[string eventId]/instances("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? maxAttendees = (), int? maxResults = (), string? originalStart = (), string? pageToken = (), boolean? showDeleted = (), string? timeMax = (), string? timeMin = (), string? timeZone = ()) returns Events|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}/instances`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "maxAttendees": maxAttendees, "maxResults": maxResults, "originalStart": originalStart, "pageToken": pageToken, "showDeleted": showDeleted, "timeMax": timeMax, "timeMin": timeMin, "timeZone": timeZone}; @@ -632,7 +632,7 @@ public isolated client class Client { # + eventId - Event identifier. # + destination - Calendar identifier of the target calendar where the event is to be moved to. # + sendUpdates - Guests who should receive notifications about the change of the event's organizer. - # + return - A `calendar:Event` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` resource isolated function post calendars/[string calendarId]/events/[string eventId]/move(string destination, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), "all"|"externalOnly"|"none"? sendUpdates = ()) returns Event|Error { string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}/move`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "destination": destination, "sendUpdates": sendUpdates}; @@ -653,7 +653,7 @@ public isolated client class Client { # + oauth_token - OAuth 2.0 token for the current user. # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - # + return - A `calendar:Colors` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:Colors` if successful, otherwise a `gcalendar:Error` resource isolated function get colors("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Colors|Error { string resourcePath = string `/colors`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -674,7 +674,7 @@ public isolated client class Client { # + oauth_token - OAuth 2.0 token for the current user. # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - # + return - A `calendar:FreeBusyResponse` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:FreeBusyResponse` if successful, otherwise a `gcalendar:Error` resource isolated function post freeBusy(FreeBusyRequest payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns FreeBusyResponse|Error { string resourcePath = string `/freeBusy`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -707,7 +707,7 @@ public isolated client class Client { # If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. # Learn more about incremental synchronization. # Optional. The default is to return all entries. - # + return - A `calendar:CalendarList` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:CalendarList` if successful, otherwise a `gcalendar:Error` resource isolated function get users/me/calendarList("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), int? maxResults = (), "freeBusyReader"|"owner"|"reader"|"writer"? minAccessRole = (), string? pageToken = (), boolean? showDeleted = (), boolean? showHidden = (), string? syncToken = ()) returns CalendarList|Error { string resourcePath = string `/users/me/calendarList`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "maxResults": maxResults, "minAccessRole": minAccessRole, "pageToken": pageToken, "showDeleted": showDeleted, "showHidden": showHidden, "syncToken": syncToken}; @@ -729,7 +729,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + colorRgbFormat - Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. - # + return - A `calendar:CalendarListEntry` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` resource isolated function post users/me/calendarList(CalendarListEntry payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), boolean? colorRgbFormat = ()) returns CalendarListEntry|Error { string resourcePath = string `/users/me/calendarList`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "colorRgbFormat": colorRgbFormat}; @@ -753,7 +753,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - A `calendar:CalendarListEntry` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` resource isolated function get users/me/calendarList/[string calendarId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns CalendarListEntry|Error { string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -776,7 +776,7 @@ public isolated client class Client { # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + colorRgbFormat - Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. - # + return - A `calendar:CalendarListEntry` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` resource isolated function put users/me/calendarList/[string calendarId](CalendarListEntry payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), boolean? colorRgbFormat = ()) returns CalendarListEntry|Error { string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "colorRgbFormat": colorRgbFormat}; @@ -800,7 +800,7 @@ public isolated client class Client { # + prettyPrint - Returns response with indentations and line breaks. # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - # + return - If successful `()`, otherwise a `calendar:Error` + # + return - If successful `()`, otherwise a `gcalendar:Error` resource isolated function delete users/me/calendarList/[string calendarId]("json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = ()) returns Error? { string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser}; @@ -823,7 +823,7 @@ public isolated client class Client { # + quotaUser - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. # + calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. # + colorRgbFormat - Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. - # + return - A `calendar:CalendarListEntry` if successful, otherwise a `calendar:Error` + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` resource isolated function patch users/me/calendarList/[string calendarId](CalendarListEntry payload, "json"? alt = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), boolean? colorRgbFormat = ()) returns CalendarListEntry|Error { string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; map queryParam = {"alt": alt, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "colorRgbFormat": colorRgbFormat}; diff --git a/ballerina/modules/mock/openapi_service.bal b/ballerina/modules/mock/openapi_service.bal index 4c19ae51..28257727 100644 --- a/ballerina/modules/mock/openapi_service.bal +++ b/ballerina/modules/mock/openapi_service.bal @@ -26,7 +26,7 @@ service /calendar/v3 on new http:Listener(9090) { }, description: "calendar description", etag: "\"Syw9JucVAl83XRddaXunDD-xXrY\"", - id: "b8f24cd945da8adf629e1e680d3a423c197354709c50563e90bbaf9a5a911684@group.calendar.google.com", + id: "b8f24cd945da8adf629e1e680d3a423c197354709c50563e90bbaf9a5a911684@group.gcalendar.google.com", kind: "calendar#calendar", location: "Sri Lanka", summary: payload.summary, diff --git a/ballerina/tests/Config.toml b/ballerina/tests/Config.toml new file mode 100644 index 00000000..972de1b1 --- /dev/null +++ b/ballerina/tests/Config.toml @@ -0,0 +1,5 @@ +[googleapis.gcalendar] +mockClientId = "mock-client-id" +mockClientSecret = "mock-client-secret" +mockRefreshToken = "mock-refresh-token" +mockRefreshUrl = "http://localhost:9444/oauth2/token" diff --git a/ballerina/tests/README.md b/ballerina/tests/README.md new file mode 100644 index 00000000..7de31b56 --- /dev/null +++ b/ballerina/tests/README.md @@ -0,0 +1,39 @@ +# Running Tests + +There are two test environments for the Google Calendar connector. The default test environment is the mock server for Calendar API. The other test environment is testing against the actual Calendar API endpoint. You can run the tests in either of these environments and each has its own compatible set of tests. + + Groups | Environment + ---| --- + mock | Mock server + calendar | Calendar API + +## Running Tests in the Mock Server + +To execute the tests on the mock server, ensure that the `IS_TEST_ON_LIVE_SERVER` environment variable is either set to false or unset before initiating the tests. + +You can set your authentication credentials as environment variables: +```bash +export IS_TEST_ON_LIVE_SERVER=false +``` + +Then, run the following command to run the tests: +```bash + ./gradlew clean test +``` + +## Running Tests against Calendar API + + +You can set your authentication credentials as environment variables: +```bash +export IS_TEST_ON_LIVE_SERVER=true +export CLIENT_ID="" +export CLIENT_SECRET="" +export REFRESH_TOKEN="" +export REFRESH_URL="" +``` + +Then, run the following command to run the tests: +```bash + ./gradlew clean test -Pgroups="live" +``` diff --git a/ballerina/tests/test_client.bal b/ballerina/tests/test_client.bal index 19e12b75..762fad0b 100644 --- a/ballerina/tests/test_client.bal +++ b/ballerina/tests/test_client.bal @@ -14,7 +14,7 @@ // specific language governing permissions and limitations // under the License. -import ballerinax/googleapis.calendar.mock as _; +import ballerinax/googleapis.gcalendar.mock as _; import ballerina/os; import ballerina/test; diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index 4a3a4be3..61585eba 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -1,7 +1,7 @@ [package] distribution = "2201.8.0" org = "ballerinax" -name = "googleapis.calendar" +name = "googleapis.gcalendar" version = "@toml.version@" license = ["Apache-2.0"] authors = ["Ballerina"] diff --git a/build.gradle b/build.gradle index 169bcc8d..b168b21c 100644 --- a/build.gradle +++ b/build.gradle @@ -61,8 +61,8 @@ allprojects { def moduleVersion = project.version.replace("-SNAPSHOT", "") task build { - dependsOn(':googleapis.calendar-ballerina:build') - dependsOn(':googleapis.calendar-examples:build') + dependsOn(':googleapis.gcalendar-ballerina:build') + dependsOn(':googleapis.gcalendar-examples:build') } release { diff --git a/docs/spec/openapi.yaml b/docs/spec/openapi.yaml index 5bd947e3..493a4974 100644 --- a/docs/spec/openapi.yaml +++ b/docs/spec/openapi.yaml @@ -60,7 +60,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Calendar" - description: A `calendar:Calendar` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -81,7 +81,7 @@ paths: type: string responses: "200": - description: If successful `()`, otherwise an `calendar:Error` + description: If successful `()`, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -105,7 +105,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Calendar" - description: A `calendar:Calendar` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -146,7 +146,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Calendar" - description: A `calendar:Calendar` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -176,7 +176,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Calendar" - description: A `calendar:Calendar` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Calendar` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -226,7 +226,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Acl" - description: A `calendar:Acl` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Acl` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -268,7 +268,7 @@ paths: application/json: schema: $ref: "#/components/schemas/AclRule" - description: A `calendar:AclRule` if successful, otherwise an `calendar:Error` + description: A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -295,7 +295,7 @@ paths: type: string responses: "200": - description: If successful `()`, otherwise an `calendar:Error` + description: If successful `()`, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -325,7 +325,7 @@ paths: application/json: schema: $ref: "#/components/schemas/AclRule" - description: A `calendar:AclRule` if successful, otherwise an `calendar:Error` + description: A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -377,7 +377,7 @@ paths: application/json: schema: $ref: "#/components/schemas/AclRule" - description: A `calendar:AclRule` if successful, otherwise an `calendar:Error` + description: A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -418,7 +418,7 @@ paths: application/json: schema: $ref: "#/components/schemas/AclRule" - description: A `calendar:AclRule` if successful, otherwise an `calendar:Error` + description: A `gcalendar:AclRule` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -446,7 +446,7 @@ paths: type: string responses: "200": - description: If successful `()`, otherwise an `calendar:Error` + description: If successful `()`, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -596,7 +596,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Events" - description: A `calendar:Events` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Events` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -672,7 +672,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -726,7 +726,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -777,7 +777,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -817,7 +817,7 @@ paths: type: string responses: "200": - description: if successful `()`, otherwise an `calendar:Error` + description: if successful `()`, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -862,7 +862,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -944,7 +944,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1011,7 +1011,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1088,7 +1088,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Events" - description: A `calendar:Events` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Events` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1162,7 +1162,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Event" - description: A `calendar:Event` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Event` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1184,7 +1184,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Colors" - description: A `calendar:Colors` if successful, otherwise an `calendar:Error` + description: A `gcalendar:Colors` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1228,7 +1228,7 @@ paths: application/json: schema: $ref: "#/components/schemas/FreeBusyResponse" - description: A `calendar:FreeBusyResponse` if successful, otherwise an `calendar:Error` + description: A `gcalendar:FreeBusyResponse` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1292,7 +1292,7 @@ paths: application/json: schema: $ref: "#/components/schemas/CalendarList" - description: A `calendar:CalendarList` if successful, otherwise an `calendar:Error` + description: A `gcalendar:CalendarList` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1333,7 +1333,7 @@ paths: application/json: schema: $ref: "#/components/schemas/CalendarListEntry" - description: A `calendar:CalendarListEntry` if successful, otherwise an `calendar:Error` + description: A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1354,7 +1354,7 @@ paths: type: string responses: "200": - description: If successful `()`, otherwise an `calendar:Error` + description: If successful `()`, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1378,7 +1378,7 @@ paths: application/json: schema: $ref: "#/components/schemas/CalendarListEntry" - description: A `calendar:CalendarListEntry` if successful, otherwise an `calendar:Error` + description: A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1425,7 +1425,7 @@ paths: application/json: schema: $ref: "#/components/schemas/CalendarListEntry" - description: A `calendar:CalendarListEntry` if successful, otherwise an `calendar:Error` + description: A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1460,7 +1460,7 @@ paths: application/json: schema: $ref: "#/components/schemas/CalendarListEntry" - description: A `calendar:CalendarListEntry` if successful, otherwise an `calendar:Error` + description: A `gcalendar:CalendarListEntry` if successful, otherwise a `gcalendar:Error` security: - Oauth2: - https://www.googleapis.com/auth/calendar @@ -1724,7 +1724,7 @@ components: type: object Colors: properties: - calendar: + gcalendar: additionalProperties: $ref: "#/components/schemas/ColorDefinition" description: A calendar color definition. @@ -2472,7 +2472,7 @@ components: implicit: authorizationUrl: https://accounts.google.com/o/oauth2/auth scopes: - https://www.googleapis.com/auth/calendar: See, edit, share, and permanently delete all the calendars you can access using Google Calendar + https://www.googleapis.com/auth/gcalendar: See, edit, share, and permanently delete all the calendars you can access using Google Calendar https://www.googleapis.com/auth/calendar.events: View and edit events on all your calendars https://www.googleapis.com/auth/calendar.events.readonly: View events on all your calendars https://www.googleapis.com/auth/calendar.readonly: See and download any calendar you can access using your Google Calendar @@ -2483,7 +2483,7 @@ components: authorizationCode: authorizationUrl: https://accounts.google.com/o/oauth2/auth scopes: - https://www.googleapis.com/auth/calendar: See, edit, share, and permanently delete all the calendars you can access using Google Calendar + https://www.googleapis.com/auth/gcalendar: See, edit, share, and permanently delete all the calendars you can access using Google Calendar https://www.googleapis.com/auth/calendar.events: View and edit events on all your calendars https://www.googleapis.com/auth/calendar.events.readonly: View events on all your calendars https://www.googleapis.com/auth/calendar.readonly: See and download any calendar you can access using your Google Calendar diff --git a/examples/build.gradle b/examples/build.gradle index 7dd4952e..afbbaf72 100644 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -46,7 +46,7 @@ task testExamples { task buildExamples { gradle.taskGraph.whenReady { graph -> - if (graph.hasTask(":googleapis.calendar-examples:test")) { + if (graph.hasTask(":googleapis.gcalendar-examples:test")) { buildExamples.enabled = false } else { testExamples.enabled = false @@ -70,7 +70,7 @@ task buildExamples { } } -buildExamples.dependsOn ":googleapis.calendar-ballerina:build" -testExamples.dependsOn ":googleapis.calendar-ballerina:build" +buildExamples.dependsOn ":googleapis.gcalendar-ballerina:build" +testExamples.dependsOn ":googleapis.gcalendar-ballerina:build" build.dependsOn buildExamples diff --git a/examples/project-management-with-calendar/main.bal b/examples/project-management-with-calendar/main.bal index 07c20a1c..22d3d881 100644 --- a/examples/project-management-with-calendar/main.bal +++ b/examples/project-management-with-calendar/main.bal @@ -15,7 +15,7 @@ // under the License. import ballerina/log; -import ballerinax/googleapis.calendar; +import ballerinax/googleapis.gcalendar; import ballerina/os; configurable string clientId = os:getEnv("CLIENT_ID"); @@ -24,7 +24,7 @@ configurable string refreshToken = os:getEnv("REFRESH_TOKEN"); configurable string refreshUrl = os:getEnv("REFRESH_URL"); public function main() returns error? { - calendar:Client calendarClient = check new ({ + gcalendar:Client calendarClient = check new ({ auth: { clientId, clientSecret, @@ -33,11 +33,11 @@ public function main() returns error? { } }); - calendar:Calendar projectCalendar = check calendarClient->/calendars.post({ + gcalendar:Calendar projectCalendar = check calendarClient->/calendars.post({ summary: "Software Project - Alex" }); - calendar:Event codingSession = check calendarClient->/calendars/[projectCalendar.id]/events.post({ + gcalendar:Event codingSession = check calendarClient->/calendars/[projectCalendar.id]/events.post({ 'start: { dateTime: "2023-10-20T10:00:00+00:00", timeZone: "UTC" @@ -49,7 +49,7 @@ public function main() returns error? { summary: "Code Review" }); - calendar:Event|error designReview = calendarClient->/calendars/[projectCalendar.id]/events.post({ + gcalendar:Event|error designReview = calendarClient->/calendars/[projectCalendar.id]/events.post({ 'start: { dateTime: "2023-10-25T14:00:00+00:00", timeZone: "UTC" @@ -65,7 +65,7 @@ public function main() returns error? { log:printError(designReview.message()); } - calendar:Event|error updatedCodingSession = calendarClient->/calendars/[projectCalendar.id]/events/[codingSession.id].put({ + gcalendar:Event|error updatedCodingSession = calendarClient->/calendars/[projectCalendar.id]/events/[codingSession.id].put({ 'start: { dateTime: "2023-10-20T10:00:00+00:00", timeZone: "UTC" @@ -89,7 +89,7 @@ public function main() returns error? { log:printError(updatedCodingSession.message()); } - calendar:Event|error milestoneEvent = calendarClient->/calendars/[projectCalendar.id]/events.post({ + gcalendar:Event|error milestoneEvent = calendarClient->/calendars/[projectCalendar.id]/events.post({ 'start: { dateTime: "2023-11-15T09:00:00+00:00", timeZone: "UTC" @@ -117,7 +117,7 @@ public function main() returns error? { if milestoneEvent is error { log:printError(milestoneEvent.message()); } - calendar:Events|error projectEvents = calendarClient->/calendars/[projectCalendar.id]/events.get(); + gcalendar:Events|error projectEvents = calendarClient->/calendars/[projectCalendar.id]/events.get(); if projectEvents is error { log:printError(projectEvents.message()); diff --git a/examples/project-management-with-calendar/project-management-with-calendar.md b/examples/project-management-with-calendar/project-management-with-calendar.md index eacc80e9..23d18958 100644 --- a/examples/project-management-with-calendar/project-management-with-calendar.md +++ b/examples/project-management-with-calendar/project-management-with-calendar.md @@ -4,18 +4,18 @@ Let's explore how Alex, a software developer, leverages the Google Calendar API ## Step 1: Import Google Calendar Connector -Alex begins by importing the `ballerinax/googleapis.calendar` module into his Ballerina project. +Alex begins by importing the `ballerinax/googleapis.gcalendar` module into his Ballerina project. ```ballerina -import ballerinax/googleapis.calendar; +import ballerinax/googleapis.gcalendar; ``` ## Step 2: Create a Connector Instance -Next, Alex creates a `calendar:ConnectionConfig` with his OAuth2.0 tokens and initializes the connector. +Next, Alex creates a `gcalendar:ConnectionConfig` with his OAuth2.0 tokens and initializes the connector. ```ballerina -calendar:ConnectionConfig config = { +gcalendar:ConnectionConfig config = { auth: { clientId: , clientSecret: , @@ -24,7 +24,7 @@ calendar:ConnectionConfig config = { } }; -calendar:Client calendarClient = check new(config); +gcalendar:Client calendarClient = check new(config); ``` ## Step 3: Create a Project Calendar @@ -32,7 +32,7 @@ calendar:Client calendarClient = check new(config); To keep his project events organized, Alex's application creates a dedicated calendar with a descriptive title. ```ballerina -calendar:Calendar projectCalendar = check calendarClient->createCalendar({ +gcalendar:Calendar projectCalendar = check calendarClient->createCalendar({ summary: "Software Project - Alex" }); ``` @@ -42,7 +42,7 @@ calendar:Calendar projectCalendar = check calendarClient->createCalendar({ Alex schedules various project-related tasks using the Google Calendar API. This includes coding sessions, design reviews, and testing phases. ```ballerina -calendar:Event codingSession = check calendarClient->createEvent(projectCalendar.id, { +gcalendar:Event codingSession = check calendarClient->createEvent(projectCalendar.id, { 'start: { dateTime: "2023-10-20T10:00:00+00:00", timeZone: "UTC" @@ -54,7 +54,7 @@ calendar:Event codingSession = check calendarClient->createEvent(project summary: "Code Review" }); -calendar:Event designReview = check calendarClient->createEvent(projectCalendar.id, { +gcalendar:Event designReview = check calendarClient->createEvent(projectCalendar.id, { 'start: { dateTime: "2023-10-25T14:00:00+00:00", timeZone: "UTC" @@ -72,7 +72,7 @@ calendar:Event designReview = check calendarClient->createEvent(projectC Alex invites team members to project events by utilizing the Google Calendar API. This ensures that everyone involved is aware of and aligned on project milestones. ```ballerina -calendar:Event updatedCodingSession = check calendarClient->updateEvent(projectCalendar.id, codingSession.id, { +gcalendar:Event updatedCodingSession = check calendarClient->updateEvent(projectCalendar.id, codingSession.id, { 'start: { dateTime: "2023-10-20T10:00:00+00:00", timeZone: "UTC" @@ -98,7 +98,7 @@ calendar:Event updatedCodingSession = check calendarClient->updateEvent( To stay on top of project deadlines, Alex sets reminders for important milestones using the Google Calendar API. ```ballerina -calendar:Event milestoneEvent = check calendarClient->createEvent(projectCalendar.id, { +gcalendar:Event milestoneEvent = check calendarClient->createEvent(projectCalendar.id, { 'start: { dateTime: "2023-11-15T09:00:00+00:00", timeZone: "UTC" @@ -129,7 +129,7 @@ calendar:Event milestoneEvent = check calendarClient->createEvent(projec Alex regularly retrieves and analyzes project events using the Google Calendar API to monitor progress and make data-driven decisions. ```ballerina -calendar:Events projectEvents = check calendarClient->getEvents(projectCalendar.id, { +gcalendar:Events projectEvents = check calendarClient->getEvents(projectCalendar.id, { 'timeMin': "2023-10-01T00:00:00Z", 'timeMax': "2023-12-31T23:59:59Z", 'orderBy': "startTime", diff --git a/examples/work-schedule-management-with-calendar/main.bal b/examples/work-schedule-management-with-calendar/main.bal index fcddef93..536d4363 100644 --- a/examples/work-schedule-management-with-calendar/main.bal +++ b/examples/work-schedule-management-with-calendar/main.bal @@ -14,7 +14,7 @@ // specific language governing permissions and limitations // under the License. -import ballerinax/googleapis.calendar; +import ballerinax/googleapis.gcalendar; import ballerina/log; import ballerina/os; @@ -24,7 +24,7 @@ configurable string refreshToken = os:getEnv("REFRESH_TOKEN"); configurable string refreshUrl = os:getEnv("REFRESH_URL"); public function main() returns error? { - calendar:Client calendarClient = check new ({ + gcalendar:Client calendarClient = check new ({ auth: { clientId, clientSecret, @@ -34,12 +34,12 @@ public function main() returns error? { }); // create new calendar - calendar:Calendar calendarResult = check calendarClient->/calendars.post({ + gcalendar:Calendar calendarResult = check calendarClient->/calendars.post({ summary: "Work Schedule" }); // create new event - calendar:Event event = check calendarClient->/calendars/[calendarResult.id]/events.post({ + gcalendar:Event event = check calendarClient->/calendars/[calendarResult.id]/events.post({ 'start: { dateTime: "2023-10-19T09:00:00+05:30", timeZone: "Asia/Colombo" @@ -52,7 +52,7 @@ public function main() returns error? { }); // update event to invite attendees by email - calendar:Event updatedEvent = check calendarClient->/calendars/[calendarResult.id]/events/[event.id].put({ + gcalendar:Event updatedEvent = check calendarClient->/calendars/[calendarResult.id]/events/[event.id].put({ 'start: { dateTime: "2023-10-19T09:00:00+05:30", timeZone: "Asia/Colombo" @@ -75,7 +75,7 @@ public function main() returns error? { }); // update event to add reminders to send timely notifications to attendees before the meeting - calendar:Event|error reminderEvent = calendarClient->/calendars/[calendarResult.id]/events/[updatedEvent.id].put({ + gcalendar:Event|error reminderEvent = calendarClient->/calendars/[calendarResult.id]/events/[updatedEvent.id].put({ 'start: { dateTime: "2023-10-19T03:00:00+05:30", timeZone: "Asia/Colombo" @@ -98,7 +98,7 @@ public function main() returns error? { } // create access control rule and assign it to a team member - calendar:AclRule acl = check calendarClient->/calendars/[calendarResult.id]/acl.post({ + gcalendar:AclRule acl = check calendarClient->/calendars/[calendarResult.id]/acl.post({ scope: { 'type: "user", value: "team_member@gmail.com" @@ -107,7 +107,7 @@ public function main() returns error? { }); // change access control rule - calendar:AclRule|error response = calendarClient->/calendars/[calendarResult.id]/acl/[acl.id].put({ + gcalendar:AclRule|error response = calendarClient->/calendars/[calendarResult.id]/acl/[acl.id].put({ scope: { 'type: "user", value: "team_member@gmail.com" diff --git a/examples/work-schedule-management-with-calendar/work-schedule-management-with-calendar.md b/examples/work-schedule-management-with-calendar/work-schedule-management-with-calendar.md index c958416b..e288cfdd 100644 --- a/examples/work-schedule-management-with-calendar/work-schedule-management-with-calendar.md +++ b/examples/work-schedule-management-with-calendar/work-schedule-management-with-calendar.md @@ -4,18 +4,18 @@ Sarah relies on the Google Calendar API to efficiently manage her work schedule. ## Step 1: Import connector -Import the `ballerinax/googleapis.calendar` module into the Ballerina project. +Import the `ballerinax/googleapis.gcalendar` module into the Ballerina project. ```ballerina -import ballerinax/googleapis.calendar; +import ballerinax/googleapis.gcalendar; ``` ## Step 2: Create a new connector instance -Create a `calendar:ConnectionConfig` with the OAuth2.0 tokens obtained and initialize the connector with it. +Create a `gcalendar:ConnectionConfig` with the OAuth2.0 tokens obtained and initialize the connector with it. ```ballerina -calendar:ConnectionConfig config = { +gcalendar:ConnectionConfig config = { auth: { clientId: , clientSecret: @@ -24,17 +24,17 @@ calendar:ConnectionConfig config = { } }; -calendar:Client calendarClient = check new(config); +gcalendar:Client calendarClient = check new(config); ``` -Now, the `calendar:Client` instance can be used for the following steps. +Now, the `gcalendar:Client` instance can be used for the following steps. ### Creating a Work Calendar To keep her work events organized, Sarah's application creates a dedicated calendar. It sets the calendar's title, ensuring clarity for work-related events. ```ballerina -calendar:Calendar calendarResult = check calendarClient->createCalendar({ +gcalendar:Calendar calendarResult = check calendarClient->createCalendar({ summary: "Work Schedule" }); ``` @@ -44,7 +44,7 @@ calendar:Calendar calendarResult = check calendarClient->createCalendar({ Sarah's application empowers her to schedule work-related events, meetings, and deadlines using the Google Calendar API. It specifies the event's title, date, time, and time zone, ensuring all details are accurately captured. ```ballerina -calendar:Event event = check calendarClient->createEvent(calendarResult.id, { +gcalendar:Event event = check calendarClient->createEvent(calendarResult.id, { 'start: { dateTime: "2023-10-19T09:00:00+05:30", timeZone: "Asia/Colombo" @@ -62,7 +62,7 @@ calendar:Event event = check calendarClient->createEvent(calendarResult. When Sarah schedules meetings, her application uses the Google Calendar API to invite attendees by email. It sends out invitations and notifications, ensuring that all participants receive the necessary information. ```ballerina -calendar:Event updatedEvent = check calendarClient->updateEvent(calendarResult.id, event.id, { +gcalendar:Event updatedEvent = check calendarClient->updateEvent(calendarResult.id, event.id, { 'start: { dateTime: "2023-10-19T09:00:00+05:30", timeZone: "Asia/Colombo" @@ -94,7 +94,7 @@ Sarah's application allows her to schedule weekly team meetings as recurring eve In case there are changes to a meeting schedule or cancellations, Sarah's application leverages the API to update or delete events in her calendar. Attendees are automatically notified of any changes, ensuring everyone stays informed. ```ballerina -calendar:Event|error reminderEvent = calendarClient->updateEvent(calendarResult.id, updatedEvent.id, { +gcalendar:Event|error reminderEvent = calendarClient->updateEvent(calendarResult.id, updatedEvent.id, { 'start: { dateTime: "2023-10-19T09:00:00+05:30", timeZone: "Asia/Colombo" @@ -124,7 +124,7 @@ calendar:Event|error reminderEvent = calendarClient->updateEvent(calenda To ensure efficient collaboration, Sarah shares her work calendar with her project team members. She assigns appropriate permissions, such as read-only or edit access, to make sure the team is aware of her schedule and can coordinate their activities. ```ballerina -calendar:AclRule acl = check calendarClient->createAclRule(calendarResult.id, { +gcalendar:AclRule acl = check calendarClient->createAclRule(calendarResult.id, { scope: { 'type: "user", value: "team-member@gmail.com" @@ -138,7 +138,7 @@ calendar:AclRule acl = check calendarClient->createAclRule(calendarResul If necessary, Sarah can fine-tune access to her calendar using the API. For instance, she might restrict access to specific events or grant different permissions to different users. ```ballerina -calendar:AclRule|error response = calendarClient->updateAclRule(calendarResult.id, acl.id, { +gcalendar:AclRule|error response = calendarClient->updateAclRule(calendarResult.id, acl.id, { scope: { 'type: "user", value: "colleague@gmail.com" diff --git a/settings.gradle b/settings.gradle index 1f4a7211..1097f662 100644 --- a/settings.gradle +++ b/settings.gradle @@ -30,13 +30,13 @@ plugins { id "com.gradle.enterprise" version "3.2" } -rootProject.name = 'module-ballerinax-googleapis.calendar' +rootProject.name = 'module-ballerinax-googleapis.gcalendar' -include ':googleapis.calendar-ballerina' -include ':googleapis.calendar-examples' +include ':googleapis.gcalendar-ballerina' +include ':googleapis.gcalendar-examples' -project(':googleapis.calendar-ballerina').projectDir = file("ballerina") -project(':googleapis.calendar-examples').projectDir = file("examples") +project(':googleapis.gcalendar-ballerina').projectDir = file("ballerina") +project(':googleapis.gcalendar-examples').projectDir = file("examples") gradleEnterprise { buildScan {