Sha256: b5535a9ecb74ef87fddf23083d8329d166e2e956c02b50f17bb7f392ca75562f

Contents?: true

Size: 1.04 KB

Versions: 10

Compression:

Stored size: 1.04 KB

Contents

module Paddle
  class NotificationSetting < Object

    class << self

      def list(**params)
        response = Client.get_request("notification-settings", params: params)
        Collection.from_response(response, type: NotificationSetting)
      end

      def create(description:, destination:, type:, subscribed_events:, **params)
        attrs = {description: description, destination: destination, type: type, subscribed_events: subscribed_events}
        response = Client.post_request("notification-settings", body: attrs.merge(params))
        NotificationSetting.new(response.body["data"])
      end

      def retrieve(id:)
        response = Client.get_request("notification-settings/#{id}")
        NotificationSetting.new(response.body["data"])
      end

      def update(id:, **params)
        response = Client.patch_request("notification-settings/#{id}", body: params)
        NotificationSetting.new(response.body["data"])
      end

      def delete(id:)
        Client.delete_request("notification-settings/#{id}")
      end

    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
paddle-2.2.0 lib/paddle/models/notification_setting.rb
paddle-2.1.4 lib/paddle/models/notification_setting.rb
paddle-2.1.3 lib/paddle/models/notification_setting.rb
paddle-2.1.2 lib/paddle/models/notification_setting.rb
paddle-2.1.1 lib/paddle/models/notification_setting.rb
paddle-2.1.0 lib/paddle/models/notification_setting.rb
paddle-2.0.0 lib/paddle/models/notification_setting.rb
paddle-1.1.2 lib/paddle/models/notification_setting.rb
paddle-1.1.1 lib/paddle/models/notification_setting.rb
paddle-1.1.0 lib/paddle/models/notification_setting.rb