Sha256: f91d9ebcd5b1aa3f4343340d25b64a8a299cc03bc17b81443320ecfc75b2fd9c

Contents?: true

Size: 868 Bytes

Versions: 9

Compression:

Stored size: 868 Bytes

Contents

module Paddle
  class Business < Object
    class << self
      def list(customer:, **params)
        response = Client.get_request("customers/#{customer}/businesses", params: params)
        Collection.from_response(response, type: Business)
      end

      def create(customer:, name:, **params)
        attrs = { name: name }
        response = Client.post_request("customers/#{customer}/businesses", body: attrs.merge(params))
        Business.new(response.body["data"])
      end

      def retrieve(customer:, id:)
        response = Client.get_request("customers/#{customer}/businesses/#{id}")
        Business.new(response.body["data"])
      end

      def update(customer:, id:, **params)
        response = Client.patch_request("customers/#{customer}/businesses/#{id}", body: params)
        Business.new(response.body["data"])
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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