Class: OpsgenieSdk::IntegrationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/opsgenie_sdk/api/integration_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ IntegrationApi

Returns a new instance of IntegrationApi.



19
20
21
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#authenticate_integration(body, opts = {}) ⇒ SuccessResponse

Authenticate Integration Authenticates integration with given type

Parameters:

  • body

    Request payload to authenticate integration

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 27

def authenticate_integration(body, opts = {})
  data, _status_code, _headers = authenticate_integration_with_http_info(body, opts)
  data
end

#authenticate_integration_with_http_info(body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Authenticate Integration Authenticates integration with given type

Parameters:

  • body

    Request payload to authenticate integration

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

    the optional parameters

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 37

def authenticate_integration_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.authenticate_integration ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.authenticate_integration"
  end
  # resource path
  local_var_path = '/v2/integrations/authenticate'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#authenticate_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_integration(body, opts = {}) ⇒ CreateIntegrationResponse

Create Integration Creates a new integration

Parameters:

  • body

    Request payload of created integration

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

    the optional parameters

Returns:



79
80
81
82
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 79

def create_integration(body, opts = {})
  data, _status_code, _headers = create_integration_with_http_info(body, opts)
  data
end

#create_integration_with_http_info(body, opts = {}) ⇒ Array<(CreateIntegrationResponse, Fixnum, Hash)>

Create Integration Creates a new integration

Parameters:

  • body

    Request payload of created integration

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

    the optional parameters

Returns:

  • (Array<(CreateIntegrationResponse, Fixnum, Hash)>)

    CreateIntegrationResponse data, response status code and response headers



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 89

def create_integration_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_integration ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.create_integration"
  end
  # resource path
  local_var_path = '/v2/integrations'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateIntegrationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_integration(id, opts = {}) ⇒ SuccessResponse

Delete Integration Delete integration with given id

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:



131
132
133
134
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 131

def delete_integration(id, opts = {})
  data, _status_code, _headers = delete_integration_with_http_info(id, opts)
  data
end

#delete_integration_with_http_info(id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Delete Integration Delete integration with given id

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 141

def delete_integration_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_integration ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationApi.delete_integration"
  end
  # resource path
  local_var_path = '/v2/integrations/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_integration(id, opts = {}) ⇒ DisableIntegrationResponse

Disable Integration Disable integration with given ID

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:



183
184
185
186
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 183

def disable_integration(id, opts = {})
  data, _status_code, _headers = disable_integration_with_http_info(id, opts)
  data
end

#disable_integration_with_http_info(id, opts = {}) ⇒ Array<(DisableIntegrationResponse, Fixnum, Hash)>

Disable Integration Disable integration with given ID

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:

  • (Array<(DisableIntegrationResponse, Fixnum, Hash)>)

    DisableIntegrationResponse data, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 193

def disable_integration_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.disable_integration ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationApi.disable_integration"
  end
  # resource path
  local_var_path = '/v2/integrations/{id}/disable'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DisableIntegrationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#disable_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_integration(id, opts = {}) ⇒ EnableIntegrationResponse

Enable Integration Enable integration with given ID

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:



235
236
237
238
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 235

def enable_integration(id, opts = {})
  data, _status_code, _headers = enable_integration_with_http_info(id, opts)
  data
end

#enable_integration_with_http_info(id, opts = {}) ⇒ Array<(EnableIntegrationResponse, Fixnum, Hash)>

Enable Integration Enable integration with given ID

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:

  • (Array<(EnableIntegrationResponse, Fixnum, Hash)>)

    EnableIntegrationResponse data, response status code and response headers



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 245

def enable_integration_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.enable_integration ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationApi.enable_integration"
  end
  # resource path
  local_var_path = '/v2/integrations/{id}/enable'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EnableIntegrationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#enable_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_integration(id, opts = {}) ⇒ GetIntegrationResponse

Get Integration Returns integration with given id

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:



287
288
289
290
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 287

def get_integration(id, opts = {})
  data, _status_code, _headers = get_integration_with_http_info(id, opts)
  data
end

#get_integration_with_http_info(id, opts = {}) ⇒ Array<(GetIntegrationResponse, Fixnum, Hash)>

Get Integration Returns integration with given id

Parameters:

  • id

    Integration Id

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

    the optional parameters

Returns:

  • (Array<(GetIntegrationResponse, Fixnum, Hash)>)

    GetIntegrationResponse data, response status code and response headers



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 297

def get_integration_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_integration ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationApi.get_integration"
  end
  # resource path
  local_var_path = '/v2/integrations/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetIntegrationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_integrations(opts = {}) ⇒ ListIntegrationsResponse

List Integrations Returns list of integrations with given parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    Type of the integration (For instance, &quot;API&quot; for API Integration). If type parameter is given, the result will be filtered by type

  • :team_id (String)

    The ID of the team. If the team ID parameter is given, the result will be filtered by teamId

  • :team_name (String)

    The name of the team. If the team name parameter is given, the result will be filtered by teamName

Returns:



341
342
343
344
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 341

def list_integrations(opts = {})
  data, _status_code, _headers = list_integrations_with_http_info(opts)
  data
end

#list_integrations_with_http_info(opts = {}) ⇒ Array<(ListIntegrationsResponse, Fixnum, Hash)>

List Integrations Returns list of integrations with given parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    Type of the integration (For instance, &quot;API&quot; for API Integration). If type parameter is given, the result will be filtered by type

  • :team_id (String)

    The ID of the team. If the team ID parameter is given, the result will be filtered by teamId

  • :team_name (String)

    The name of the team. If the team name parameter is given, the result will be filtered by teamName

Returns:

  • (Array<(ListIntegrationsResponse, Fixnum, Hash)>)

    ListIntegrationsResponse data, response status code and response headers



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 353

def list_integrations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.list_integrations ...'
  end
  # resource path
  local_var_path = '/v2/integrations'

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'teamId'] = opts[:'team_id'] if !opts[:'team_id'].nil?
  query_params[:'teamName'] = opts[:'team_name'] if !opts[:'team_name'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListIntegrationsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#list_integrations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_integration(id, body, opts = {}) ⇒ UpdateIntegrationResponse

Update Integration Update integration with given id

Parameters:

  • id

    Integration Id

  • body

    Request payload of update integration action

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

    the optional parameters

Returns:



395
396
397
398
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 395

def update_integration(id, body, opts = {})
  data, _status_code, _headers = update_integration_with_http_info(id, body, opts)
  data
end

#update_integration_with_http_info(id, body, opts = {}) ⇒ Array<(UpdateIntegrationResponse, Fixnum, Hash)>

Update Integration Update integration with given id

Parameters:

  • id

    Integration Id

  • body

    Request payload of update integration action

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

    the optional parameters

Returns:

  • (Array<(UpdateIntegrationResponse, Fixnum, Hash)>)

    UpdateIntegrationResponse data, response status code and response headers



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/opsgenie_sdk/api/integration_api.rb', line 406

def update_integration_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_integration ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationApi.update_integration"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_integration"
  end
  # resource path
  local_var_path = '/v2/integrations/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdateIntegrationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end