Skip to content

Commit

Permalink
feat: use GWS Event API v1 (#272)
Browse files Browse the repository at this point in the history
Co-authored-by: pierrick <[email protected]>
  • Loading branch information
PierrickVoulet and pierrick authored Mar 24, 2024
1 parent d4f6b1f commit edf1e6e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
function createSpaceSubscription(spaceId) {
const response = UrlFetchApp.fetch(
`https://workspaceevents.googleapis.com/v1beta/subscriptions`,
`https://workspaceevents.googleapis.com/v1/subscriptions`,
{
method: "POST",
contentType: "application/json",
Expand Down Expand Up @@ -108,7 +108,7 @@ function ackSubscription(ackId) {
* @param {string} subscriptionId the ID of the subscription to renew
*/
function renewSubscription(subscriptionId) {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1beta/${subscriptionId}`, {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1/${subscriptionId}`, {
method: "PATCH",
contentType: "application/json",
headers: { "Authorization": "Bearer " + ScriptApp.getOAuthToken() },
Expand All @@ -122,7 +122,7 @@ function renewSubscription(subscriptionId) {
* @param {string} subscriptionId the ID of the subscription to delete
*/
function deleteSubscription(subscriptionId) {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1beta/${subscriptionId}`, {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1/${subscriptionId}`, {
method: "DELETE",
contentType: "application/json",
headers: { "Authorization": "Bearer " + ScriptApp.getOAuthToken() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
function createSpaceSubscription(spaceId) {
const response = UrlFetchApp.fetch(
`https://workspaceevents.googleapis.com/v1beta/subscriptions`,
`https://workspaceevents.googleapis.com/v1/subscriptions`,
{
method: "POST",
contentType: "application/json",
Expand Down Expand Up @@ -117,7 +117,7 @@ function ackSubscription(ackId) {
* @param {string} subscriptionId the ID of the subscription to renew
*/
function renewSubscription(subscriptionId) {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1beta/${subscriptionId}`, {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1/${subscriptionId}`, {
method: "PATCH",
contentType: "application/json",
headers: { "Authorization": "Bearer " + ScriptApp.getOAuthToken() },
Expand All @@ -131,7 +131,7 @@ function renewSubscription(subscriptionId) {
* @param {string} subscriptionId the ID of the subscription to delete
*/
function deleteSubscription(subscriptionId) {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1beta/${subscriptionId}`, {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1/${subscriptionId}`, {
method: "DELETE",
contentType: "application/json",
headers: { "Authorization": "Bearer " + ScriptApp.getOAuthToken() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
function createSpaceSubscription(spaceId) {
const response = UrlFetchApp.fetch(
`https://workspaceevents.googleapis.com/v1beta/subscriptions`,
`https://workspaceevents.googleapis.com/v1/subscriptions`,
{
method: "POST",
contentType: "application/json",
Expand Down Expand Up @@ -133,7 +133,7 @@ function ackSubscription(ackId) {
* @param {string} subscriptionId the ID of the subscription to renew
*/
function renewSubscription(subscriptionId) {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1beta/${subscriptionId}`, {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1/${subscriptionId}`, {
method: "PATCH",
contentType: "application/json",
headers: { "Authorization": "Bearer " + ScriptApp.getOAuthToken() },
Expand All @@ -147,7 +147,7 @@ function renewSubscription(subscriptionId) {
* @param {string} subscriptionId the ID of the subscription to delete
*/
function deleteSubscription(subscriptionId) {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1beta/${subscriptionId}`, {
UrlFetchApp.fetch(`https://workspaceevents.googleapis.com/v1/${subscriptionId}`, {
method: "DELETE",
contentType: "application/json",
headers: { "Authorization": "Bearer " + ScriptApp.getOAuthToken() }
Expand Down

0 comments on commit edf1e6e

Please sign in to comment.