class Assembla::Client::Spaces::Webhooks

Constants

BASIC_AUTH
VALID_PARAMS_NAMES
VALID_REQUEST_PARAM_VALUES

Public Instance Methods

create(*args) click to toggle source

@example api.spaces.webhooks.create ‘project1’, webhook: { title: ‘Mobile App V2’, external_url: ‘example.com/notify’ }

# File lib/assembla_api/client/spaces/webhooks.rb, line 33
def create(*args)
  arguments(args, required: [:space]) do
    permit VALID_PARAMS_NAMES, recursive: true
    assert_required %w[ external_url ]
    assert_values VALID_REQUEST_PARAM_VALUES
  end

  arguments.params['webhook']['authentication_type'] ||= BASIC_AUTH
  post_request("/spaces/#{arguments.space}/webhooks", arguments.params)
end
delete(*args) click to toggle source

Delete webhook by ID @example api.spaces.webhooks.delete ‘project1’, 699

# File lib/assembla_api/client/spaces/webhooks.rb, line 58
def delete(*args)
  arguments(args, required: [:space, :id])
  delete_request("/spaces/#{arguments.space}/webhooks/#{arguments.id}", arguments.params)
end
edit(*args) click to toggle source

@example api.spaces.webhooks.edit ‘project1’, 699, webhook: { enabled: false }

# File lib/assembla_api/client/spaces/webhooks.rb, line 46
def edit(*args)
  arguments(args, required: [:space, :id]) do
    permit VALID_PARAMS_NAMES , recursive: true
    assert_values VALID_REQUEST_PARAM_VALUES
  end

  put_request("/spaces/#{arguments.space}/webhooks/#{arguments.id}", arguments.params)
end