Sha256: 8c1d764fb4dea022d7b28b12e0026820f8718e97e2825427a5bd7bf74bdfb5b1

Contents?: true

Size: 1.04 KB

Versions: 9

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

9 entries across 9 versions & 1 rubygems

Version Path
paddle-2.7.0 lib/paddle/models/notification_setting.rb
paddle-2.6.0 lib/paddle/models/notification_setting.rb
paddle-2.5.2 lib/paddle/models/notification_setting.rb
paddle-2.5.1 lib/paddle/models/notification_setting.rb
paddle-2.5.0 lib/paddle/models/notification_setting.rb
paddle-2.4.1 lib/paddle/models/notification_setting.rb
paddle-2.4.0 lib/paddle/models/notification_setting.rb
paddle-2.3.0 lib/paddle/models/notification_setting.rb
paddle-2.2.1 lib/paddle/models/notification_setting.rb