Sha256: 29bbf99c2b20ec046ba34d5cc99bc79489fbcb49d5e01f3df804b5746eb1a384

Contents?: true

Size: 853 Bytes

Versions: 5

Compression:

Stored size: 853 Bytes

Contents

# frozen_string_literal: true

module MyTankInfo
  class NotificationRulesResource < Resource
    def list_codes
      response = get_request("api/admin/notificationrules/codes")
      Collection.from_response(response, type: NotificationCode)
    end

    def list_contacts(rule_id:)
      response = get_request("api/admin/notificationrules/#{rule_id}/contacts")
      Collection.from_response(response, type: NotificationRuleContact)
    end

    def list(code_id:)
      response = get_request("api/admin/notificationrules?codeId=#{code_id}")
      Collection.from_response(response, type: NotificationRule)
    end

    def update(rule_id:, **attributes)
      put_request("api/admin/notificationrules/#{rule_id}", body: attributes)
    end

    def delete(rule_id:)
      delete_request("api/admin/notificationrules/#{rule_id}")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
my_tank_info-1.1.1 lib/my_tank_info/resources/notification_rules.rb
my_tank_info-1.1.0 lib/my_tank_info/resources/notification_rules.rb
my_tank_info-1.0.2 lib/my_tank_info/resources/notification_rules.rb
my_tank_info-1.0.1 lib/my_tank_info/resources/notification_rules.rb
my_tank_info-1.0.0 lib/my_tank_info/resources/notification_rules.rb