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::PROJECT_SPECIFIC_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, create_from_active_default_integrations, default_integration, #default_test_event, default_test_event, dev_services_names, #event_channel_names, event_description, #event_field, event_names, #event_names, #execute, #external_issue_tracker?, #external_wiki?, #fields, find_or_create_templates, find_or_initialize_all_non_project_specific, find_or_initialize_non_project_specific_integration, #global_fields, #help, inherited_descendants_from_self_or_ancestors_from, #initialize_properties, instance_exists_for?, #operating?, project_specific_services_names, prop_accessor, #reset_updated_properties, services_names, 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, where_exists, with_fast_statement_timeout, without_order

Class Method Details

.supported_eventsObject


57
58
59
# File 'app/models/project_services/alerts_service.rb', line 57

def self.supported_events
  %w()
end

.to_paramObject


53
54
55
# File 'app/models/project_services/alerts_service.rb', line 53

def self.to_param
  'alerts'
end

Instance Method Details

#can_test?Boolean

Returns:

  • (Boolean)

37
38
39
# File 'app/models/project_services/alerts_service.rb', line 37

def can_test?
  false
end

#dataObject


61
62
63
# File 'app/models/project_services/alerts_service.rb', line 61

def data
  super || build_data
end

#descriptionObject


45
46
47
# File 'app/models/project_services/alerts_service.rb', line 45

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

#detailed_descriptionObject


49
50
51
# File 'app/models/project_services/alerts_service.rb', line 49

def detailed_description
  description
end

#editable?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'app/models/project_services/alerts_service.rb', line 29

def editable?
  false
end

#json_fieldsObject


25
26
27
# File 'app/models/project_services/alerts_service.rb', line 25

def json_fields
  super + %w(token)
end

#show_active_box?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'app/models/project_services/alerts_service.rb', line 33

def show_active_box?
  false
end

#titleObject


41
42
43
# File 'app/models/project_services/alerts_service.rb', line 41

def title
  _('Alerts endpoint')
end

#urlObject


19
20
21
22
23
# File 'app/models/project_services/alerts_service.rb', line 19

def url
  return if instance? || template?

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