Class: Conductor::Http::Api::EventResourceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/http/api/event_resource_api.rb

Overview

EventResourceApi - API for event handler operations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ EventResourceApi

Returns a new instance of EventResourceApi.



12
13
14
# File 'lib/conductor/http/api/event_resource_api.rb', line 12

def initialize(api_client = nil)
  @api_client = api_client || ApiClient.new
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



10
11
12
# File 'lib/conductor/http/api/event_resource_api.rb', line 10

def api_client
  @api_client
end

Instance Method Details

#add_event_handler(body) ⇒ void

This method returns an undefined value.

Add an event handler

Parameters:

  • body (EventHandler)

    Event handler definition



19
20
21
22
23
24
25
26
# File 'lib/conductor/http/api/event_resource_api.rb', line 19

def add_event_handler(body)
  @api_client.call_api(
    '/event',
    'POST',
    body: body,
    return_http_data_only: true
  )
end

#delete_queue_config(queue_type, queue_name) ⇒ void

This method returns an undefined value.

Delete queue configuration

Parameters:

  • queue_type (String)

    Queue type

  • queue_name (String)

    Queue name



111
112
113
114
115
116
117
118
# File 'lib/conductor/http/api/event_resource_api.rb', line 111

def delete_queue_config(queue_type, queue_name)
  @api_client.call_api(
    '/event/queue/config/{queueType}/{queueName}',
    'DELETE',
    path_params: { queueType: queue_type, queueName: queue_name },
    return_http_data_only: true
  )
end

#get_event_handlersArray<EventHandler>

Get all event handlers

Returns:

  • (Array<EventHandler>)


42
43
44
45
46
47
48
49
# File 'lib/conductor/http/api/event_resource_api.rb', line 42

def get_event_handlers
  @api_client.call_api(
    '/event',
    'GET',
    return_type: 'Array<EventHandler>',
    return_http_data_only: true
  )
end

#get_event_handlers_for_event(event, active_only: true) ⇒ Array<EventHandler>

Get event handlers for a specific event

Parameters:

  • event (String)

    Event name

  • active_only (Boolean) (defaults to: true)

    Only return active handlers (default: true)

Returns:

  • (Array<EventHandler>)


55
56
57
58
59
60
61
62
63
64
# File 'lib/conductor/http/api/event_resource_api.rb', line 55

def get_event_handlers_for_event(event, active_only: true)
  @api_client.call_api(
    '/event/{event}',
    'GET',
    path_params: { event: event },
    query_params: { activeOnly: active_only },
    return_type: 'Array<EventHandler>',
    return_http_data_only: true
  )
end

#get_queue_config(queue_type, queue_name) ⇒ Hash

Get queue configuration

Parameters:

  • queue_type (String)

    Queue type

  • queue_name (String)

    Queue name

Returns:

  • (Hash)


82
83
84
85
86
87
88
89
90
# File 'lib/conductor/http/api/event_resource_api.rb', line 82

def get_queue_config(queue_type, queue_name)
  @api_client.call_api(
    '/event/queue/config/{queueType}/{queueName}',
    'GET',
    path_params: { queueType: queue_type, queueName: queue_name },
    return_type: 'Hash<String, Object>',
    return_http_data_only: true
  )
end

#get_queue_namesHash<String, String>

Get all queue names

Returns:

  • (Hash<String, String>)


122
123
124
125
126
127
128
129
# File 'lib/conductor/http/api/event_resource_api.rb', line 122

def get_queue_names
  @api_client.call_api(
    '/event/queue/config',
    'GET',
    return_type: 'Hash<String, String>',
    return_http_data_only: true
  )
end

#put_queue_config(queue_type, queue_name, body) ⇒ void

This method returns an undefined value.

Update queue configuration

Parameters:

  • queue_type (String)

    Queue type

  • queue_name (String)

    Queue name

  • body (String)

    Queue configuration (JSON string)



97
98
99
100
101
102
103
104
105
# File 'lib/conductor/http/api/event_resource_api.rb', line 97

def put_queue_config(queue_type, queue_name, body)
  @api_client.call_api(
    '/event/queue/config/{queueType}/{queueName}',
    'PUT',
    path_params: { queueType: queue_type, queueName: queue_name },
    body: body,
    return_http_data_only: true
  )
end

#remove_event_handler(name) ⇒ void

This method returns an undefined value.

Remove an event handler

Parameters:

  • name (String)

    Event handler name



69
70
71
72
73
74
75
76
# File 'lib/conductor/http/api/event_resource_api.rb', line 69

def remove_event_handler(name)
  @api_client.call_api(
    '/event/{name}',
    'DELETE',
    path_params: { name: name },
    return_http_data_only: true
  )
end

#update_event_handler(body) ⇒ void

This method returns an undefined value.

Update an event handler

Parameters:

  • body (EventHandler)

    Event handler definition



31
32
33
34
35
36
37
38
# File 'lib/conductor/http/api/event_resource_api.rb', line 31

def update_event_handler(body)
  @api_client.call_api(
    '/event',
    'PUT',
    body: body,
    return_http_data_only: true
  )
end