class OpsgenieSdk::NotificationRuleApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

change_notification_rule_order(identifier, rule_id, body, opts = {}) click to toggle source

Change order of Notification Rule Changes order of a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param body Request payload of change order of notification rule @param [Hash] opts the optional parameters @return [SuccessResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 29
def change_notification_rule_order(identifier, rule_id, body, opts = {})
  data, _status_code, _headers = change_notification_rule_order_with_http_info(identifier, rule_id, body, opts)
  data
end
change_notification_rule_order_with_http_info(identifier, rule_id, body, opts = {}) click to toggle source

Change order of Notification Rule Changes order of a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param body Request payload of change order of notification rule @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 41
def change_notification_rule_order_with_http_info(identifier, rule_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.change_notification_rule_order ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.change_notification_rule_order"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling NotificationRuleApi.change_notification_rule_order"
  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 NotificationRuleApi.change_notification_rule_order"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/change-order'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_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(: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: NotificationRuleApi#change_notification_rule_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_notification_rule(identifier, body, opts = {}) click to toggle source

Create Notification Rule Creates a new notification rule @param identifier Identifier of the user to be searched @param body Request payload of create notification rule @param [Hash] opts the optional parameters @return [CreateNotificationRuleResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 92
def create_notification_rule(identifier, body, opts = {})
  data, _status_code, _headers = create_notification_rule_with_http_info(identifier, body, opts)
  data
end
create_notification_rule_with_http_info(identifier, body, opts = {}) click to toggle source

Create Notification Rule Creates a new notification rule @param identifier Identifier of the user to be searched @param body Request payload of create notification rule @param [Hash] opts the optional parameters @return [Array<(CreateNotificationRuleResponse, Fixnum, Hash)>] CreateNotificationRuleResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 103
def create_notification_rule_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.create_notification_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.create_notification_rule"
  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 NotificationRuleApi.create_notification_rule"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules'.sub('{' + 'identifier' + '}', identifier.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(: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 => 'CreateNotificationRuleResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleApi#create_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_notification_rule(identifier, rule_id, opts = {}) click to toggle source

Delete Notification Rule Deletes a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [SuccessResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 150
def delete_notification_rule(identifier, rule_id, opts = {})
  data, _status_code, _headers = delete_notification_rule_with_http_info(identifier, rule_id, opts)
  data
end
delete_notification_rule_with_http_info(identifier, rule_id, opts = {}) click to toggle source

Delete Notification Rule Deletes a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 161
def delete_notification_rule_with_http_info(identifier, rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.delete_notification_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.delete_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling NotificationRuleApi.delete_notification_rule"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_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: NotificationRuleApi#delete_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
disable_notification_rule(identifier, rule_id, opts = {}) click to toggle source

Disable Notification Rule Disables a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [SuccessResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 208
def disable_notification_rule(identifier, rule_id, opts = {})
  data, _status_code, _headers = disable_notification_rule_with_http_info(identifier, rule_id, opts)
  data
end
disable_notification_rule_with_http_info(identifier, rule_id, opts = {}) click to toggle source

Disable Notification Rule Disables a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 219
def disable_notification_rule_with_http_info(identifier, rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.disable_notification_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.disable_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling NotificationRuleApi.disable_notification_rule"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/disable'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_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 => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleApi#disable_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
enable_notification_rule(identifier, rule_id, opts = {}) click to toggle source

Enable Notification Rule Enables a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [SuccessResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 266
def enable_notification_rule(identifier, rule_id, opts = {})
  data, _status_code, _headers = enable_notification_rule_with_http_info(identifier, rule_id, opts)
  data
end
enable_notification_rule_with_http_info(identifier, rule_id, opts = {}) click to toggle source

Enable Notification Rule Enables a notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 277
def enable_notification_rule_with_http_info(identifier, rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.enable_notification_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.enable_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling NotificationRuleApi.enable_notification_rule"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/enable'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_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 => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleApi#enable_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_notification_rule(identifier, rule_id, opts = {}) click to toggle source

Get Notification Rule Returns notification rule with given id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [GetNotificationRuleResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 324
def get_notification_rule(identifier, rule_id, opts = {})
  data, _status_code, _headers = get_notification_rule_with_http_info(identifier, rule_id, opts)
  data
end
get_notification_rule_with_http_info(identifier, rule_id, opts = {}) click to toggle source

Get Notification Rule Returns notification rule with given id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param [Hash] opts the optional parameters @return [Array<(GetNotificationRuleResponse, Fixnum, Hash)>] GetNotificationRuleResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 335
def get_notification_rule_with_http_info(identifier, rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.get_notification_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.get_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling NotificationRuleApi.get_notification_rule"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_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 => 'GetNotificationRuleResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleApi#get_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_notification_rules(identifier, opts = {}) click to toggle source

List Notification Rules Returns list of notification rules @param identifier Identifier of the user to be searched @param [Hash] opts the optional parameters @return [ListNotificationRulesResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 381
def list_notification_rules(identifier, opts = {})
  data, _status_code, _headers = list_notification_rules_with_http_info(identifier, opts)
  data
end
list_notification_rules_with_http_info(identifier, opts = {}) click to toggle source

List Notification Rules Returns list of notification rules @param identifier Identifier of the user to be searched @param [Hash] opts the optional parameters @return [Array<(ListNotificationRulesResponse, Fixnum, Hash)>] ListNotificationRulesResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 391
def list_notification_rules_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.list_notification_rules ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.list_notification_rules"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules'.sub('{' + 'identifier' + '}', identifier.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 => 'ListNotificationRulesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleApi#list_notification_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_notification_rule(identifier, rule_id, body, opts = {}) click to toggle source

Update Notification Rule (Partial) Updates the notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param body Request payload of update notification rule @param [Hash] opts the optional parameters @return [UpdateNotificationRuleResponse]

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 435
def update_notification_rule(identifier, rule_id, body, opts = {})
  data, _status_code, _headers = update_notification_rule_with_http_info(identifier, rule_id, body, opts)
  data
end
update_notification_rule_with_http_info(identifier, rule_id, body, opts = {}) click to toggle source

Update Notification Rule (Partial) Updates the notification rule with given notification rule id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param body Request payload of update notification rule @param [Hash] opts the optional parameters @return [Array<(UpdateNotificationRuleResponse, Fixnum, Hash)>] UpdateNotificationRuleResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_api.rb, line 447
def update_notification_rule_with_http_info(identifier, rule_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleApi.update_notification_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling NotificationRuleApi.update_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling NotificationRuleApi.update_notification_rule"
  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 NotificationRuleApi.update_notification_rule"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_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(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdateNotificationRuleResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleApi#update_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end