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' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • service (String)

    A service code name.

  • params (Hash)

    A service parameters.

Returns:

  • (Boolean)


19
20
21
# File 'lib/gitlab/client/services.rb', line 19

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)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • service (String)

    A service code name.

Returns:

  • (Boolean)


31
32
33
# File 'lib/gitlab/client/services.rb', line 31

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)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • service (String)

    A service code name.

Returns:



43
44
45
# File 'lib/gitlab/client/services.rb', line 43

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