Module: Crowdin::ApiResources::OrganizationWebhooks

Defined in:
lib/crowdin-api/api_resources/organization_webhooks.rb

Instance Method Summary collapse

Instance Method Details

#add_organization_webhook(body = {}) ⇒ Object

Parameters:

  • body (Hash) (defaults to: {}) —

    Request Body



22
23
24
25
26
27
28
29
30
# File 'lib/crowdin-api/api_resources/organization_webhooks.rb', line 22

def add_organization_webhook(body = {})
  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/webhooks",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

#delete_organization_webhook(organization_webhook_id) ⇒ Object

Parameters:

  • organization_webhook_id (Integer) —

    Webhook Identifier



35
36
37
38
39
40
41
42
# File 'lib/crowdin-api/api_resources/organization_webhooks.rb', line 35

def delete_organization_webhook(organization_webhook_id)
  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/webhooks/#{organization_webhook_id}"
  )
  Web::SendRequest.new(request).perform
end

#edit_organization_webhook(organization_webhook_id, body = []) ⇒ Object

Parameters:

  • organization_webhook_id (Integer) —

    Webhook Identifier

  • body (Array) (defaults to: []) —

    Request Body



60
61
62
63
64
65
66
67
68
# File 'lib/crowdin-api/api_resources/organization_webhooks.rb', line 60

def edit_organization_webhook(organization_webhook_id, body = [])
  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/webhooks/#{organization_webhook_id}",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

#get_organization_webhook(organization_webhook_id) ⇒ Object

Parameters:

  • organization_webhook_id (Integer) —

    Webhook Identifier



47
48
49
50
51
52
53
54
# File 'lib/crowdin-api/api_resources/organization_webhooks.rb', line 47

def get_organization_webhook(organization_webhook_id)
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/webhooks/#{organization_webhook_id}"
  )
  Web::SendRequest.new(request).perform
end

#list_organization_webhooks(query = {}) ⇒ Object

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Query Parameters



9
10
11
12
13
14
15
16
17
# File 'lib/crowdin-api/api_resources/organization_webhooks.rb', line 9

def list_organization_webhooks(query = {})
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/webhooks",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end