nvx-sds 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,11 +15,21 @@ module NVX
15
15
  def type
16
16
  @type
17
17
  end
18
+
19
+ # Sets the limit type.
20
+ def type=(type)
21
+ @type=type
22
+ end
18
23
 
19
24
  # Returns the value for the limit.
20
25
  def value
21
26
  @value
22
27
  end
28
+
29
+ # Sets the value for the limit.
30
+ def value=(value)
31
+ @value=value
32
+ end
23
33
  end
24
34
  end
25
35
  end
@@ -51,6 +51,16 @@ module NVX
51
51
  return accountlimits
52
52
  end
53
53
 
54
+ # Sets the limits from the array passed to the child username
55
+ # Valid limit types are:
56
+ def Utilities.SetAccountLimits(account_login, username, limits)
57
+ params = [APIParam.new("username", username)]
58
+ limits.each do |limit|
59
+ params << APIParam.new(limit.type, limit.value)
60
+ end
61
+ doc = Transport.execute_command_post(APICommand.SetAccountLimits, params, account_login)
62
+ end
63
+
54
64
  # Gets account usage extracting each usage type and creating a new AccountFeatureUsage object to contain each.
55
65
  def Utilities.GetAccountUsage(account_login, username)
56
66
  doc = Transport.execute_command_post(APICommand.GetAccountUsage, [APIParam.new("username", username)], account_login)
@@ -84,6 +84,24 @@ module NVX
84
84
  return (text = doc.root.elements["//Response/GetAccountNotes"].get_text and text.value)
85
85
  end
86
86
 
87
+ # Gets the account limits as an array of AccountLimit objects of the child account passed.
88
+ def GetAccountLimits(username)
89
+ Utilities.GetAccountLimits(@account_login, username)
90
+ end
91
+
92
+ #
93
+ # Sets the account limits from the array of AccountLimit objects passed on the username.
94
+ # Valid limit types:
95
+ #
96
+ # * StorageAmount - The total bytes stored.
97
+ # * DownloadBandwidthAmount - The total number of bytes that can be downloaded per pay period.
98
+ # * FileSizeDownloadLimit - The maximum size in bytes of a file that can be downlaoded.
99
+ # * UploadBandwidthAmount - The total number of bytes that can be uploaded per pay period.
100
+ #
101
+ def SetAccountLimits(username, limits)
102
+ Utilities.SetAccountLimits(@account_login, username, limits)
103
+ end
104
+
87
105
  # Set the account notes. This method expects properly formated xml. Be sure to escape any invalid characters.
88
106
  def SetAccountNotes(username, xml_notes)
89
107
  params = [APIParam.new("username", username),
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: nvx-sds
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.1
6
+ version: 1.1.0
7
7
  date: 2007-10-22 00:00:00 -07:00
8
8
  summary: A package for accessing the Nirvanix SDS allowing remote file storage, retrieval and account operations.
9
9
  require_paths: