Sha256: 2024e813bacbc35ba3605f985192eec09a9a4f57db581c627f200c9612670f93

Contents?: true

Size: 968 Bytes

Versions: 6

Compression:

Stored size: 968 Bytes

Contents

module EarnShark
  module License
    # Get Information of a license created
    # Example response:
    #   { "Name":"License Name", "Cost":{ "value":"100", "currency":"USD" }, "Tags":[ "10 User Package" ], "License_ID":1, "Product_ID":1, "Description":"10 Users per month / 100", "Billing_Cycle":{ "value":1, "type":"Monthly" }, "Metadata":"{\"users\":\"10\"}" }
    def get_license_information(license_id, license_token)
      get("#{base_url}product/#{@product_id}/license/#{license_id}/getlicensefromapi?key=#{license_token}")
    end

    # Get all the Licenses of the current product
    # Example response:
    #   [{"Name":"License Name","Cost":{"value":"10","currency":"USD"},"Tags":["free","test","trial"],"License_ID":1,"Product_ID":1,"Description":"Test","Billing_Cycle":{"value":1,"type":"Monthly"},"Metadata":"{}"}]
    def get_all_licenses
      get("#{base_url}product/#{@product_id}/license/all?key=#{@key}")
    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
earnshark_sdk-0.2.6.1 lib/earnshark_sdk/api/license.rb
earnshark_sdk-0.2.6 lib/earnshark_sdk/api/license.rb
earnshark_sdk-0.2.5 lib/earnshark_sdk/api/license.rb
earnshark_sdk-0.2.4 lib/earnshark_sdk/api/license.rb
earnshark_sdk-0.2.2 lib/earnshark_sdk/api/license.rb
earnshark_sdk-0.2.1 lib/earnshark_sdk/api/license.rb