Files
houston-be/pkg/google/googleDrive/drive_interface.go

30 lines
960 B
Go
Raw Normal View History

TP-44162 | Google Meet integration to create calendar invite with meeting link creation on incident creation (#277) * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-48200 | updated response messages in link and unlink jira apis (#278) * TP-44162 | resolved review comments * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-44162 | resolved review comments * TP-44162 | updated few naming conventions * TP-44162 | Adding timeouts to google drive api calls and related UTs * TP-44162 | Adding drive api timeout to viper for unit test --------- Co-authored-by: Sriram Bhargav <sriram.bhargav@navi.com> Co-authored-by: Shashank Shekhar <shashank.shekhar@navi.com>
2023-11-09 16:25:20 +05:30
package googleDrive
import (
"context"
"go.uber.org/zap"
"google.golang.org/api/drive/v3"
"google.golang.org/api/option"
"houston/internal/clients"
"houston/logger"
"net/http"
TP-44162 | Google Meet integration to create calendar invite with meeting link creation on incident creation (#277) * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-48200 | updated response messages in link and unlink jira apis (#278) * TP-44162 | resolved review comments * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-44162 | resolved review comments * TP-44162 | updated few naming conventions * TP-44162 | Adding timeouts to google drive api calls and related UTs * TP-44162 | Adding drive api timeout to viper for unit test --------- Co-authored-by: Sriram Bhargav <sriram.bhargav@navi.com> Co-authored-by: Shashank Shekhar <shashank.shekhar@navi.com>
2023-11-09 16:25:20 +05:30
"time"
)
type DriveActions interface {
TP-44162 | Google Meet integration to create calendar invite with meeting link creation on incident creation (#277) * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-48200 | updated response messages in link and unlink jira apis (#278) * TP-44162 | resolved review comments * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-44162 | resolved review comments * TP-44162 | updated few naming conventions * TP-44162 | Adding timeouts to google drive api calls and related UTs * TP-44162 | Adding drive api timeout to viper for unit test --------- Co-authored-by: Sriram Bhargav <sriram.bhargav@navi.com> Co-authored-by: Shashank Shekhar <shashank.shekhar@navi.com>
2023-11-09 16:25:20 +05:30
SearchInDrive(timeout time.Duration, query string) (*drive.FileList, error)
CreateDirectory(timeout time.Duration, directoryName string) (*drive.File, error)
DeleteFile(timeout time.Duration, fileId string) error
CopyFile(timeout time.Duration, fileId string, directoryId string) (*drive.File, error)
ExportFile(timeout time.Duration, fileId string, mimeType string) (*http.Response, error)
TP-44162 | Google Meet integration to create calendar invite with meeting link creation on incident creation (#277) * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-48200 | updated response messages in link and unlink jira apis (#278) * TP-44162 | resolved review comments * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-44162 | resolved review comments * TP-44162 | updated few naming conventions * TP-44162 | Adding timeouts to google drive api calls and related UTs * TP-44162 | Adding drive api timeout to viper for unit test --------- Co-authored-by: Sriram Bhargav <sriram.bhargav@navi.com> Co-authored-by: Shashank Shekhar <shashank.shekhar@navi.com>
2023-11-09 16:25:20 +05:30
}
func NewGoogleDriveActions() (*ActionsImpl, error) {
TP-44162 | Google Meet integration to create calendar invite with meeting link creation on incident creation (#277) * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-48200 | updated response messages in link and unlink jira apis (#278) * TP-44162 | resolved review comments * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-44162 | resolved review comments * TP-44162 | updated few naming conventions * TP-44162 | Adding timeouts to google drive api calls and related UTs * TP-44162 | Adding drive api timeout to viper for unit test --------- Co-authored-by: Sriram Bhargav <sriram.bhargav@navi.com> Co-authored-by: Shashank Shekhar <shashank.shekhar@navi.com>
2023-11-09 16:25:20 +05:30
driveService, err := drive.NewService(context.Background(), option.WithTokenSource(clients.GetGoogleTokenSource()))
if err != nil {
logger.Error("Unable to retrieve Drive client", zap.Error(err))
return nil, err
}
return &ActionsImpl{filesService: driveService.Files}, nil
TP-44162 | Google Meet integration to create calendar invite with meeting link creation on incident creation (#277) * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-48200 | updated response messages in link and unlink jira apis (#278) * TP-44162 | resolved review comments * TP-44158 | Adding service to get transcript files from Google Drive (#234) Adding service to get transcript files from Google Drive * TP-45120 (#275) TP-45120 | merging Google auth implementation and calendar event fix * TP-44162 | added service implementation for calendar actions * TP-44162 | Updated label in slack message * TP-44162 | Fixed build failures * TP-44162 | Updated sql migration file name * TP-44162 | added unit tests for google calendar service * TP-44162 | resolved review comments * TP-44162 | updated few naming conventions * TP-44162 | Adding timeouts to google drive api calls and related UTs * TP-44162 | Adding drive api timeout to viper for unit test --------- Co-authored-by: Sriram Bhargav <sriram.bhargav@navi.com> Co-authored-by: Shashank Shekhar <shashank.shekhar@navi.com>
2023-11-09 16:25:20 +05:30
}