Sha256: a5583ebb2e456e304000e400cc4a125a399f652c58eb074a9b67abaf8117388c

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 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(organization_id, params = {}, api_key = nil)
      Entitlement.all(organization_id, {:feature_id => params[:feature_id] }, api_key)
    end

    def entitlements(feature_id = nil)
      Entitlement.all(id, {:feature_id => feature_id, :external_ids => 'false' }, @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

1 entries across 1 versions & 1 rubygems

Version Path
nurego-1.1.18 lib/nurego/organization.rb