Sha256: e4c2087fda82ef7b0f092429973b3901e6e3e2a216ffa1dc9a2ba534ca033e42

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

module Nurego
  class Organization < APIResource
    include Nurego::APIOperations::List
    include Nurego::APIOperations::Update

    def instances
      Instance.all({:organization => id }, @api_key)
    end

    def paymentmethod
      PaymentMethod.all({:organization => id}, @api_key)
    end

    def bills
      Bill.all({ :organization => id }, @api_key)[:bills]
    end

    def self.entitlements(params = {}, api_key = nil)
      Entitlement.all({:organization => params[:customer_id], :feature_id => params[:feature_id] }, api_key)
    end

    def entitlements(feature_id = nil)
      Entitlement.all({:organization => id, :feature_id => feature_id, :provider_name => 'internal' }, @api_key)
    end

    def plan(params = {}, api_key = nil)
      response, api_key = Nurego.request(:get, url + '/plan', api_key, params)
      Util.convert_to_nurego_object(response, api_key)
    end

    def cancel(params = {}, api_key = nil)
      response, api_key = Nurego.request(:post, url + '/cancel', api_key, params)
      Util.convert_to_nurego_object(response, api_key)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nurego-1.1.17 lib/nurego/organization.rb
nurego-1.1.16 lib/nurego/organization.rb
nurego-1.1.15 lib/nurego/organization.rb
nurego-1.1.14 lib/nurego/organization.rb