Method: Gitlab::Client::Projects#edit_project_hook

Defined in:
lib/gitlab/client/projects.rb

#edit_project_hook(project, id, url, options = {}) ⇒ Gitlab::ObjectifiedHash

Updates a project hook URL.

Examples:

Gitlab.edit_project_hook(42, 1, 'https://api.example.net/v1/webhooks/ci')

Parameters:

  • project (Integer, String)

    The ID or path of a project.

  • id (Integer)

    The ID of the hook.

  • url (String)

    The hook URL.

  • options (Hash) (defaults to: {})

    A customizable set of options.

  • option (Boolean)

    :push_events Trigger hook on push events (0 = false, 1 = true)

  • option (Boolean)

    :issues_events Trigger hook on issues events (0 = false, 1 = true)

  • option (Boolean)

    :merge_requests_events Trigger hook on merge_requests events (0 = false, 1 = true)

  • option (Boolean)

    :tag_push_events Trigger hook on push_tag events (0 = false, 1 = true)

Returns:


243
244
245
246
# File 'lib/gitlab/client/projects.rb', line 243

def edit_project_hook(project, id, url, options = {})
  body = { url: url }.merge(options)
  put("/projects/#{url_encode project}/hooks/#{id}", body: body)
end