mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2025-06-25 02:52:27 +00:00
#1 Implements Notifications API
This commit is contained in:
@ -12,6 +12,17 @@ type Capabilities struct {
|
||||
Activity struct {
|
||||
Apiv2 []string `json:"apiv2"`
|
||||
} `json:"activity"`
|
||||
Ocm struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
APIVersion string `json:"apiVersion"`
|
||||
EndPoint string `json:"endPoint"`
|
||||
ShareTypes []struct {
|
||||
Name string `json:"name"`
|
||||
Protocols struct {
|
||||
Webdav string `json:"webdav"`
|
||||
} `json:"protocols"`
|
||||
} `json:"shareTypes"`
|
||||
} `json:"ocm"`
|
||||
Dav struct {
|
||||
Chunking string `json:"chunking"`
|
||||
} `json:"dav"`
|
||||
@ -43,7 +54,8 @@ type Capabilities struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
} `json:"expire_date"`
|
||||
} `json:"group"`
|
||||
Federation struct {
|
||||
DefaultPermissions int `json:"default_permissions"`
|
||||
Federation struct {
|
||||
Outgoing bool `json:"outgoing"`
|
||||
Incoming bool `json:"incoming"`
|
||||
ExpireDate struct {
|
||||
@ -64,8 +76,9 @@ type Capabilities struct {
|
||||
} `json:"sharebymail"`
|
||||
} `json:"files_sharing"`
|
||||
Notifications struct {
|
||||
OcsEndpoints []string `json:"ocs-endpoints"`
|
||||
Push []string `json:"push"`
|
||||
OcsEndpoints []string `json:"ocs-endpoints"`
|
||||
Push []string `json:"push"`
|
||||
AdminNotifications []string `json:"admin-notifications"`
|
||||
} `json:"notifications"`
|
||||
PasswordPolicy struct {
|
||||
MinLength int `json:"minLength"`
|
||||
@ -92,4 +105,9 @@ type Capabilities struct {
|
||||
Undelete bool `json:"undelete"`
|
||||
Versioning bool `json:"versioning"`
|
||||
} `json:"files"`
|
||||
Registration struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
APIRoot string `json:"apiRoot"`
|
||||
APILevel string `json:"apiLevel"`
|
||||
} `json:"registration"`
|
||||
}
|
||||
|
21
types/notification.go
Normal file
21
types/notification.go
Normal file
@ -0,0 +1,21 @@
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
type Notification struct {
|
||||
NotificationID int `json:"notification_id"`
|
||||
App string `json:"app"`
|
||||
User string `json:"user"`
|
||||
Datetime time.Time `json:"datetime"`
|
||||
ObjectType string `json:"object_type"`
|
||||
ObjectID string `json:"object_id"`
|
||||
Subject string `json:"subject"`
|
||||
Message string `json:"message"`
|
||||
Link string `json:"link"`
|
||||
SubjectRich string `json:"subjectRich"`
|
||||
SubjectRichParameters []interface{} `json:"subjectRichParameters"`
|
||||
MessageRich string `json:"messageRich"`
|
||||
MessageRichParameters []interface{} `json:"messageRichParameters"`
|
||||
Icon string `json:"icon"`
|
||||
Actions []interface{} `json:"actions"`
|
||||
}
|
@ -168,3 +168,17 @@ type GroupFoldersResponse struct {
|
||||
Data GroupFolderBadFormatGroups `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
||||
type NotificationsListResponse struct {
|
||||
Ocs struct {
|
||||
Meta Meta `json:"meta"`
|
||||
Data []Notification `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
||||
type NotificationResponse struct {
|
||||
Ocs struct {
|
||||
Meta Meta `json:"meta"`
|
||||
Data Notification `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user