class OpsgenieSdk::NotificationRuleStepApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Create Notification Rule Step Creates a new notification rule step @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 to create notification rule step @param [Hash] opts the optional parameters @return [SuccessResponse]

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

Create Notification Rule Step Creates a new notification rule step @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 to create notification rule step @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_step_api.rb, line 41
def create_notification_rule_step_with_http_info(identifier, rule_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.create_notification_rule_step ...'
  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 NotificationRuleStepApi.create_notification_rule_step"
  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 NotificationRuleStepApi.create_notification_rule_step"
  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 NotificationRuleStepApi.create_notification_rule_step"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps'.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: NotificationRuleStepApi#create_notification_rule_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_notification_rule_step(identifier, rule_id, id, opts = {}) click to toggle source

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

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 93
def delete_notification_rule_step(identifier, rule_id, id, opts = {})
  data, _status_code, _headers = delete_notification_rule_step_with_http_info(identifier, rule_id, id, opts)
  data
end
delete_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {}) click to toggle source

Delete Notification Rule Step Deletes a notification rule step using user identifier, rule id, notification rule step id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param id Id of the rule step will be changed. @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_step_api.rb, line 105
def delete_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.delete_notification_rule_step ...'
  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 NotificationRuleStepApi.delete_notification_rule_step"
  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 NotificationRuleStepApi.delete_notification_rule_step"
  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 NotificationRuleStepApi.delete_notification_rule_step"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps/{id}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_id.to_s).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: NotificationRuleStepApi#delete_notification_rule_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
disable_notification_rule_step(identifier, rule_id, id, opts = {}) click to toggle source

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

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 157
def disable_notification_rule_step(identifier, rule_id, id, opts = {})
  data, _status_code, _headers = disable_notification_rule_step_with_http_info(identifier, rule_id, id, opts)
  data
end
disable_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {}) click to toggle source

Disable Notification Rule Step Disables a new notification rule step @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param id Id of the rule step will be changed. @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_step_api.rb, line 169
def disable_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.disable_notification_rule_step ...'
  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 NotificationRuleStepApi.disable_notification_rule_step"
  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 NotificationRuleStepApi.disable_notification_rule_step"
  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 NotificationRuleStepApi.disable_notification_rule_step"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps/{id}/disable'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_id.to_s).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 => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleStepApi#disable_notification_rule_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
enable_notification_rule_step(identifier, rule_id, id, opts = {}) click to toggle source

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

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 221
def enable_notification_rule_step(identifier, rule_id, id, opts = {})
  data, _status_code, _headers = enable_notification_rule_step_with_http_info(identifier, rule_id, id, opts)
  data
end
enable_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {}) click to toggle source

Enable Notification Rule Step Enables a new notification rule step @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param id Id of the rule step will be changed. @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_step_api.rb, line 233
def enable_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.enable_notification_rule_step ...'
  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 NotificationRuleStepApi.enable_notification_rule_step"
  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 NotificationRuleStepApi.enable_notification_rule_step"
  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 NotificationRuleStepApi.enable_notification_rule_step"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps/{id}/enable'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_id.to_s).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 => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleStepApi#enable_notification_rule_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_notification_rule_step(identifier, rule_id, id, opts = {}) click to toggle source

Get Notification Rule Step Returns notification rule step with given user identifier and 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 id Id of the rule step will be changed. @param [Hash] opts the optional parameters @return [GetNotificationRuleStepResponse]

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 285
def get_notification_rule_step(identifier, rule_id, id, opts = {})
  data, _status_code, _headers = get_notification_rule_step_with_http_info(identifier, rule_id, id, opts)
  data
end
get_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {}) click to toggle source

Get Notification Rule Step Returns notification rule step with given user identifier and 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 id Id of the rule step will be changed. @param [Hash] opts the optional parameters @return [Array<(GetNotificationRuleStepResponse, Fixnum, Hash)>] GetNotificationRuleStepResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 297
def get_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.get_notification_rule_step ...'
  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 NotificationRuleStepApi.get_notification_rule_step"
  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 NotificationRuleStepApi.get_notification_rule_step"
  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 NotificationRuleStepApi.get_notification_rule_step"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps/{id}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_id.to_s).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 => 'GetNotificationRuleStepResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleStepApi#get_notification_rule_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_notification_rule_steps(identifier, rule_id, opts = {}) click to toggle source

List Notification Rule Steps Returns list of notification rule steps @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 [ListNotificationRuleStepsResponse]

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 348
def list_notification_rule_steps(identifier, rule_id, opts = {})
  data, _status_code, _headers = list_notification_rule_steps_with_http_info(identifier, rule_id, opts)
  data
end
list_notification_rule_steps_with_http_info(identifier, rule_id, opts = {}) click to toggle source

List Notification Rule Steps Returns list of notification rule steps @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<(ListNotificationRuleStepsResponse, Fixnum, Hash)>] ListNotificationRuleStepsResponse data, response status code and response headers

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 359
def list_notification_rule_steps_with_http_info(identifier, rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.list_notification_rule_steps ...'
  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 NotificationRuleStepApi.list_notification_rule_steps"
  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 NotificationRuleStepApi.list_notification_rule_steps"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps'.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 => 'ListNotificationRuleStepsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleStepApi#list_notification_rule_steps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_notification_rule_step(identifier, rule_id, id, opts = {}) click to toggle source

Update Notification Rule Step (Partial) Update a notification rule step with given user identifier, rule id, and notification rule step id @param identifier Identifier of the user to be searched @param rule_id Id of the notification rule that step will belong to. @param id Id of the rule step will be changed. @param [Hash] opts the optional parameters @option opts [UpdateNotificationRuleStepPayload] :body Request payload of update schedule action @return [SuccessResponse]

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 408
def update_notification_rule_step(identifier, rule_id, id, opts = {})
  data, _status_code, _headers = update_notification_rule_step_with_http_info(identifier, rule_id, id, opts)
  data
end
update_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {}) click to toggle source

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

# File lib/opsgenie_sdk/api/notification_rule_step_api.rb, line 421
def update_notification_rule_step_with_http_info(identifier, rule_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotificationRuleStepApi.update_notification_rule_step ...'
  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 NotificationRuleStepApi.update_notification_rule_step"
  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 NotificationRuleStepApi.update_notification_rule_step"
  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 NotificationRuleStepApi.update_notification_rule_step"
  end
  # resource path
  local_var_path = '/v2/users/{identifier}/notification-rules/{ruleId}/steps/{id}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'ruleId' + '}', rule_id.to_s).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(opts[:'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 => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationRuleStepApi#update_notification_rule_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end