class OpsgenieSdk::IntegrationApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/opsgenie_sdk/api/integration_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

authenticate_integration(body, opts = {}) click to toggle source

Authenticate Integration Authenticates integration with given type @param body Request payload to authenticate integration @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Authenticate Integration Authenticates integration with given type @param body Request payload to authenticate integration @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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 = {}) click to toggle source

Create Integration Creates a new integration @param body Request payload of created integration @param [Hash] opts the optional parameters @return [CreateIntegrationResponse]

# 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 = {}) click to toggle source

Create Integration Creates a new integration @param body Request payload of created integration @param [Hash] opts the optional parameters @return [Array<(CreateIntegrationResponse, Fixnum, Hash)>] CreateIntegrationResponse data, response status code and response headers

# 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 = {}) click to toggle source

Delete Integration Delete integration with given id @param id Integration Id @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Delete Integration Delete integration with given id @param id Integration Id @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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 = {}) click to toggle source

Disable Integration Disable integration with given ID @param id Integration Id @param [Hash] opts the optional parameters @return [DisableIntegrationResponse]

# 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 = {}) click to toggle source

Disable Integration Disable integration with given ID @param id Integration Id @param [Hash] opts the optional parameters @return [Array<(DisableIntegrationResponse, Fixnum, Hash)>] DisableIntegrationResponse data, response status code and response headers

# 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 = {}) click to toggle source

Enable Integration Enable integration with given ID @param id Integration Id @param [Hash] opts the optional parameters @return [EnableIntegrationResponse]

# 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 = {}) click to toggle source

Enable Integration Enable integration with given ID @param id Integration Id @param [Hash] opts the optional parameters @return [Array<(EnableIntegrationResponse, Fixnum, Hash)>] EnableIntegrationResponse data, response status code and response headers

# 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 = {}) click to toggle source

Get Integration Returns integration with given id @param id Integration Id @param [Hash] opts the optional parameters @return [GetIntegrationResponse]

# 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 = {}) click to toggle source

Get Integration Returns integration with given id @param id Integration Id @param [Hash] opts the optional parameters @return [Array<(GetIntegrationResponse, Fixnum, Hash)>] GetIntegrationResponse data, response status code and response headers

# 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 = {}) click to toggle source

List Integrations Returns list of integrations with given parameters @param [Hash] opts the optional parameters @option opts [String] :type Type of the integration (For instance, "API&quot; for API Integration). If type parameter is given, the result will be filtered by type @option opts [String] :team_id The ID of the team. If the team ID parameter is given, the result will be filtered by teamId @option opts [String] :team_name The name of the team. If the team name parameter is given, the result will be filtered by teamName @return [ListIntegrationsResponse]

# 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 = {}) click to toggle source

List Integrations Returns list of integrations with given parameters @param [Hash] opts the optional parameters @option opts [String] :type Type of the integration (For instance, "API&quot; for API Integration). If type parameter is given, the result will be filtered by type @option opts [String] :team_id The ID of the team. If the team ID parameter is given, the result will be filtered by teamId @option opts [String] :team_name The name of the team. If the team name parameter is given, the result will be filtered by teamName @return [Array<(ListIntegrationsResponse, Fixnum, Hash)>] ListIntegrationsResponse data, response status code and response headers

# 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 = {}) click to toggle source

Update Integration Update integration with given id @param id Integration Id @param body Request payload of update integration action @param [Hash] opts the optional parameters @return [UpdateIntegrationResponse]

# 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 = {}) click to toggle source

Update Integration Update integration with given id @param id Integration Id @param body Request payload of update integration action @param [Hash] opts the optional parameters @return [Array<(UpdateIntegrationResponse, Fixnum, Hash)>] UpdateIntegrationResponse data, response status code and response headers

# 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