add: gitea api notification

This commit is contained in:
viletyy 2022-05-05 14:45:18 +08:00
parent 2c4dab9d39
commit 7c4d503814
3 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,7 @@ require_relative 'api/repository'
require_relative 'api/settings'
require_relative 'api/user'
require_relative 'api/organization'
require_relative 'api/notification'
require_relative 'api/client'
require_relative 'api/config'
require_relative 'api/exception'

View File

@ -21,6 +21,7 @@ module Gitea
include Gitea::Api::Settings
include Gitea::Api::User
include Gitea::Api::Organization
include Gitea::Api::Notification
end
end # User
end # Gitea

View File

@ -0,0 +1,33 @@
module Gitea
module Api
module Notification
def get_notifications(opt={})
@http.get("/notifications", opt)
end
def put_notifications(opt={})
@http.put("/notifications", opt)
end
def get_notifications_new(opt={})
@http.get("/notifications/new", opt)
end
def get_notifications_threads_by_id(opt={})
@http.get("/notifications/threads/#{id}", opt)
end
def patch_notifications_threads_by_id(opt={})
@http.patch("/notifications/threads/#{id}", opt)
end
def get_repos_notifications_by_owner_repo(owner, repo, opt={})
@http.get("/repos/#{owner}/#{repo}/notifications", opt)
end
def put_repos_notifications_by_owner_repo(owner, repo, opt={})
@http.put("/repos/#{owner}/#{repo}/notifications", opt)
end
end # Notification
end # Api
end # Gitea