Class: Forgejo::NotificationApi
- Inherits:
-
Object
- Object
- Forgejo::NotificationApi
- Defined in:
- lib/forgejo/api/notification_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ NotificationApi
constructor
A new instance of NotificationApi.
-
#notify_get_list(opts = {}) ⇒ Array<NotificationThread>
List users’s notification threads.
-
#notify_get_list_with_http_info(opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
List users's notification threads.
-
#notify_get_repo_list(owner, repo, opts = {}) ⇒ Array<NotificationThread>
List users’s notification threads on a specific repo.
-
#notify_get_repo_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
List users's notification threads on a specific repo.
-
#notify_get_thread(id, opts = {}) ⇒ NotificationThread
Get notification thread by ID.
-
#notify_get_thread_with_http_info(id, opts = {}) ⇒ Array<(NotificationThread, Integer, Hash)>
Get notification thread by ID.
-
#notify_new_available(opts = {}) ⇒ NotificationCount
Check if unread notifications exist.
-
#notify_new_available_with_http_info(opts = {}) ⇒ Array<(NotificationCount, Integer, Hash)>
Check if unread notifications exist.
-
#notify_read_list(opts = {}) ⇒ Array<NotificationThread>
Mark notification threads as read, pinned or unread.
-
#notify_read_list_with_http_info(opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
Mark notification threads as read, pinned or unread.
-
#notify_read_repo_list(owner, repo, opts = {}) ⇒ Array<NotificationThread>
Mark notification threads as read, pinned or unread on a specific repo.
-
#notify_read_repo_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
Mark notification threads as read, pinned or unread on a specific repo.
-
#notify_read_thread(id, opts = {}) ⇒ NotificationThread
Mark notification thread as read by ID.
-
#notify_read_thread_with_http_info(id, opts = {}) ⇒ Array<(NotificationThread, Integer, Hash)>
Mark notification thread as read by ID.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ NotificationApi
Returns a new instance of NotificationApi.
19 20 21 |
# File 'lib/forgejo/api/notification_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/forgejo/api/notification_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#notify_get_list(opts = {}) ⇒ Array<NotificationThread>
List users’s notification threads
32 33 34 35 |
# File 'lib/forgejo/api/notification_api.rb', line 32 def notify_get_list(opts = {}) data, _status_code, _headers = notify_get_list_with_http_info(opts) data end |
#notify_get_list_with_http_info(opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
List users's notification threads
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/forgejo/api/notification_api.rb', line 47 def notify_get_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_get_list ...' end allowable_values = ["issue", "pull", "commit", "repository"] if @api_client.config.client_side_validation && opts[:'subject_type'] && !opts[:'subject_type'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"subject_type\", must include one of #{allowable_values}" end # resource path local_var_path = '/notifications' # query parameters query_params = opts[:query_params] || {} query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil? query_params[:'status-types'] = @api_client.build_collection_param(opts[:'status_types'], :multi) if !opts[:'status_types'].nil? query_params[:'subject-type'] = @api_client.build_collection_param(opts[:'subject_type'], :multi) if !opts[:'subject_type'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<NotificationThread>' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_get_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#notify_get_repo_list(owner, repo, opts = {}) ⇒ Array<NotificationThread>
List users’s notification threads on a specific repo
114 115 116 117 |
# File 'lib/forgejo/api/notification_api.rb', line 114 def notify_get_repo_list(owner, repo, opts = {}) data, _status_code, _headers = notify_get_repo_list_with_http_info(owner, repo, opts) data end |
#notify_get_repo_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
List users's notification threads on a specific repo
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/forgejo/api/notification_api.rb', line 131 def notify_get_repo_list_with_http_info(owner, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_get_repo_list ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling NotificationApi.notify_get_repo_list" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling NotificationApi.notify_get_repo_list" end allowable_values = ["issue", "pull", "commit", "repository"] if @api_client.config.client_side_validation && opts[:'subject_type'] && !opts[:'subject_type'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"subject_type\", must include one of #{allowable_values}" end # resource path local_var_path = '/repos/{owner}/{repo}/notifications'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil? query_params[:'status-types'] = @api_client.build_collection_param(opts[:'status_types'], :multi) if !opts[:'status_types'].nil? query_params[:'subject-type'] = @api_client.build_collection_param(opts[:'subject_type'], :multi) if !opts[:'subject_type'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<NotificationThread>' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_get_repo_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_get_repo_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#notify_get_thread(id, opts = {}) ⇒ NotificationThread
Get notification thread by ID
198 199 200 201 |
# File 'lib/forgejo/api/notification_api.rb', line 198 def notify_get_thread(id, opts = {}) data, _status_code, _headers = notify_get_thread_with_http_info(id, opts) data end |
#notify_get_thread_with_http_info(id, opts = {}) ⇒ Array<(NotificationThread, Integer, Hash)>
Get notification thread by ID
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/forgejo/api/notification_api.rb', line 207 def notify_get_thread_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_get_thread ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling NotificationApi.notify_get_thread" end # resource path local_var_path = '/notifications/threads/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'NotificationThread' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_get_thread", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_get_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#notify_new_available(opts = {}) ⇒ NotificationCount
Check if unread notifications exist
258 259 260 261 |
# File 'lib/forgejo/api/notification_api.rb', line 258 def notify_new_available(opts = {}) data, _status_code, _headers = notify_new_available_with_http_info(opts) data end |
#notify_new_available_with_http_info(opts = {}) ⇒ Array<(NotificationCount, Integer, Hash)>
Check if unread notifications exist
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/forgejo/api/notification_api.rb', line 266 def notify_new_available_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_new_available ...' end # resource path local_var_path = '/notifications/new' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'NotificationCount' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_new_available", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_new_available\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#notify_read_list(opts = {}) ⇒ Array<NotificationThread>
Mark notification threads as read, pinned or unread
317 318 319 320 |
# File 'lib/forgejo/api/notification_api.rb', line 317 def notify_read_list(opts = {}) data, _status_code, _headers = notify_read_list_with_http_info(opts) data end |
#notify_read_list_with_http_info(opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
Mark notification threads as read, pinned or unread
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/forgejo/api/notification_api.rb', line 329 def notify_read_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_read_list ...' end # resource path local_var_path = '/notifications' # query parameters query_params = opts[:query_params] || {} query_params[:'last_read_at'] = opts[:'last_read_at'] if !opts[:'last_read_at'].nil? query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil? query_params[:'status-types'] = @api_client.build_collection_param(opts[:'status_types'], :multi) if !opts[:'status_types'].nil? query_params[:'to-status'] = opts[:'to_status'] if !opts[:'to_status'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<NotificationThread>' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_read_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_read_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#notify_read_repo_list(owner, repo, opts = {}) ⇒ Array<NotificationThread>
Mark notification threads as read, pinned or unread on a specific repo
386 387 388 389 |
# File 'lib/forgejo/api/notification_api.rb', line 386 def notify_read_repo_list(owner, repo, opts = {}) data, _status_code, _headers = notify_read_repo_list_with_http_info(owner, repo, opts) data end |
#notify_read_repo_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(Array<NotificationThread>, Integer, Hash)>
Mark notification threads as read, pinned or unread on a specific repo
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/forgejo/api/notification_api.rb', line 400 def notify_read_repo_list_with_http_info(owner, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_read_repo_list ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling NotificationApi.notify_read_repo_list" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling NotificationApi.notify_read_repo_list" end # resource path local_var_path = '/repos/{owner}/{repo}/notifications'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil? query_params[:'status-types'] = @api_client.build_collection_param(opts[:'status_types'], :multi) if !opts[:'status_types'].nil? query_params[:'to-status'] = opts[:'to_status'] if !opts[:'to_status'].nil? query_params[:'last_read_at'] = opts[:'last_read_at'] if !opts[:'last_read_at'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<NotificationThread>' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_read_repo_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_read_repo_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#notify_read_thread(id, opts = {}) ⇒ NotificationThread
Mark notification thread as read by ID
461 462 463 464 |
# File 'lib/forgejo/api/notification_api.rb', line 461 def notify_read_thread(id, opts = {}) data, _status_code, _headers = notify_read_thread_with_http_info(id, opts) data end |
#notify_read_thread_with_http_info(id, opts = {}) ⇒ Array<(NotificationThread, Integer, Hash)>
Mark notification thread as read by ID
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'lib/forgejo/api/notification_api.rb', line 471 def notify_read_thread_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotificationApi.notify_read_thread ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling NotificationApi.notify_read_thread" end # resource path local_var_path = '/notifications/threads/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'to-status'] = opts[:'to_status'] if !opts[:'to_status'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'NotificationThread' # auth_names auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken'] = opts.merge( :operation => :"NotificationApi.notify_read_thread", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotificationApi#notify_read_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |