Module: Gitlab::Client::Services

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/services.rb

Overview

Third party services connected to a project.

Instance Method Summary collapse

Instance Method Details

#change_service(project, service, params) ⇒ Boolean

Create/Edit service Full service params documentation: github.com/gitlabhq/gitlabhq/blob/master/doc/api/services.md

Examples:

Gitlab.change_service(42, :redmine, { new_issue_url: 'https://example.com/projects/test_project/issues/new',
                                      project_url: 'https://example.com/projects/test_project/issues',
                                      issues_url: 'https://example.com/issues/:id' })


17
18
19
# File 'lib/gitlab/client/services.rb', line 17

def change_service(project, service, params)
  put("/projects/#{url_encode project}/services/#{correct_service_name(service)}", body: params)
end

#delete_service(project, service) ⇒ Boolean

Delete service

Examples:

Gitlab.delete_service(42, :redmine)


29
30
31
# File 'lib/gitlab/client/services.rb', line 29

def delete_service(project, service)
  delete("/projects/#{url_encode project}/services/#{correct_service_name(service)}")
end

#service(project, service) ⇒ Gitlab::ObjectifiedHash

Get service

Examples:

Gitlab.service(42, :redmine)


41
42
43
# File 'lib/gitlab/client/services.rb', line 41

def service(project, service)
  get("/projects/#{url_encode project}/services/#{correct_service_name(service)}")
end