Class: QuotaService::QuotaService
- Inherits:
-
AuthenticatedService
- Object
- Handsoap::Service
- BasicService
- AuthenticatedService
- QuotaService::QuotaService
- Defined in:
- lib/quota_service/quota_service.rb
Overview
Client to access the developer garden quota service.
See also:
Constant Summary collapse
- @@QUOTA_SERVICE_ENDPOINT =
{ :uri => "https://gateway.developer.telekom.com/p3gw-mod-odg-admin/services/ODGBaseUserService", :version => 1 }
Instance Method Summary collapse
-
#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.
- module_id of the service for which a quota request to be made, such as “VoiceButlerProduction”
- Changes the quota for a particular service ===Parameters
-
#get_account_balance(account = nil) ⇒ Object
Get balance of the given developergarden account.
-
#get_quota_information(module_id = "VoiceButlerSandbox") ⇒ Object
Get the amount of remaining quota points.
Methods inherited from AuthenticatedService
#initialize, #invoke_authenticated
Methods inherited from BasicService
#initialize, #on_create_document, #on_response_document
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
42 43 44 45 46 47 48 49 |
# File 'lib/quota_service/quota_service.rb', line 42 def change_quota_pool(module_id = "VoiceButlerSandbox", quota_max = 100) response = invoke_authenticated("changeQuotaPool") do |, doc| .add('moduleId', module_id) .add('quotaMax', quota_max) end return BasicResponse.new(response) end |
#get_account_balance(account = nil) ⇒ Object
Get balance of the given developergarden account.
Parameters
account
-
Account ids of the sub accounts to retrieve the balance for.
Retrieves the balance of the main account if the account balance is empty.
55 56 57 58 59 60 61 |
# File 'lib/quota_service/quota_service.rb', line 55 def get_account_balance(account = nil) response = invoke_authenticated("getAccountBalance") do |, doc| .add('account', account) if account end return AccountBalanceResponse.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”
29 30 31 32 33 34 35 36 |
# File 'lib/quota_service/quota_service.rb', line 29 def get_quota_information(module_id = "VoiceButlerSandbox") response = invoke_authenticated("getQuotaInformation") do |, doc| .add('moduleId', module_id) end quota_info = QuotaInformation.new(response) return quota_info end |