Sha256: c15045e0725eac7769fad5d257fb0209166e291b8daa2b1b608d6a10038f7227

Contents?: true

Size: 985 Bytes

Versions: 14

Compression:

Stored size: 985 Bytes

Contents

module Billimatic
  module Resources
    class Plan < Base
      def list(organization_id:)
        http.get("/organizations/#{organization_id}#{resource_base_path}") do |response|
          respond_with_collection response
        end
      end

      def create(params, organization_id:)
        http.post(
          "/organizations/#{organization_id}#{resource_base_path}",
          body: { plan: params }
        ) do |response|
          respond_with_entity(response)
        end
      end

      def update(id, params, organization_id:)
        http.put(
          "/organizations/#{organization_id}#{resource_base_path}/#{id}",
          body: { plan: params }
        ) do |response|
          respond_with_entity(response)
        end
      end

      def destroy(id, organization_id:)
        http.delete(
          "/organizations/#{organization_id}#{resource_base_path}/#{id}"
        ) do |response|
          response.code == 204
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
billimatic-client-0.12.0 lib/billimatic/resources/plan.rb
billimatic-client-0.11.3 lib/billimatic/resources/plan.rb
billimatic-client-0.11.2 lib/billimatic/resources/plan.rb
billimatic-client-0.11.1 lib/billimatic/resources/plan.rb
billimatic-client-0.11.0 lib/billimatic/resources/plan.rb
billimatic-client-0.10.2 lib/billimatic/resources/plan.rb
billimatic-client-0.10.1 lib/billimatic/resources/plan.rb
billimatic-client-0.10.0 lib/billimatic/resources/plan.rb
billimatic-client-0.9.0 lib/billimatic/resources/plan.rb
billimatic-client-0.8.0 lib/billimatic/resources/plan.rb
billimatic-client-0.7.0 lib/billimatic/resources/plan.rb
billimatic-client-0.6.0 lib/billimatic/resources/plan.rb
billimatic-client-0.5.1 lib/billimatic/resources/plan.rb
billimatic-client-0.5.0 lib/billimatic/resources/plan.rb