From c60636d7999bc70016ada04d8255f7b0b7adb2fb Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Wed, 27 Nov 2024 05:12:56 +0530 Subject: [PATCH] Add the generated files into a separated directory --- ballerina/modules/oas/client.bal | 459 ++++++++++ ballerina/modules/oas/types.bal | 1366 ++++++++++++++++++++++++++++++ ballerina/modules/oas/utils.bal | 201 +++++ 3 files changed, 2026 insertions(+) create mode 100644 ballerina/modules/oas/client.bal create mode 100644 ballerina/modules/oas/types.bal create mode 100644 ballerina/modules/oas/utils.bal diff --git a/ballerina/modules/oas/client.bal b/ballerina/modules/oas/client.bal new file mode 100644 index 0000000..1f08285 --- /dev/null +++ b/ballerina/modules/oas/client.bal @@ -0,0 +1,459 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +import ballerina/http; + +# Manipulates events and other calendar data. +public isolated client class Client { + final http:Client clientEp; + # Gets invoked to initialize the `connector`. + # + # + config - The configurations to be used when initializing the `connector` + # + serviceUrl - URL of the target service + # + return - An error if connector initialization failed + public isolated function init(ConnectionConfig config, string serviceUrl = "https://www.googleapis.com/calendar/v3") returns error? { + http:ClientConfiguration httpClientConfig = {auth: config.auth, httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation}; + do { + if config.http1Settings is ClientHttp1Settings { + ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings); + httpClientConfig.http1Settings = {...settings}; + } + if config.http2Settings is http:ClientHttp2Settings { + httpClientConfig.http2Settings = check config.http2Settings.ensureType(http:ClientHttp2Settings); + } + if config.cache is http:CacheConfig { + httpClientConfig.cache = check config.cache.ensureType(http:CacheConfig); + } + if config.responseLimits is http:ResponseLimitConfigs { + httpClientConfig.responseLimits = check config.responseLimits.ensureType(http:ResponseLimitConfigs); + } + if config.secureSocket is http:ClientSecureSocket { + httpClientConfig.secureSocket = check config.secureSocket.ensureType(http:ClientSecureSocket); + } + if config.proxy is http:ProxyConfig { + httpClientConfig.proxy = check config.proxy.ensureType(http:ProxyConfig); + } + } + http:Client httpEp = check new (serviceUrl, httpClientConfig); + self.clientEp = httpEp; + return; + } + + # Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - If successful `()`, otherwise an error + resource isolated function delete calendars/[string calendarId](map headers = {}, *DeleteCalendarQueries queries) returns error? { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->delete(resourcePath, headers = headers); + } + + # Deletes an access control rule. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - If successful `()`, otherwise an error + resource isolated function delete calendars/[string calendarId]/acl/[string ruleId](map headers = {}, *CalendarAclDeleteQueries queries) returns error? { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->delete(resourcePath, headers = headers); + } + + # Deletes an event. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - if successful `()`, otherwise an error + resource isolated function delete calendars/[string calendarId]/events/[string eventId](map headers = {}, *CalendarEventsDeleteQueries queries) returns error? { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->delete(resourcePath, headers = headers); + } + + # Removes a calendar from the user's calendar list. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - If successful `()`, otherwise an error + resource isolated function delete users/me/calendarList/[string calendarId](map headers = {}, *CalendarCalendarlistDeleteQueries queries) returns error? { + string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->delete(resourcePath, headers = headers); + } + + # Returns metadata for a calendar. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Calendar` if successful, otherwise an error + resource isolated function get calendars/[string calendarId](map headers = {}, *CalendarCalendarsGetQueries queries) returns Calendar|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns the rules in the access control list for the calendar. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Acl` if successful, otherwise an error + resource isolated function get calendars/[string calendarId]/acl(map headers = {}, *CalendarAclListQueries queries) returns Acl|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns an access control rule. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:AclRule` if successful, otherwise an error + resource isolated function get calendars/[string calendarId]/acl/[string ruleId](map headers = {}, *CalendarAclGetQueries queries) returns AclRule|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns events on the specified calendar. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Events` if successful, otherwise an error + resource isolated function get calendars/[string calendarId]/events(map headers = {}, *CalendarEventsListQueries queries) returns Events|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events`; + map queryParamEncoding = {"eventTypes": {style: FORM, explode: true}, "privateExtendedProperty": {style: FORM, explode: true}, "sharedExtendedProperty": {style: FORM, explode: true}}; + resourcePath = resourcePath + check getPathForQueryParam(queries, queryParamEncoding); + return self.clientEp->get(resourcePath, headers); + } + + # Returns an event based on its Google Calendar ID. To retrieve an event using its iCalendar ID, call the events.list method using the iCalUID parameter. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Event` if successful, otherwise an error + resource isolated function get calendars/[string calendarId]/events/[string eventId](map headers = {}, *CalendarEventsGetQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns instances of the specified recurring event. + # + # + 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 - Recurring event identifier. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Events` if successful, otherwise an error + resource isolated function get calendars/[string calendarId]/events/[string eventId]/instances(map headers = {}, *CalendarEventsInstancesQueries queries) returns Events|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}/instances`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns the color definitions for calendars and events. + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Colors` if successful, otherwise an error + resource isolated function get colors(map headers = {}, *CalendarColorsGetQueries queries) returns Colors|error { + string resourcePath = string `/colors`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns the calendars on the user's calendar list. + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:CalendarList` if successful, otherwise an error + resource isolated function get users/me/calendarList(map headers = {}, *CalendarCalendarlistListQueries queries) returns CalendarList|error { + string resourcePath = string `/users/me/calendarList`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Returns a calendar from the user's calendar list. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise an error + resource isolated function get users/me/calendarList/[string calendarId](map headers = {}, *CalendarCalendarlistGetQueries queries) returns CalendarListEntry|error { + string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + return self.clientEp->get(resourcePath, headers); + } + + # Updates metadata for a calendar. This method supports patch semantics. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update the calendar. + # + return - A `gcalendar:Calendar` if successful, otherwise an error + resource isolated function patch calendars/[string calendarId](Calendar payload, map headers = {}, *CalendarCalendarsPatchQueries queries) returns Calendar|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->patch(resourcePath, request, headers); + } + + # Updates an access control rule. This method supports patch semantics. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update access permissions for the calendar + # + return - A `gcalendar:AclRule` if successful, otherwise an error + resource isolated function patch calendars/[string calendarId]/acl/[string ruleId](AclRule payload, map headers = {}, *CalendarAclPatchQueries queries) returns AclRule|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->patch(resourcePath, request, headers); + } + + # Updates an event. This method supports patch semantics. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update the event. + # + return - A `gcalendar:Event` if successful, otherwise an error + resource isolated function patch calendars/[string calendarId]/events/[string eventId](Event payload, map headers = {}, *CalendarEventsPatchQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->patch(resourcePath, request, headers); + } + + # Updates an existing calendar on the user's calendar list. This method supports patch semantics. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update an existing calendar entry on the user's calendar list + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise an error + resource isolated function patch users/me/calendarList/[string calendarId](CalendarListEntry payload, map headers = {}, *CalendarCalendarlistPatchQueries queries) returns CalendarListEntry|error { + string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->patch(resourcePath, request, headers); + } + + # Creates a secondary calendar. + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to create the calendar. + # + return - A `gcalendar:Calendar` if successful, otherwise an error + resource isolated function post calendars(Calendar payload, map headers = {}, *CreateCalendarQueries queries) returns Calendar|error { + string resourcePath = string `/calendars`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, headers); + } + + # Creates an access control rule. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to create access permissions for the calendar. + # + return - A `gcalendar:AclRule` if successful, otherwise an error + resource isolated function post calendars/[string calendarId]/acl(AclRule payload, map headers = {}, *CalendarAclInsertQueries queries) returns AclRule|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, headers); + } + + # Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - If successful `()`, otherwise an error + resource isolated function post calendars/[string calendarId]/clear(map headers = {}, *CalendarCalendarsClearQueries queries) returns error? { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/clear`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + return self.clientEp->post(resourcePath, request, headers); + } + + # Creates an event. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to create an event. + # + return - A `gcalendar:Event` if successful, otherwise an error + resource isolated function post calendars/[string calendarId]/events(Event payload, map headers = {}, *CalendarEventsInsertQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, headers); + } + + resource isolated function post calendars/[string calendarId]/events/'import(Event payload, map headers = {}, *CalendarEventsImportQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/import`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, headers); + } + + # Moves an event to another calendar, i.e. changes an event's organizer. + # + # + calendarId - Calendar identifier of the source calendar where the event currently is on. + # + eventId - Event identifier. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Event` if successful, otherwise an error + resource isolated function post calendars/[string calendarId]/events/[string eventId]/move(map headers = {}, *CalendarEventsMoveQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}/move`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + return self.clientEp->post(resourcePath, request, headers); + } + + # Creates an event based on a simple text string. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - A `gcalendar:Event` if successful, otherwise an error + resource isolated function post calendars/[string calendarId]/events/quickAdd(map headers = {}, *CalendarEventsQuickaddQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/quickAdd`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + return self.clientEp->post(resourcePath, request, headers); + } + + # Returns free/busy information for a set of calendars. + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to return free/busy information + # + return - A `gcalendar:FreeBusyResponse` if successful, otherwise an error + resource isolated function post freeBusy(FreeBusyRequest payload, map headers = {}, *CalendarFreebusyQueryQueries queries) returns FreeBusyResponse|error { + string resourcePath = string `/freeBusy`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, headers); + } + + # Inserts an existing calendar into the user's calendar list. + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to identify the calendar + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise an error + resource isolated function post users/me/calendarList(CalendarListEntry payload, map headers = {}, *CalendarCalendarlistInsertQueries queries) returns CalendarListEntry|error { + string resourcePath = string `/users/me/calendarList`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, headers); + } + + # Updates metadata for a calendar. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update the calendar. + # + return - A `gcalendar:Calendar` if successful, otherwise an error + resource isolated function put calendars/[string calendarId](Calendar payload, map headers = {}, *CalendarCalendarsUpdateQueries queries) returns Calendar|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->put(resourcePath, request, headers); + } + + # Updates an access control rule. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update access permissions for the calendar + # + return - A `gcalendar:AclRule` if successful, otherwise an error + resource isolated function put calendars/[string calendarId]/acl/[string ruleId](AclRule payload, map headers = {}, *CalendarAclUpdateQueries queries) returns AclRule|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/acl/${getEncodedUri(ruleId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->put(resourcePath, request, headers); + } + + # Updates an event. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update the event. + # + return - A `gcalendar:Event` if successful, otherwise an error + resource isolated function put calendars/[string calendarId]/events/[string eventId](Event payload, map headers = {}, *CalendarEventsUpdateQueries queries) returns Event|error { + string resourcePath = string `/calendars/${getEncodedUri(calendarId)}/events/${getEncodedUri(eventId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->put(resourcePath, request, headers); + } + + # Updates an existing calendar on the user's calendar list. + # + # + 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. + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + payload - Data required to update an existing calendar entry on the user's calendar list + # + return - A `gcalendar:CalendarListEntry` if successful, otherwise an error + resource isolated function put users/me/calendarList/[string calendarId](CalendarListEntry payload, map headers = {}, *CalendarCalendarlistUpdateQueries queries) returns CalendarListEntry|error { + string resourcePath = string `/users/me/calendarList/${getEncodedUri(calendarId)}`; + resourcePath = resourcePath + check getPathForQueryParam(queries); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->put(resourcePath, request, headers); + } +} diff --git a/ballerina/modules/oas/types.bal b/ballerina/modules/oas/types.bal new file mode 100644 index 0000000..d46fb41 --- /dev/null +++ b/ballerina/modules/oas/types.bal @@ -0,0 +1,1366 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +import ballerina/constraint; +import ballerina/http; + +# Represents the Queries record for the operation: calendar.acl.update +public type CalendarAclUpdateQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + boolean sendNotifications?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +public type FreeBusyResponse record { + # List of free/busy information for calendars. + record {|FreeBusyCalendar...;|} calendars?; + # Expansion of groups. + record {|FreeBusyGroup...;|} groups?; + # Type of the resource ("calendar#freeBusy"). + string kind = "calendar#freeBusy"; + # The end of the interval. + string timeMax?; + # The start of the interval. + string timeMin?; +}; + +# Extended properties of the event. +public type Event_extendedProperties record { + # Properties that are private to the copy of the event that appears on this calendar. + record {|string...;|} 'private?; + # Properties that are shared between copies of the event on other attendees' calendars. + record {|string...;|} shared?; +}; + +# Represents the Queries record for the operation: calendar.calendars.clear +public type CalendarCalendarsClearQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents conference solutions that users can utilize when scheduling or participating in events and meetings +public type ConferenceSolution record { + # The user-visible icon for this solution. + string iconUri?; + ConferenceSolutionKey 'key?; + # The user-visible name of this solution. Not localized. + string name?; +}; + +# Represents the Queries record for the operation: calendar.events.get +public type CalendarEventsGetQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Time zone used in the response. Optional. The default is the time zone of the calendar. + string timeZone?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; + # 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. + @constraint:Int {minValue: 1} + int maxAttendees?; +}; + +# Defines the date, time, and time zone information for events. +public type EventDateTime record { + # The date, in the format "yyyy-mm-dd", if this is an all-day event. + string date?; + # The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone. + string dateTime?; + # The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end. + string timeZone?; +}; + +# Represents the Queries record for the operation: calendar.events.move +public type CalendarEventsMoveQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Guests who should receive notifications about the change of the event's organizer. + "all"|"externalOnly"|"none" sendUpdates?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Calendar identifier of the target calendar where the event is to be moved to. + string destination; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.acl.list +public type CalendarAclListQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. + boolean showDeleted?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + # 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. + string syncToken?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + @constraint:Int {minValue: 1} + int maxResults?; + # Data format for the response. + "json" alt?; + # Token specifying which result page to return. Optional. + string pageToken?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents information for different methods of joining a conference or event. +public type EntryPoint record { + # The access code to access the conference. The maximum length is 128 characters. + # When creating new conference data, populate only the subset of {meetingCode, accessCode, passcode, password, pin} fields that match the terminology that the conference provider uses. Only the populated fields should be displayed. + # Optional. + string accessCode?; + # Features of the entry point, such as being toll or toll-free. One entry point can have multiple features. However, toll and toll-free cannot be both set on the same entry point. + string[] entryPointFeatures?; + # The type of the conference entry point. + # Possible values are: + # - "video" - joining a conference over HTTP. A conference can have zero or one video entry point. + # - "phone" - joining a conference by dialing a phone number. A conference can have zero or more phone entry points. + # - "sip" - joining a conference over SIP. A conference can have zero or one sip entry point. + # - "more" - further conference joining instructions, for example additional phone numbers. A conference can have zero or one more entry point. A conference with only a more entry point is not a valid conference. + string entryPointType?; + # The label for the URI. Visible to end users. Not localized. The maximum length is 512 characters. + # Examples: + # - for video: meet.google.com/aaa-bbbb-ccc + # - for phone: +1 123 268 2601 + # - for sip: 12345678@altostrat.com + # - for more: should not be filled + # Optional. + string label?; + # The meeting code to access the conference. The maximum length is 128 characters. + # When creating new conference data, populate only the subset of {meetingCode, accessCode, passcode, password, pin} fields that match the terminology that the conference provider uses. Only the populated fields should be displayed. + # Optional. + string meetingCode?; + # The passcode to access the conference. The maximum length is 128 characters. + # When creating new conference data, populate only the subset of {meetingCode, accessCode, passcode, password, pin} fields that match the terminology that the conference provider uses. Only the populated fields should be displayed. + string passcode?; + # The password to access the conference. The maximum length is 128 characters. + # When creating new conference data, populate only the subset of {meetingCode, accessCode, passcode, password, pin} fields that match the terminology that the conference provider uses. Only the populated fields should be displayed. + # Optional. + string password?; + # The PIN to access the conference. The maximum length is 128 characters. + # When creating new conference data, populate only the subset of {meetingCode, accessCode, passcode, password, pin} fields that match the terminology that the conference provider uses. Only the populated fields should be displayed. + # Optional. + string pin?; + # The CLDR/ISO 3166 region code for the country associated with this phone access. Example: "SE" for Sweden. + # Calendar backend will populate this field only for EntryPointType.PHONE. + string regionCode?; + # The URI of the entry point. The maximum length is 1300 characters. + # Format: + # - for video, http: or https: schema is required. + # - for phone, tel: schema is required. The URI should include the entire dial sequence (e.g., tel:+12345678900,,,123456789;1234). + # - for sip, sip: schema is required, e.g., sip:12345678@myprovider.com. + # - for more, http: or https: schema is required. + string uri?; +}; + +# The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. +public type Event_organizer record { + # The organizer's name, if available. + string displayName?; + # The organizer's email address, if available. It must be a valid email address as per RFC5322. + string email?; + # The organizer's Profile ID, if available. + string id?; + # Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + boolean self = false; +}; + +# Identifies the target calendar or group for which free/busy information is requested. +public type FreeBusyRequestItem record { + # The identifier of a calendar or a group. + string id?; +}; + +# Represents the Queries record for the operation: calendar.events.quickAdd +public type CalendarEventsQuickaddQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Guests who should receive notifications about the creation of the new event. + "all"|"externalOnly"|"none" sendUpdates?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # The text describing the event to be created. + string text; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.events.update +public type CalendarEventsUpdateQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Guests who should receive notifications about the event update (for example, title changes, etc.). + "all"|"externalOnly"|"none" sendUpdates?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Whether API client performing operation supports event attachments. Optional. The default is False. + boolean supportsAttachments?; + # 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. + @constraint:Int {minValue: 0, maxValue: 1} + int conferenceDataVersion?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; + # 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. + @constraint:Int {minValue: 1} + int maxAttendees?; +}; + +# Represents the Queries record for the operation: calendar.calendars.get +public type CalendarCalendarsGetQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.colors.get +public type CalendarColorsGetQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.calendarList.list +public type CalendarCalendarlistListQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Whether to include deleted calendar list entries in the result. Optional. The default is False. + boolean showDeleted?; + # Whether to show hidden entries. Optional. The default is False. + boolean showHidden?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. + # To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + # 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. + string syncToken?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + @constraint:Int {minValue: 1} + int maxResults?; + # The minimum access role for the user in the returned entries. Optional. The default is no restriction. + "freeBusyReader"|"owner"|"reader"|"writer" minAccessRole?; + # Data format for the response. + "json" alt?; + # Token specifying which result page to return. Optional. + string pageToken?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.calendarList.insert +public type CalendarCalendarlistInsertQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # 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. + boolean colorRgbFormat?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.acl.patch +public type CalendarAclPatchQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + boolean sendNotifications?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.acl.insert +public type CalendarAclInsertQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Whether to send notifications about the calendar sharing change. Optional. The default is True. + boolean sendNotifications?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.events.import +public type CalendarEventsImportQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Whether API client performing operation supports event attachments. Optional. The default is False. + boolean supportsAttachments?; + # 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. + @constraint:Int {minValue: 0, maxValue: 1} + int conferenceDataVersion?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. +@display {label: "Connection Config"} +public type ConnectionConfig record {| + # Configurations related to client authentication + http:BearerTokenConfig|OAuth2RefreshTokenGrantConfig auth; + # The HTTP version understood by the client + http:HttpVersion httpVersion = http:HTTP_2_0; + # Configurations related to HTTP/1.x protocol + ClientHttp1Settings http1Settings?; + # Configurations related to HTTP/2 protocol + http:ClientHttp2Settings http2Settings?; + # The maximum time to wait (in seconds) for a response before closing the connection + decimal timeout = 60; + # The choice of setting `forwarded`/`x-forwarded` header + string forwarded = "disable"; + # Configurations associated with request pooling + http:PoolConfiguration poolConfig?; + # HTTP caching related configurations + http:CacheConfig cache?; + # Specifies the way of handling compression (`accept-encoding`) header + http:Compression compression = http:COMPRESSION_AUTO; + # Configurations associated with the behaviour of the Circuit Breaker + http:CircuitBreakerConfig circuitBreaker?; + # Configurations associated with retrying + http:RetryConfig retryConfig?; + # Configurations associated with inbound response size limits + http:ResponseLimitConfigs responseLimits?; + # SSL/TLS-related options + http:ClientSecureSocket secureSocket?; + # Proxy server related options + http:ProxyConfig proxy?; + # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default + boolean validation = true; +|}; + +# Represents information about conferences associated with calendar events. +public type ConferenceData record { + # The ID of the conference. + # Can be used by developers to keep track of conferences, should not be displayed to users. + # The ID value is formed differently for each conference solution type: + # - eventHangout: ID is not set. (This conference type is deprecated.) + # - eventNamedHangout: ID is the name of the Hangout. (This conference type is deprecated.) + # - hangoutsMeet: ID is the 10-letter meeting code, for example aaa-bbbb-ccc. + # - addOn: ID is defined by the third-party provider. Optional. + string conferenceId?; + ConferenceSolution conferenceSolution?; + CreateConferenceRequest createRequest?; + # Information about individual conference entry points, such as URLs or phone numbers. + # All of them must belong to the same conference. + # Either conferenceSolution and at least one entryPoint, or createRequest is required. + EntryPoint[] entryPoints?; + # Additional notes (such as instructions from the domain administrator, legal notices) to display to the user. Can contain HTML. The maximum length is 2048 characters. Optional. + string notes?; + ConferenceParameters parameters?; + # The signature of the conference data. + # Generated on server side. + # Unset for a conference with a failed create request. + # Optional for a conference with a pending create request. + string signature?; +}; + +# Provides information about the current status of a conference create request. +public type ConferenceRequestStatus record { + # The current status of the conference create request. Read-only. + # The possible values are: + # - "pending": the conference create request is still being processed. + # - "success": the conference create request succeeded, the entry points are populated. + # - "failure": the conference create request failed, there are no entry points. + string statusCode?; +}; + +# Defines and represents time intervals or periods. +public type TimePeriod record { + # The (exclusive) end of the time period. + string end?; + # The (inclusive) start of the time period. + string 'start?; +}; + +# Represents the Queries record for the operation: calendar.acl.delete +public type CalendarAclDeleteQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the request to create a conference within a calendar event. +public type CreateConferenceRequest record { + ConferenceSolutionKey conferenceSolutionKey?; + # The client-generated unique ID for this request. + # Clients should regenerate this ID for every new request. If an ID provided is the same as for the previous request, the request is ignored. + string requestId?; + ConferenceRequestStatus status?; +}; + +# Represents the Queries record for the operation: calendar.events.list +public type CalendarEventsListQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + # There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + # + # These are: + # - iCalUID + # - orderBy + # - privateExtendedProperty + # - q + # - sharedExtendedProperty + # - timeMin + # - timeMax + # - updatedMin All other query parameters should be the same as for the initial synchronization to avoid undefined behavior. 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. + string syncToken?; + # Specifies an event ID in the iCalendar format to be provided in the response. Optional. Use this if you want to search for an event by its iCalendar ID. + string iCalUID?; + # Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. + string[] sharedExtendedProperty?; + # Data format for the response. + "json" alt?; + # The order of the events returned in the result. Optional. The default is an unspecified, stable order. + "startTime"|"updated" orderBy?; + # Time zone used in the response. Optional. The default is the time zone of the calendar. + string timeZone?; + # Whether to include hidden invitations in the result. Optional. The default is False. + boolean showHiddenInvitations?; + # 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. + string timeMin?; + # Event types to return. Optional. Possible values are: + # - "default" + # - "focusTime" + # - "outOfOffice" + # - "workingLocation"This parameter can be repeated multiple times to return events of different types. Currently, these are the only allowed values for this field: + # - ["default", "focusTime", "outOfOffice"] + # - ["default", "focusTime", "outOfOffice", "workingLocation"] + # - ["workingLocation"] The default is ["default", "focusTime", "outOfOffice"]. + # Additional combinations of these four event types will be made available in later releases. + string[] eventTypes?; + # Free text search terms to find events that match these terms in the following fields: summary, description, location, attendee's displayName, attendee's email. Optional. + string q?; + # Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + boolean showDeleted?; + # Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. + boolean singleEvents?; + # 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. + string updatedMin?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + @constraint:Int {minValue: 1} + int maxResults?; + # Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. + string[] privateExtendedProperty?; + # 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, for example, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but are ignored. If timeMin is set, timeMax must be greater than timeMin. + string timeMax?; + # Token specifying which result page to return. Optional. + string pageToken?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; + # 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. + @constraint:Int {minValue: 1} + int maxAttendees?; +}; + +# Response data with free/busy information. +public type FreeBusyCalendar record { + # List of time ranges during which this calendar should be regarded as busy. + TimePeriod[] busy?; + # Optional error(s) (if computation for the calendar failed). + Error[] errors?; +}; + +# Represents the Queries record for the operation: calendar.events.insert +public type CalendarEventsInsertQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Whether to send notifications about the creation of the new event. Note that some emails might still be sent. The default is false. + "all"|"externalOnly"|"none" sendUpdates?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Whether API client performing operation supports event attachments. Optional. The default is False. + boolean supportsAttachments?; + # 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. + @constraint:Int {minValue: 0, maxValue: 1} + int conferenceDataVersion?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; + # 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. + @constraint:Int {minValue: 1} + int maxAttendees?; +}; + +# The notifications that the authenticated user is receiving for this calendar. +public type CalendarListEntry_notificationSettings record { + # The list of notifications set for this calendar. + CalendarNotification[] notifications?; +}; + +# Represents a global palette of calendar and event colors used in Google Calendar. +public type Colors record { + # A global palette of calendar colors, mapping from the color ID to its definition. A calendarListEntry resource refers to one of these color IDs in its colorId field. Read-only. + record {|ColorDefinition...;|} calendar?; + # A global palette of event colors, mapping from the color ID to its definition. An event resource may refer to one of these color IDs in its colorId field. Read-only. + record {|ColorDefinition...;|} event?; + # Type of the resource ("calendar#colors"). + string kind = "calendar#colors"; + # Last modification time of the color palette (as a RFC3339 timestamp). Read-only. + string updated?; +}; + +# Information about the event's reminders for the authenticated user. +public type Event_reminders record { + # If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for this event. The maximum number of override reminders is 5. + EventReminder[] overrides?; + # Whether the default reminders of the calendar apply to the event. + boolean useDefault?; +}; + +# Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. Can only be seen or modified by the creator of the event. +public type Event_source record { + # Title of the source; for example a title of a web page or an email subject. + string title?; + # URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS. + string url?; +}; + +# Specify the types of conference solutions supported for a calendar. +public type ConferenceProperties record { + # The types of conference solutions that are supported for this calendar. + # The possible values are: + # - "eventHangout" + # - "eventNamedHangout" + # - "hangoutsMeet" Optional. + string[] allowedConferenceSolutionTypes?; +}; + +# Represents the Queries record for the operation: calendar.calendars.patch +public type CalendarCalendarsPatchQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# The creator of the event. Read-only. +public type Event_creator record { + # The creator's name, if available. + string displayName?; + # The creator's email address, if available. + string email?; + # The creator's Profile ID, if available. + string id?; + # Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + boolean self = false; +}; + +# Represents the Queries record for the operation: calendar.freebusy.query +public type CalendarFreebusyQueryQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.calendarList.get +public type CalendarCalendarlistGetQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Conveys information about the working location of a user during an event. +public type EventWorkingLocationProperties record { + EventWorkingLocationProperties_customLocation customLocation?; + # If present, specifies that the user is working at home. + anydata homeOffice?; + EventWorkingLocationProperties_officeLocation officeLocation?; + # Type of the working location. Possible values are: + # - "homeOffice" - The user is working at home. + # - "officeLocation" - The user is working from an office. + # - "customLocation" - The user is working from a custom location. Any details are specified in a sub-field of the specified name, but this field may be missing if empty. Any other fields are ignored. + # Required when adding working location properties. + string 'type?; +}; + +# Represents the Queries record for the operation: calendar.calendarList.patch +public type CalendarCalendarlistPatchQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # 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. + boolean colorRgbFormat?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: delete.calendar +public type DeleteCalendarQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.calendars.update +public type CalendarCalendarsUpdateQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: create.calendar +public type CreateCalendarQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represent calendar properties which allow users to manage and interact with their calendars effectively. +public type CalendarListEntry record { + # The effective access role that the authenticated user has on the calendar. Read-only. Possible values are: + # - "freeBusyReader" - Provides read access to free/busy information. + # - "reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + # - "writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + # - "owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs. + string accessRole?; + # The main color of the calendar in the hexadecimal format "#0088aa". This property supersedes the index-based colorId property. To set or change this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional. + string backgroundColor?; + # The color of the calendar. This is an ID referring to an entry in the calendar section of the colors definition (see the colors endpoint). This property is superseded by the backgroundColor and foregroundColor properties and can be ignored when using these properties. Optional. + string colorId?; + ConferenceProperties conferenceProperties?; + # The default reminders that the authenticated user has for this calendar. + EventReminder[] defaultReminders?; + # Whether this calendar list entry has been deleted from the calendar list. Read-only. Optional. The default is False. + boolean deleted = false; + # Description of the calendar. Optional. Read-only. + string description?; + # ETag of the resource. + string etag?; + # The foreground color of the calendar in the hexadecimal format "#ffffff". This property supersedes the index-based colorId property. To set or change this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional. + string foregroundColor?; + # Whether the calendar has been hidden from the list. Optional. The attribute is only returned when the calendar is hidden, in which case the value is true. + boolean hidden = false; + # Identifier of the calendar. + string id?; + # Type of the resource ("calendar#calendarListEntry"). + string kind = "calendar#calendarListEntry"; + # Geographic location of the calendar as free-form text. Optional. Read-only. + string location?; + CalendarListEntry_notificationSettings notificationSettings?; + # Whether the calendar is the primary calendar of the authenticated user. Read-only. Optional. The default is False. + boolean primary = false; + # Whether the calendar content shows up in the calendar UI. Optional. The default is False. + boolean selected = false; + # Title of the calendar. Read-only. + string summary?; + # The summary that the authenticated user has set for this calendar. Optional. + string summaryOverride?; + # The time zone of the calendar. Optional. Read-only. + string timeZone?; +}; + +# Reprsents event properties which allow users to access and manage calendar event. +public type Events record { + # The user's access role for this calendar. Read-only. Possible values are: + # - "none" - The user has no access. + # - "freeBusyReader" - The user has read access to free/busy information. + # - "reader" - The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + # - "writer" - The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + # - "owner" - The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs. + string accessRole?; + # The default reminders on the calendar for the authenticated user. These reminders apply to all events on this calendar that do not explicitly override them (i.e. do not have reminders.useDefault set to True). + EventReminder[] defaultReminders?; + # Description of the calendar. Read-only. + string description?; + # ETag of the collection. + string etag?; + # List of events on the calendar. + Event[] items?; + # Type of the collection ("calendar#events"). + string kind = "calendar#events"; + # Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. + string nextPageToken?; + # Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. + string nextSyncToken?; + # Title of the calendar. Read-only. + string summary?; + # The time zone of the calendar. Read-only. + string timeZone?; + # Last modification time of the calendar (as a RFC3339 timestamp). Read-only. + string updated?; +}; + +# Represents the Queries record for the operation: calendar.calendarList.update +public type CalendarCalendarlistUpdateQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # 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. + boolean colorRgbFormat?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# OAuth2 Refresh Token Grant Configs +public type OAuth2RefreshTokenGrantConfig record {| + *http:OAuth2RefreshTokenGrantConfig; + # Refresh URL + string refreshUrl = "https://accounts.google.com/o/oauth2/token"; +|}; + +# Represents the Queries record for the operation: calendar.acl.get +public type CalendarAclGetQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents list of calendars associated with the user's account. +public type CalendarList record { + # ETag of the collection. + string etag?; + # Calendars that are present on the user's calendar list. + CalendarListEntry[] items?; + # Type of the collection ("calendar#calendarList"). + string kind = "calendar#calendarList"; + # Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. + string nextPageToken?; + # Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. + string nextSyncToken?; +}; + +# Defines and manages color combinations associated with calendar events +public type ColorDefinition record { + # The background color associated with this color definition. + string background?; + # The foreground color that can be used to write on top of a background with 'background' color. + string foreground?; +}; + +# Allows users to define how and when to be reminded of upcoming events. +public type EventReminder record { + # The method used by this reminder. Possible values are: + # - "email" - Reminders are sent via email. + # - "popup" - Reminders are sent via a UI popup. + # Required when adding a reminder. + string method?; + # Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). + # Required when adding a reminder. + int:Signed32 minutes?; +}; + +# If present, specifies that the user is working from a custom location. +public type EventWorkingLocationProperties_customLocation record { + # An optional extra label for additional information. + string label?; +}; + +# Represents the Queries record for the operation: calendar.events.delete +public type CalendarEventsDeleteQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Guests who should receive notifications about the deletion of the event. + "all"|"externalOnly"|"none" sendUpdates?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Represents the Queries record for the operation: calendar.events.instances +public type CalendarEventsInstancesQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Data format for the response. + "json" alt?; + # Time zone used in the response. Optional. The default is the time zone of the calendar. + string timeZone?; + # 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. + string timeMin?; + # Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events will still be included if singleEvents is False. Optional. The default is False. + boolean showDeleted?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + @constraint:Int {minValue: 1} + int maxResults?; + # The original start time of the instance in the result. Optional. + string originalStart?; + # 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. + string timeMax?; + # Token specifying which result page to return. Optional. + string pageToken?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; + # 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. + @constraint:Int {minValue: 1} + int maxAttendees?; +}; + +# Manages and describes attendees and their responses to calendar events. +public type EventAttendee record { + # Number of additional guests. Optional. The default is 0. + int:Signed32 additionalGuests = 0; + # The attendee's response comment. Optional. + string comment?; + # The attendee's name, if available. Optional. + string displayName?; + # The attendee's email address, if available. This field must be present when adding an attendee. It must be a valid email address as per RFC5322. + # Required when adding an attendee. + string email?; + # The attendee's Profile ID, if available. + string id?; + # Whether this is an optional attendee. Optional. The default is False. + boolean optional = false; + # Whether the attendee is the organizer of the event. Read-only. The default is False. + boolean organizer?; + # Whether the attendee is a resource. Can only be set when the attendee is added to the event for the first time. Subsequent modifications are ignored. Optional. The default is False. + boolean 'resource = false; + # The attendee's response status. Possible values are: + # - "needsAction" - The attendee has not responded to the invitation (recommended for new events). + # - "declined" - The attendee has declined the invitation. + # - "tentative" - The attendee has tentatively accepted the invitation. + # - "accepted" - The attendee has accepted the invitation. Warning: If you add an event using the values declined, tentative, or accepted, attendees with the "Add invitations to my calendar" setting set to "When I respond to invitation in email" won't see an event on their calendar unless they choose to change their invitation response in the event invitation email. + string responseStatus?; + # Whether this entry represents the calendar on which this copy of the event appears. Read-only. The default is False. + boolean self = false; +}; + +# Defines and manages individual calendars. +public type Calendar record { + ConferenceProperties conferenceProperties?; + # Description of the calendar. Optional. + string description?; + # ETag of the resource. + string etag?; + # Identifier of the calendar. To retrieve IDs call the calendarList.list() method. + string id?; + # Type of the resource ("calendar#calendar"). + string kind = "calendar#calendar"; + # Geographic location of the calendar as free-form text. Optional. + string location?; + # Title of the calendar. + string summary?; + # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional. + string timeZone?; +}; + +# The extent to which calendar access is granted by this ACL rule. +public type AclRule_scope record { + # The type of the scope. Possible values are: + # - "default" - The public scope. This is the default value. + # - "user" - Limits the scope to a single user. + # - "group" - Limits the scope to a group. + # - "domain" - Limits the scope to a domain. Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not. + string 'type?; + # The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type "default". + string value?; +}; + +# Represents detailed information about errors encountered in operations. +public type Error record { + # Domain, or broad category, of the error. + string domain?; + # Specific reason for the error. Some of the possible values are: + # - "groupTooBig" - The group of users requested is too large for a single query. + # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query. + # - "notFound" - The requested resource was not found. + # - "internalError" - The API service has encountered an internal error. Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list. + string reason?; +}; + +# Manages access control and permissions for calendars and events. +public type Acl record { + # ETag of the collection. + string etag?; + # List of rules on the access control list. + AclRule[] items?; + # Type of the collection ("calendar#acl"). + string kind = "calendar#acl"; + # Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. + string nextPageToken?; + # Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. + string nextSyncToken?; +}; + +# Proxy server configurations to be used with the HTTP client endpoint. +public type ProxyConfig record {| + # Host name of the proxy server + string host = ""; + # Proxy server port + int port = 0; + # Proxy server username + string userName = ""; + # Proxy server password + @display {label: "", kind: "password"} + string password = ""; +|}; + +# Provides information about free/busy schedules for a group of calendars. +public type FreeBusyGroup record { + # List of calendars' identifiers within a group. + string[] calendars?; + # Optional error(s) (if computation for the group failed). + Error[] errors?; +}; + +# Manages notification preferences of the calendars. +public type CalendarNotification record { + # The method used to deliver the notification. The possible value is: + # - "email" - Notifications are sent via email. + # Required when adding a notification. + string method?; + # The type of notification. Possible values are: + # - "eventCreation" - Notification sent when a new event is put on the calendar. + # - "eventChange" - Notification sent when an event is changed. + # - "eventCancellation" - Notification sent when an event is cancelled. + # - "eventResponse" - Notification sent when an attendee responds to the event invitation. + # - "agenda" - An agenda with the events of the day (sent out in the morning). + # Required when adding a notification. + string 'type?; +}; + +# Contains parameters for a request to retrieve free/busy information for a set of calendars and groups. +public type FreeBusyRequest record { + # Maximal number of calendars for which FreeBusy information is to be provided. Optional. Maximum value is 50. + int:Signed32 calendarExpansionMax?; + # Maximal number of calendar identifiers to be provided for a single group. Optional. An error is returned for a group with more members than this value. Maximum value is 100. + int:Signed32 groupExpansionMax?; + # List of calendars and/or groups to query. + FreeBusyRequestItem[] items?; + # The end of the interval for the query formatted as per RFC3339. + string timeMax?; + # The start of the interval for the query formatted as per RFC3339. + string timeMin?; + # Time zone used in the response. Optional. The default is UTC. + string timeZone = "UTC"; +}; + +# Represents the Queries record for the operation: calendar.events.patch +public type CalendarEventsPatchQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Guests who should receive notifications about the event update (for example, title changes, etc.). + "all"|"externalOnly"|"none" sendUpdates?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # Whether API client performing operation supports event attachments. Optional. The default is False. + boolean supportsAttachments?; + # 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. + @constraint:Int {minValue: 0, maxValue: 1} + int conferenceDataVersion?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; + # 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. + @constraint:Int {minValue: 1} + int maxAttendees?; +}; + +# Represents the Queries record for the operation: calendar.calendarList.delete +public type CalendarCalendarlistDeleteQueries record { + # An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + string quotaUser?; + # Returns response with indentations and line breaks. + boolean prettyPrint?; + # OAuth 2.0 token for the current user. + string oauth_token?; + # Data format for the response. + "json" alt?; + # Selector specifying which fields to include in a partial response. + string fields?; + # API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + string 'key?; +}; + +# Contains information about an attachment associated with an event. +public type EventAttachment record { + # ID of the attached file. Read-only. + # For Google Drive files, this is the ID of the corresponding Files resource entry in the Drive API. + string fileId?; + # URL link to the attachment. + # For adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API. + # Required when adding an attachment. + string fileUrl?; + # URL link to the attachment's icon. This field can only be modified for custom third-party attachments. + string iconLink?; + # Internet media type (MIME type) of the attachment. + string mimeType?; + # Attachment title. + string title?; +}; + +# Represents the key information for a conference solution. +public type ConferenceSolutionKey record { + # The conference solution type. + # If a client encounters an unfamiliar or empty type, it should still be able to display the entry points. However, it should disallow modifications. + # The possible values are: + # - "eventHangout" for Hangouts for consumers (deprecated; existing events may show this conference solution type but new conferences cannot be created) + # - "eventNamedHangout" for classic Hangouts for Google Workspace users (deprecated; existing events may show this conference solution type but new conferences cannot be created) + # - "hangoutsMeet" for Google Meet (http://meet.google.com) + # - "addOn" for 3P conference providers + string 'type?; +}; + +# This type is used for adding parameters that control the behavior of a conference. +public type ConferenceParametersAddOnParameters record { + record {|string...;|} parameters?; +}; + +# Provides settings related to HTTP/1.x protocol. +public type ClientHttp1Settings record {| + # Specifies whether to reuse a connection for multiple requests + http:KeepAlive keepAlive = http:KEEPALIVE_AUTO; + # The chunking behaviour of the request + http:Chunking chunking = http:CHUNKING_AUTO; + # Proxy server related options + ProxyConfig proxy?; +|}; + +# Represents parameters related to conference settings for events. +public type ConferenceParameters record { + ConferenceParametersAddOnParameters addOnParameters?; +}; + +# Represents an event in Google Calendar +public type Event record { + # Whether anyone can invite themselves to the event (deprecated). Optional. The default is False. + boolean anyoneCanAddSelf = false; + # File attachments for the event. + # In order to modify attachments the supportsAttachments request parameter should be set to true. + # There can be at most 25 attachments per event, + EventAttachment[] attachments?; + # The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users. Service accounts need to use domain-wide delegation of authority to populate the attendee list. + EventAttendee[] attendees?; + # Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the maxAttendee query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False. + boolean attendeesOmitted = false; + # The color of the event. This is an ID referring to an entry in the event section of the colors definition (see the colors endpoint). Optional. + string colorId?; + ConferenceData conferenceData?; + # Creation time of the event (as a RFC3339 timestamp). Read-only. + string created?; + Event_creator creator?; + # Description of the event. Can contain HTML. Optional. + string description?; + EventDateTime end?; + # Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. The default is False. + boolean endTimeUnspecified = false; + # ETag of the resource. + string etag?; + # Specific type of the event. This cannot be modified after the event is created. Possible values are: + # - "default" - A regular event or not further specified. + # - "outOfOffice" - An out-of-office event. + # - "focusTime" - A focus-time event. + # - "workingLocation" - A working location event. Currently, only "default " and "workingLocation" events can be created using the API. Extended support for other event types will be made available in later releases. + string eventType = "default"; + Event_extendedProperties extendedProperties?; + # Whether attendees other than the organizer can invite others to the event. Optional. The default is True. + boolean guestsCanInviteOthers = true; + # Whether attendees other than the organizer can modify the event. Optional. The default is False. + boolean guestsCanModify = false; + # Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True. + boolean guestsCanSeeOtherGuests = true; + # An absolute link to the Google Hangout associated with this event. Read-only. + string hangoutLink?; + # An absolute link to this event in the Google Calendar Web UI. Read-only. + string htmlLink?; + # Event unique identifier as defined in RFC5545. It is used to uniquely identify events accross calendaring systems and must be supplied when importing events via the import method. + # Note that the iCalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same iCalUIDs. To retrieve an event using its iCalUID, call the events.list method using the iCalUID parameter. To retrieve an event using its id, call the events.get method. + string iCalUID?; + # Opaque identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules: + # - characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938 + # - the length of the ID must be between 5 and 1024 characters + # - the ID must be unique per calendar Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122. + # If you do not specify an ID, it will be automatically generated by the server. + # Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs. + string id?; + # Type of the resource ("calendar#event"). + string kind = "calendar#event"; + # Geographic location of the event as free-form text. Optional. + string location?; + # Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or "recurrence". The default is False. Read-Only. + boolean locked = false; + Event_organizer organizer?; + EventDateTime originalStartTime?; + # If set to True, Event propagation is disabled. Note that it is not the same thing as Private event properties. Optional. Immutable. The default is False. + boolean privateCopy = false; + # List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this field; event start and end times are specified in the start and end fields. This field is omitted for single events or instances of recurring events. + string[] recurrence?; + # For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. + string recurringEventId?; + Event_reminders reminders?; + # Sequence number as per iCalendar. + int:Signed32 sequence?; + Event_source 'source?; + EventDateTime 'start?; + # Status of the event. Optional. Possible values are: + # - "confirmed" - The event is confirmed. This is the default status. + # - "tentative" - The event is tentatively confirmed. + # - "cancelled" - The event is cancelled (deleted). The list method returns cancelled events only on incremental sync (when syncToken or updatedMin are specified) or if the showDeleted flag is set to true. The get method always returns them. + # A cancelled status represents two different states depending on the event type: + # - Cancelled exceptions of an uncancelled recurring event indicate that this instance should no longer be presented to the user. Clients should store these events for the lifetime of the parent recurring event. + # Cancelled exceptions are only guaranteed to have values for the id, recurringEventId and originalStartTime fields populated. The other fields might be empty. + # - All other cancelled events represent deleted events. Clients should remove their locally synced copies. Such cancelled events will eventually disappear, so do not rely on them being available indefinitely. + # Deleted events are only guaranteed to have the id field populated. On the organizer's calendar, cancelled events continue to expose event details (summary, location, etc.) so that they can be restored (undeleted). Similarly, the events to which the user was invited and that they manually removed continue to provide details. However, incremental sync requests with showDeleted set to false will not return these details. + # If an event changes its organizer (for example via the move operation) and the original organizer is not on the attendee list, it will leave behind a cancelled event where only the id field is guaranteed to be populated. + string status?; + # Title of the event. + string summary?; + # Whether the event blocks time on the calendar. Optional. Possible values are: + # - "opaque" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI. + # - "transparent" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI. + string transparency = "opaque"; + # Last modification time of the event (as a RFC3339 timestamp). Read-only. + string updated?; + # Visibility of the event. Optional. Possible values are: + # - "default" - Uses the default visibility for events on the calendar. This is the default value. + # - "public" - The event is public and event details are visible to all readers of the calendar. + # - "private" - The event is private and only event attendees may view event details. + # - "confidential" - The event is private. This value is provided for compatibility reasons. + string visibility = "default"; + EventWorkingLocationProperties workingLocationProperties?; +}; + +# Defines access control rules for a calendar +public type AclRule record { + # ETag of the resource. + string etag?; + # Identifier of the Access Control List (ACL) rule. See Sharing calendars. + string id?; + # Type of the resource ("calendar#aclRule"). + string kind = "calendar#aclRule"; + # The role assigned to the scope. Possible values are: + # - "none" - Provides no access. + # - "freeBusyReader" - Provides read access to free/busy information. + # - "reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + # - "writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + # - "owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs. + string role?; + AclRule_scope scope?; +}; + +# If present, specifies that the user is working from an office. +public type EventWorkingLocationProperties_officeLocation record { + # An optional building identifier. This should reference a building ID in the organization's Resources database. + string buildingId?; + # An optional desk identifier. + string deskId?; + # An optional floor identifier. + string floorId?; + # An optional floor section identifier. + string floorSectionId?; + # The office name that's displayed in Calendar Web and Mobile clients. We recommend you reference a building name in the organization's Resources database. + string label?; +}; diff --git a/ballerina/modules/oas/utils.bal b/ballerina/modules/oas/utils.bal new file mode 100644 index 0000000..8fb8e44 --- /dev/null +++ b/ballerina/modules/oas/utils.bal @@ -0,0 +1,201 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +import ballerina/url; + +type SimpleBasicType string|boolean|int|float|decimal; + +# Represents encoding mechanism details. +type Encoding record { + # Defines how multiple values are delimited + string style = FORM; + # Specifies whether arrays and objects should generate as separate fields + boolean explode = true; + # Specifies the custom content type + string contentType?; + # Specifies the custom headers + map headers?; +}; + +enum EncodingStyle { + DEEPOBJECT, FORM, SPACEDELIMITED, PIPEDELIMITED +} + +final Encoding & readonly defaultEncoding = {}; + +# Serialize the record according to the deepObject style. +# +# + parent - Parent record name +# + anyRecord - Record to be serialized +# + return - Serialized record as a string +isolated function getDeepObjectStyleRequest(string parent, record {} anyRecord) returns string { + string[] recordArray = []; + foreach [string, anydata] [key, value] in anyRecord.entries() { + if value is SimpleBasicType { + recordArray.push(parent + "[" + key + "]" + "=" + getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + recordArray.push(getSerializedArray(parent + "[" + key + "]" + "[]", value, DEEPOBJECT, true)); + } else if value is record {} { + string nextParent = parent + "[" + key + "]"; + recordArray.push(getDeepObjectStyleRequest(nextParent, value)); + } else if value is record {}[] { + string nextParent = parent + "[" + key + "]"; + recordArray.push(getSerializedRecordArray(nextParent, value, DEEPOBJECT)); + } + recordArray.push("&"); + } + _ = recordArray.pop(); + return string:'join("", ...recordArray); +} + +# Serialize the record according to the form style. +# +# + parent - Parent record name +# + anyRecord - Record to be serialized +# + explode - Specifies whether arrays and objects should generate separate parameters +# + return - Serialized record as a string +isolated function getFormStyleRequest(string parent, record {} anyRecord, boolean explode = true) returns string { + string[] recordArray = []; + if explode { + foreach [string, anydata] [key, value] in anyRecord.entries() { + if value is SimpleBasicType { + recordArray.push(key, "=", getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + recordArray.push(getSerializedArray(key, value, explode = explode)); + } else if value is record {} { + recordArray.push(getFormStyleRequest(parent, value, explode)); + } + recordArray.push("&"); + } + _ = recordArray.pop(); + } else { + foreach [string, anydata] [key, value] in anyRecord.entries() { + if value is SimpleBasicType { + recordArray.push(key, ",", getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + recordArray.push(getSerializedArray(key, value, explode = false)); + } else if value is record {} { + recordArray.push(getFormStyleRequest(parent, value, explode)); + } + recordArray.push(","); + } + _ = recordArray.pop(); + } + return string:'join("", ...recordArray); +} + +# Serialize arrays. +# +# + arrayName - Name of the field with arrays +# + anyArray - Array to be serialized +# + style - Defines how multiple values are delimited +# + explode - Specifies whether arrays and objects should generate separate parameters +# + return - Serialized array as a string +isolated function getSerializedArray(string arrayName, anydata[] anyArray, string style = "form", boolean explode = true) returns string { + string key = arrayName; + string[] arrayValues = []; + if anyArray.length() > 0 { + if style == FORM && !explode { + arrayValues.push(key, "="); + foreach anydata i in anyArray { + arrayValues.push(getEncodedUri(i.toString()), ","); + } + } else if style == SPACEDELIMITED && !explode { + arrayValues.push(key, "="); + foreach anydata i in anyArray { + arrayValues.push(getEncodedUri(i.toString()), "%20"); + } + } else if style == PIPEDELIMITED && !explode { + arrayValues.push(key, "="); + foreach anydata i in anyArray { + arrayValues.push(getEncodedUri(i.toString()), "|"); + } + } else if style == DEEPOBJECT { + foreach anydata i in anyArray { + arrayValues.push(key, "[]", "=", getEncodedUri(i.toString()), "&"); + } + } else { + foreach anydata i in anyArray { + arrayValues.push(key, "=", getEncodedUri(i.toString()), "&"); + } + } + _ = arrayValues.pop(); + } + return string:'join("", ...arrayValues); +} + +# Serialize the array of records according to the form style. +# +# + parent - Parent record name +# + value - Array of records to be serialized +# + style - Defines how multiple values are delimited +# + explode - Specifies whether arrays and objects should generate separate parameters +# + return - Serialized record as a string +isolated function getSerializedRecordArray(string parent, record {}[] value, string style = FORM, boolean explode = true) returns string { + string[] serializedArray = []; + if style == DEEPOBJECT { + int arayIndex = 0; + foreach var recordItem in value { + serializedArray.push(getDeepObjectStyleRequest(parent + "[" + arayIndex.toString() + "]", recordItem), "&"); + arayIndex = arayIndex + 1; + } + } else { + if !explode { + serializedArray.push(parent, "="); + } + foreach var recordItem in value { + serializedArray.push(getFormStyleRequest(parent, recordItem, explode), ","); + } + } + _ = serializedArray.pop(); + return string:'join("", ...serializedArray); +} + +# Get Encoded URI for a given value. +# +# + value - Value to be encoded +# + return - Encoded string +isolated function getEncodedUri(anydata value) returns string { + string|error encoded = url:encode(value.toString(), "UTF8"); + if encoded is string { + return encoded; + } else { + return value.toString(); + } +} + +# Generate query path with query parameter. +# +# + queryParam - Query parameter map +# + encodingMap - Details on serialization mechanism +# + return - Returns generated Path or error at failure of client initialization +isolated function getPathForQueryParam(map queryParam, map encodingMap = {}) returns string|error { + string[] param = []; + if queryParam.length() > 0 { + param.push("?"); + foreach var [key, value] in queryParam.entries() { + if value is () { + _ = queryParam.remove(key); + continue; + } + Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; + if value is SimpleBasicType { + param.push(key, "=", getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + param.push(getSerializedArray(key, value, encodingData.style, encodingData.explode)); + } else if value is record {} { + if encodingData.style == DEEPOBJECT { + param.push(getDeepObjectStyleRequest(key, value)); + } else { + param.push(getFormStyleRequest(key, value, encodingData.explode)); + } + } else { + param.push(key, "=", value.toString()); + } + param.push("&"); + } + _ = param.pop(); + } + string restOfPath = string:'join("", ...param); + return restOfPath; +}