diff --git a/lib/gitea/api.rb b/lib/gitea/api.rb index 8beb269..c2f8681 100644 --- a/lib/gitea/api.rb +++ b/lib/gitea/api.rb @@ -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' diff --git a/lib/gitea/api/client.rb b/lib/gitea/api/client.rb index 5611d60..40116f0 100644 --- a/lib/gitea/api/client.rb +++ b/lib/gitea/api/client.rb @@ -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 \ No newline at end of file diff --git a/lib/gitea/api/notification.rb b/lib/gitea/api/notification.rb new file mode 100644 index 0000000..e04dfd3 --- /dev/null +++ b/lib/gitea/api/notification.rb @@ -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 \ No newline at end of file