Class: QuotaService::QuotaService

Inherits:
AuthenticatedService show all
Defined in:
lib/quota_service/quota_service.rb

Overview

Constant Summary collapse

@@QUOTA_SERVICE_ENDPOINT =
{
  :uri => "https://gateway.developer.telekom.com/p3gw-mod-odg-admin/services/ODGBaseUserService",
  :version => 1
}

Instance Method Summary collapse

Methods inherited from AuthenticatedService

#initialize, #invoke_authenticated

Methods inherited from BasicService

#initialize

Constructor Details

This class inherits a constructor from AuthenticatedService

Instance Method Details

#change_quota_pool(module_id = "VoiceButlerSandbox", quota_max = 100) ⇒ Object

Changes the quota for a particular service

Parameters

module_id

module_id of the service for which a quota request to be made, such as “VoiceButlerProduction”

quota_max

Quota limit to be set



43
44
45
46
47
48
49
50
51
# File 'lib/quota_service/quota_service.rb', line 43

def change_quota_pool(module_id = "VoiceButlerSandbox", quota_max = 100)

  response = invoke_authenticated("changeQuotaPool") do |message, doc|
    message.add('moduleId', module_id)
    message.add('quotaMax', quota_max)
  end

  return BasicResponse.new(response)
end

#get_quota_information(module_id = "VoiceButlerSandbox") ⇒ Object

Get the amount of remaining quota points.

Parameters

module_id

module_id of the service for which a quota request to be made, such as “VoiceButlerProduction”



28
29
30
31
32
33
34
35
36
37
# File 'lib/quota_service/quota_service.rb', line 28

def get_quota_information(module_id = "VoiceButlerSandbox")

  response = invoke_authenticated("getQuotaInformation") do |message, doc|
    message.add('moduleId', module_id)
  end

  quota_info = QuotaInformation.new(response)

  return quota_info
end