Class: AlertManagement::HttpIntegrations::UpdateService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseProjectService
- BaseService
- AlertManagement::HttpIntegrations::UpdateService
- Defined in:
- app/services/alert_management/http_integrations/update_service.rb
Instance Attribute Summary
Attributes inherited from BaseProjectService
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(integration, current_user, params) ⇒ UpdateService
constructor
A new instance of UpdateService.
Methods inherited from BaseContainerService
#group_container?, #namespace_container?, #project_container?, #project_group, #root_ancestor
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(integration, current_user, params) ⇒ UpdateService
Returns a new instance of UpdateService.
9 10 11 12 13 |
# File 'app/services/alert_management/http_integrations/update_service.rb', line 9 def initialize(integration, current_user, params) @integration = integration super(integration.project, current_user, params) end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/services/alert_management/http_integrations/update_service.rb', line 15 def execute return unless allowed? integration.transaction do if integration.update(permitted_params.merge(token_params)) @response = success(integration) if type_update? && too_many_integrations?(integration) @response = error_multiple_integrations raise ActiveRecord::Rollback end else @response = error_on_save(integration) end end @response end |