oncall-engine/engine/apps/google/models/google_oauth2_user.py
Joey Orlando 33364b63c6
Google Calendar Out of Office events - autogenerated shift swap requests (#4104)
# What this PR does

## Which issue(s) this PR closes

Closes https://github.com/grafana/oncall-private/issues/2590

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required) - will be done in
https://github.com/grafana/oncall-private/issues/2591
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
show up in the autogenerated release notes. - will be done in
https://github.com/grafana/oncall-private/issues/2591

---------

Co-authored-by: Dominik <dominik.broj@grafana.com>
Co-authored-by: Maxim Mordasov <maxim.mordasov@grafana.com>
2024-04-02 20:10:16 +00:00

21 lines
724 B
Python

import typing
from django.db import models
from mirage import fields as mirage_fields
if typing.TYPE_CHECKING:
from apps.user_management.models import User
class GoogleOAuth2User(models.Model):
user: "User"
id = models.AutoField(primary_key=True)
user = models.OneToOneField(
to="user_management.User", null=False, blank=False, related_name="google_oauth2_user", on_delete=models.CASCADE
)
google_user_id = models.CharField(max_length=100)
access_token = mirage_fields.EncryptedCharField(max_length=300)
refresh_token = mirage_fields.EncryptedCharField(max_length=300)
oauth_scope = models.TextField(max_length=30000)
created_at = models.DateTimeField(auto_now_add=True)