Sha256: 13da2bc31704b7bc05706e7995e02f6a2859e309afcdafb1f464541ac8a633f9

Contents?: true

Size: 734 Bytes

Versions: 1

Compression:

Stored size: 734 Bytes

Contents

module Nurego
  class Entitlement < APIResource
    include Nurego::APIOperations::List
    include Nurego::APIOperations::Create


    def set_usage(feature_id, amount)
      payload = {
          feature_id: feature_id,
          organization: id,
          amount: amount
      }
      response, api_key = Nurego.request(:put, "/v1/entitlements/usage", nil, payload)
    end

    def is_allowed(feature_id, requested_amount)
      payload =  {
          :organization => id,
          :feature_id => feature_id,
          :requested_amount => requested_amount
      }
      response, api_key = Nurego.request(:get, "/v1/entitlements/allowed", nil, payload)
      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.0.1 lib/nurego/entitlement.rb