Sha256: 3f68366e14374f1373db4acdae793aad5656bfaf65e4169f9113ccb0dfbd87e9

Contents?: true

Size: 887 Bytes

Versions: 16

Compression:

Stored size: 887 Bytes

Contents

module Billimatic
  module Resources
    class Plan < Base
      def list(organization_id:)
        list_by_organization(organization_id)
      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

16 entries across 16 versions & 1 rubygems

Version Path
billimatic-client-1.0.1 lib/billimatic/resources/plan.rb
billimatic-client-1.0.0 lib/billimatic/resources/plan.rb
billimatic-client-0.22.1 lib/billimatic/resources/plan.rb
billimatic-client-0.22.0 lib/billimatic/resources/plan.rb
billimatic-client-0.21.0 lib/billimatic/resources/plan.rb
billimatic-client-0.20.0 lib/billimatic/resources/plan.rb
billimatic-client-0.19.1 lib/billimatic/resources/plan.rb
billimatic-client-0.19.0 lib/billimatic/resources/plan.rb
billimatic-client-0.18.1 lib/billimatic/resources/plan.rb
billimatic-client-0.18.0 lib/billimatic/resources/plan.rb
billimatic-client-0.17.0 lib/billimatic/resources/plan.rb
billimatic-client-0.16.0 lib/billimatic/resources/plan.rb
billimatic-client-0.15.0 lib/billimatic/resources/plan.rb
billimatic-client-0.14.1 lib/billimatic/resources/plan.rb
billimatic-client-0.14.0 lib/billimatic/resources/plan.rb
billimatic-client-0.13.0 lib/billimatic/resources/plan.rb