Class: AlertsService

Inherits:
Service show all
Defined in:
app/models/project_services/alerts_service.rb

Constant Summary

Constants inherited from Service

Service::DEV_SERVICE_NAMES, Service::SERVICE_NAMES

Instance Attribute Summary

Attributes included from Importable

#imported, #importing

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Service

#activated?, #api_field_names, #async_execute, available_services_names, available_services_types, boolean_accessor, build_from_integration, #category, #configurable_event_actions, #configurable_events, default_integration, dev_services_names, #event_channel_names, event_description, #event_field, #event_names, event_names, #execute, #fields, find_or_create_templates, find_or_initialize_all, find_or_initialize_integration, #global_fields, #help, #initialize_properties, instance_exists_for?, #issue_tracker?, #operating?, prop_accessor, #reset_updated_properties, services_names, services_types, supported_event_actions, #supported_events, #supports_data_fields?, #test, #to_data_fields_hash, #to_param, #to_service_hash, #updated_properties

Methods included from ProjectServicesLoggable

#build_message, #log_error, #log_info, #logger

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.supported_eventsObject


55
56
57
# File 'app/models/project_services/alerts_service.rb', line 55

def self.supported_events
  %w()
end

.to_paramObject


51
52
53
# File 'app/models/project_services/alerts_service.rb', line 51

def self.to_param
  'alerts'
end

Instance Method Details

#can_test?Boolean

Returns:

  • (Boolean)

35
36
37
# File 'app/models/project_services/alerts_service.rb', line 35

def can_test?
  false
end

#dataObject


59
60
61
# File 'app/models/project_services/alerts_service.rb', line 59

def data
  super || build_data
end

#descriptionObject


43
44
45
# File 'app/models/project_services/alerts_service.rb', line 43

def description
  _('Authorize external services to send alerts to GitLab')
end

#detailed_descriptionObject


47
48
49
# File 'app/models/project_services/alerts_service.rb', line 47

def detailed_description
  description
end

#editable?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'app/models/project_services/alerts_service.rb', line 27

def editable?
  false
end

#json_fieldsObject


23
24
25
# File 'app/models/project_services/alerts_service.rb', line 23

def json_fields
  super + %w(token)
end

#show_active_box?Boolean

Returns:

  • (Boolean)

31
32
33
# File 'app/models/project_services/alerts_service.rb', line 31

def show_active_box?
  false
end

#titleObject


39
40
41
# File 'app/models/project_services/alerts_service.rb', line 39

def title
  _('Alerts endpoint')
end

#urlObject


17
18
19
20
21
# File 'app/models/project_services/alerts_service.rb', line 17

def url
  return if instance? || template?

  url_helpers.project_alerts_notify_url(project, format: :json)
end