files.com 1.1.768 → 1.1.770

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +47 -7
  4. data/_VERSION +1 -1
  5. data/docs/file.md +37 -0
  6. data/lib/files.com/api.rb +9 -4
  7. data/lib/files.com/api_client.rb +181 -55
  8. data/lib/files.com/list.rb +98 -66
  9. data/lib/files.com/models/action_log.rb +7 -2
  10. data/lib/files.com/models/action_notification_export.rb +13 -3
  11. data/lib/files.com/models/action_notification_export_result.rb +7 -2
  12. data/lib/files.com/models/ai_assistant_personality.rb +34 -8
  13. data/lib/files.com/models/ai_task.rb +39 -8
  14. data/lib/files.com/models/api_key.rb +49 -10
  15. data/lib/files.com/models/api_request_log.rb +7 -2
  16. data/lib/files.com/models/app.rb +7 -2
  17. data/lib/files.com/models/as2_incoming_message.rb +7 -2
  18. data/lib/files.com/models/as2_outgoing_message.rb +7 -2
  19. data/lib/files.com/models/as2_partner.rb +34 -8
  20. data/lib/files.com/models/as2_station.rb +34 -8
  21. data/lib/files.com/models/automation.rb +50 -10
  22. data/lib/files.com/models/automation_log.rb +7 -2
  23. data/lib/files.com/models/automation_run.rb +31 -6
  24. data/lib/files.com/models/bandwidth_snapshot.rb +7 -2
  25. data/lib/files.com/models/behavior.rb +46 -10
  26. data/lib/files.com/models/bundle.rb +39 -8
  27. data/lib/files.com/models/bundle_action.rb +7 -2
  28. data/lib/files.com/models/bundle_download.rb +7 -2
  29. data/lib/files.com/models/bundle_notification.rb +34 -8
  30. data/lib/files.com/models/bundle_recipient.rb +14 -4
  31. data/lib/files.com/models/bundle_registration.rb +7 -2
  32. data/lib/files.com/models/chat_session.rb +13 -3
  33. data/lib/files.com/models/child_site_management_policy.rb +34 -8
  34. data/lib/files.com/models/clickwrap.rb +34 -8
  35. data/lib/files.com/models/custom_domain.rb +40 -9
  36. data/lib/files.com/models/desktop_configuration_profile.rb +34 -8
  37. data/lib/files.com/models/dns_record.rb +7 -2
  38. data/lib/files.com/models/email_incoming_message.rb +7 -2
  39. data/lib/files.com/models/email_log.rb +7 -2
  40. data/lib/files.com/models/event_channel.rb +34 -8
  41. data/lib/files.com/models/event_delivery_attempt.rb +13 -3
  42. data/lib/files.com/models/event_record.rb +13 -3
  43. data/lib/files.com/models/event_subscription.rb +34 -8
  44. data/lib/files.com/models/event_target.rb +34 -8
  45. data/lib/files.com/models/exavault_api_request_log.rb +7 -2
  46. data/lib/files.com/models/expectation.rb +40 -9
  47. data/lib/files.com/models/expectation_evaluation.rb +13 -3
  48. data/lib/files.com/models/expectation_incident.rb +31 -6
  49. data/lib/files.com/models/external_event.rb +20 -5
  50. data/lib/files.com/models/file.rb +93 -15
  51. data/lib/files.com/models/file_comment.rb +28 -7
  52. data/lib/files.com/models/file_comment_reaction.rb +11 -2
  53. data/lib/files.com/models/file_migration.rb +6 -1
  54. data/lib/files.com/models/file_migration_log.rb +7 -2
  55. data/lib/files.com/models/folder.rb +13 -3
  56. data/lib/files.com/models/form_field_set.rb +34 -8
  57. data/lib/files.com/models/ftp_action_log.rb +7 -2
  58. data/lib/files.com/models/gpg_key.rb +34 -8
  59. data/lib/files.com/models/group.rb +34 -8
  60. data/lib/files.com/models/group_user.rb +29 -7
  61. data/lib/files.com/models/history.rb +35 -10
  62. data/lib/files.com/models/history_export.rb +13 -3
  63. data/lib/files.com/models/history_export_result.rb +7 -2
  64. data/lib/files.com/models/holiday_calendar.rb +34 -8
  65. data/lib/files.com/models/holiday_region.rb +7 -2
  66. data/lib/files.com/models/inbound_s3_log.rb +7 -2
  67. data/lib/files.com/models/inbox_recipient.rb +14 -4
  68. data/lib/files.com/models/inbox_registration.rb +7 -2
  69. data/lib/files.com/models/inbox_upload.rb +7 -2
  70. data/lib/files.com/models/integration_centric_profile.rb +34 -8
  71. data/lib/files.com/models/invoice.rb +13 -3
  72. data/lib/files.com/models/ip_address.rb +28 -8
  73. data/lib/files.com/models/key_lifecycle_rule.rb +34 -8
  74. data/lib/files.com/models/lock.rb +18 -3
  75. data/lib/files.com/models/metadata_category.rb +41 -10
  76. data/lib/files.com/models/notification.rb +34 -8
  77. data/lib/files.com/models/outbound_connection_log.rb +7 -2
  78. data/lib/files.com/models/partner.rb +34 -8
  79. data/lib/files.com/models/partner_channel.rb +34 -8
  80. data/lib/files.com/models/partner_channel_template.rb +34 -8
  81. data/lib/files.com/models/partner_site.rb +4 -0
  82. data/lib/files.com/models/partner_site_request.rb +33 -4
  83. data/lib/files.com/models/payment.rb +13 -3
  84. data/lib/files.com/models/pending_work_event.rb +13 -3
  85. data/lib/files.com/models/permission.rb +18 -4
  86. data/lib/files.com/models/public_hosting_request_log.rb +7 -2
  87. data/lib/files.com/models/public_key.rb +34 -8
  88. data/lib/files.com/models/remote_bandwidth_snapshot.rb +7 -2
  89. data/lib/files.com/models/remote_mount_backend.rb +39 -8
  90. data/lib/files.com/models/remote_server.rb +52 -11
  91. data/lib/files.com/models/remote_server_credential.rb +34 -8
  92. data/lib/files.com/models/request.rb +25 -6
  93. data/lib/files.com/models/restore.rb +14 -4
  94. data/lib/files.com/models/schedule.rb +34 -8
  95. data/lib/files.com/models/scheduled_export.rb +34 -8
  96. data/lib/files.com/models/scim_log.rb +13 -3
  97. data/lib/files.com/models/secret.rb +34 -8
  98. data/lib/files.com/models/session.rb +11 -2
  99. data/lib/files.com/models/settings_change.rb +7 -2
  100. data/lib/files.com/models/sftp_action_log.rb +7 -2
  101. data/lib/files.com/models/sftp_host_key.rb +34 -8
  102. data/lib/files.com/models/share_group.rb +34 -8
  103. data/lib/files.com/models/siem_http_destination.rb +39 -8
  104. data/lib/files.com/models/siem_http_destination_event.rb +13 -3
  105. data/lib/files.com/models/site.rb +16 -3
  106. data/lib/files.com/models/site_subdomain_redirect.rb +17 -3
  107. data/lib/files.com/models/snapshot.rb +39 -8
  108. data/lib/files.com/models/sso_event.rb +13 -3
  109. data/lib/files.com/models/sso_strategy.rb +18 -3
  110. data/lib/files.com/models/style.rb +20 -5
  111. data/lib/files.com/models/sync.rb +44 -8
  112. data/lib/files.com/models/sync_log.rb +7 -2
  113. data/lib/files.com/models/sync_run.rb +13 -3
  114. data/lib/files.com/models/usage_daily_snapshot.rb +7 -2
  115. data/lib/files.com/models/usage_snapshot.rb +7 -2
  116. data/lib/files.com/models/user.rb +50 -8
  117. data/lib/files.com/models/user_additional_email_recipient.rb +34 -8
  118. data/lib/files.com/models/user_cipher_use.rb +7 -2
  119. data/lib/files.com/models/user_lifecycle_rule.rb +34 -8
  120. data/lib/files.com/models/user_request.rb +24 -5
  121. data/lib/files.com/models/user_security_event.rb +13 -3
  122. data/lib/files.com/models/user_sftp_client_use.rb +7 -2
  123. data/lib/files.com/models/web_dav_action_log.rb +7 -2
  124. data/lib/files.com/models/webhook_test.rb +7 -2
  125. data/lib/files.com/models/workspace.rb +34 -8
  126. data/lib/files.com/response.rb +24 -0
  127. data/lib/files.com/sizable_io.rb +65 -4
  128. data/lib/files.com/version.rb +1 -1
  129. data/lib/files.com.rb +23 -1
  130. data/spec/language_spec.rb +20 -10
  131. data/spec/lib/api_client_spec.rb +173 -18
  132. data/spec/list_spec.rb +203 -187
  133. data/spec/models/file_transfer_spec.rb +346 -0
  134. data/spec/models/persistence_spec.rb +167 -0
  135. data/spec/spec_helper.rb +122 -6
  136. data/spec/support/stubbed_api.rb +14 -0
  137. data/spec/support/transfer_server.rb +60 -0
  138. metadata +6 -2
@@ -78,7 +78,9 @@ module Files
78
78
  raise MissingParameterError.new("Parameter missing: group_id") unless params[:group_id]
79
79
  raise MissingParameterError.new("Parameter missing: user_id") unless params[:user_id]
80
80
 
81
- Api.send_request("/group_users/#{@attributes[:id]}", :patch, params, @options)
81
+ response, options = Api.send_request("/group_users/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("GroupUser") }
82
+ @attributes = response.data
83
+ [ response, options ]
82
84
  end
83
85
 
84
86
  # Parameters:
@@ -105,12 +107,12 @@ module Files
105
107
 
106
108
  def save
107
109
  if @attributes[:id]
108
- new_obj = update(@attributes)
110
+ update(@attributes)
109
111
  else
110
112
  new_obj = GroupUser.create(@attributes, @options)
113
+ @attributes = new_obj.attributes
111
114
  end
112
115
 
113
- @attributes = new_obj.attributes
114
116
  true
115
117
  end
116
118
 
@@ -119,14 +121,19 @@ module Files
119
121
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
120
122
  # group_id - int64 - Group ID. If provided, returns memberships of this group. Requires a Site Administrator, a Read-only Administrator, a Workspace Administrator for the group's workspace, or a Group Administrator of this group.
121
123
  # user_id - int64 - User ID. If provided, will return group_users of this user.
124
+ #
125
+ # params:: Hash of API operation parameter values.
126
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
127
+ #
128
+ # Returns a Files::List of Files::GroupUser objects.
122
129
  def self.list(params = {}, options = {})
123
130
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
124
131
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
125
132
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer)
126
133
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
127
134
 
128
- List.new(GroupUser, params) do
129
- Api.send_request("/group_users", :get, params, options)
135
+ List.new(GroupUser, params) do |page_params, &check_page|
136
+ Api.send_request("/group_users", :get, page_params, options, &check_page)
130
137
  end
131
138
  end
132
139
 
@@ -138,13 +145,18 @@ module Files
138
145
  # group_id (required) - int64 - Group ID to add user to.
139
146
  # user_id (required) - int64 - User ID to add to group.
140
147
  # admin - boolean - Is the user a group administrator?
148
+ #
149
+ # params:: Hash of API operation parameter values.
150
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
151
+ #
152
+ # Returns a Files::GroupUser.
141
153
  def self.create(params = {}, options = {})
142
154
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer)
143
155
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
144
156
  raise MissingParameterError.new("Parameter missing: group_id") unless params[:group_id]
145
157
  raise MissingParameterError.new("Parameter missing: user_id") unless params[:user_id]
146
158
 
147
- response, options = Api.send_request("/group_users", :post, params, options)
159
+ response, options = Api.send_request("/group_users", :post, params, options) { |reply| reply.require_object("GroupUser") }
148
160
  GroupUser.new(response.data, options)
149
161
  end
150
162
 
@@ -152,6 +164,11 @@ module Files
152
164
  # group_id (required) - int64 - Group ID to add user to.
153
165
  # user_id (required) - int64 - User ID to add to group.
154
166
  # admin - boolean - Is the user a group administrator?
167
+ #
168
+ # params:: Hash of API operation parameter values.
169
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
170
+ #
171
+ # Returns a Files::GroupUser.
155
172
  def self.update(id, params = {}, options = {})
156
173
  params ||= {}
157
174
  params[:id] = id
@@ -162,13 +179,18 @@ module Files
162
179
  raise MissingParameterError.new("Parameter missing: group_id") unless params[:group_id]
163
180
  raise MissingParameterError.new("Parameter missing: user_id") unless params[:user_id]
164
181
 
165
- response, options = Api.send_request("/group_users/#{params[:id]}", :patch, params, options)
182
+ response, options = Api.send_request("/group_users/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("GroupUser") }
166
183
  GroupUser.new(response.data, options)
167
184
  end
168
185
 
169
186
  # Parameters:
170
187
  # group_id (required) - int64 - Group ID from which to remove user.
171
188
  # user_id (required) - int64 - User ID to remove from group.
189
+ #
190
+ # params:: Hash of API operation parameter values.
191
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
192
+ #
193
+ # Returns nil.
172
194
  def self.delete(id, params = {}, options = {})
173
195
  params ||= {}
174
196
  params[:id] = id
@@ -87,6 +87,11 @@ module Files
87
87
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
88
88
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
89
89
  # path (required) - string - Path to operate on.
90
+ #
91
+ # params:: Hash of API operation parameter values.
92
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
93
+ #
94
+ # Returns a Files::List of Files::Action objects.
90
95
  def self.list_for_file(path, params = {}, options = {})
91
96
  params ||= {}
92
97
  params[:path] = path
@@ -99,8 +104,8 @@ module Files
99
104
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
100
105
  raise MissingParameterError.new("Parameter missing: path") unless params[:path]
101
106
 
102
- List.new(Action, params) do
103
- Api.send_request("/history/files/#{params[:path]}", :get, params, options)
107
+ List.new(Action, params) do |page_params, &check_page|
108
+ Api.send_request("/history/files/#{page_params[:path]}", :get, page_params, options, &check_page)
104
109
  end
105
110
  end
106
111
 
@@ -112,6 +117,11 @@ module Files
112
117
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
113
118
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
114
119
  # path (required) - string - Path to operate on.
120
+ #
121
+ # params:: Hash of API operation parameter values.
122
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
123
+ #
124
+ # Returns a Files::List of Files::Action objects.
115
125
  def self.list_for_folder(path, params = {}, options = {})
116
126
  params ||= {}
117
127
  params[:path] = path
@@ -124,8 +134,8 @@ module Files
124
134
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
125
135
  raise MissingParameterError.new("Parameter missing: path") unless params[:path]
126
136
 
127
- List.new(Action, params) do
128
- Api.send_request("/history/folders/#{params[:path]}", :get, params, options)
137
+ List.new(Action, params) do |page_params, &check_page|
138
+ Api.send_request("/history/folders/#{page_params[:path]}", :get, page_params, options, &check_page)
129
139
  end
130
140
  end
131
141
 
@@ -137,6 +147,11 @@ module Files
137
147
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
138
148
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
139
149
  # user_id (required) - int64 - User ID.
150
+ #
151
+ # params:: Hash of API operation parameter values.
152
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
153
+ #
154
+ # Returns a Files::List of Files::Action objects.
140
155
  def self.list_for_user(user_id, params = {}, options = {})
141
156
  params ||= {}
142
157
  params[:user_id] = user_id
@@ -149,8 +164,8 @@ module Files
149
164
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
150
165
  raise MissingParameterError.new("Parameter missing: user_id") unless params[:user_id]
151
166
 
152
- List.new(Action, params) do
153
- Api.send_request("/history/users/#{params[:user_id]}", :get, params, options)
167
+ List.new(Action, params) do |page_params, &check_page|
168
+ Api.send_request("/history/users/#{page_params[:user_id]}", :get, page_params, options, &check_page)
154
169
  end
155
170
  end
156
171
 
@@ -161,6 +176,11 @@ module Files
161
176
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
162
177
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
163
178
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
179
+ #
180
+ # params:: Hash of API operation parameter values.
181
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
182
+ #
183
+ # Returns a Files::List of Files::Action objects.
164
184
  def self.list_logins(params = {}, options = {})
165
185
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params[:start_at] and !params[:start_at].is_a?(String)
166
186
  raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params[:end_at] and !params[:end_at].is_a?(String)
@@ -169,8 +189,8 @@ module Files
169
189
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
170
190
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
171
191
 
172
- List.new(Action, params) do
173
- Api.send_request("/history/login", :get, params, options)
192
+ List.new(Action, params) do |page_params, &check_page|
193
+ Api.send_request("/history/login", :get, page_params, options, &check_page)
174
194
  end
175
195
  end
176
196
 
@@ -183,6 +203,11 @@ module Files
183
203
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
184
204
  # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `user_id`, `folder` or `path`. Valid field combinations are `[ ]`, `[ path ]`, `[ path ]` or `[ path ]`.
185
205
  # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
206
+ #
207
+ # params:: Hash of API operation parameter values.
208
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
209
+ #
210
+ # Returns a Files::List of Files::Action objects.
186
211
  def self.list(params = {}, options = {})
187
212
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params[:start_at] and !params[:start_at].is_a?(String)
188
213
  raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params[:end_at] and !params[:end_at].is_a?(String)
@@ -193,8 +218,8 @@ module Files
193
218
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
194
219
  raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
195
220
 
196
- List.new(Action, params) do
197
- Api.send_request("/history", :get, params, options)
221
+ List.new(Action, params) do |page_params, &check_page|
222
+ Api.send_request("/history", :get, page_params, options, &check_page)
198
223
  end
199
224
  end
200
225
 
@@ -257,21 +257,26 @@ module Files
257
257
  raise NotImplementedError.new("The HistoryExport object doesn't support updates.")
258
258
  else
259
259
  new_obj = HistoryExport.create(@attributes, @options)
260
+ @attributes = new_obj.attributes
260
261
  end
261
262
 
262
- @attributes = new_obj.attributes
263
263
  true
264
264
  end
265
265
 
266
266
  # Parameters:
267
267
  # id (required) - int64 - History Export ID.
268
+ #
269
+ # params:: Hash of API operation parameter values.
270
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
271
+ #
272
+ # Returns a Files::HistoryExport.
268
273
  def self.find(id, params = {}, options = {})
269
274
  params ||= {}
270
275
  params[:id] = id
271
276
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
272
277
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
273
278
 
274
- response, options = Api.send_request("/history_exports/#{params[:id]}", :get, params, options)
279
+ response, options = Api.send_request("/history_exports/#{params[:id]}", :get, params, options) { |reply| reply.require_object("HistoryExport") }
275
280
  HistoryExport.new(response.data, options)
276
281
  end
277
282
 
@@ -302,6 +307,11 @@ module Files
302
307
  # query_target_username - string - If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username.
303
308
  # query_target_platform - string - If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform.
304
309
  # query_target_permission_set - string - If searching for Histories about API keys, this parameter restricts results to API keys with this permission set.
310
+ #
311
+ # params:: Hash of API operation parameter values.
312
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
313
+ #
314
+ # Returns a Files::HistoryExport.
305
315
  def self.create(params = {}, options = {})
306
316
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
307
317
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params[:start_at] and !params[:start_at].is_a?(String)
@@ -326,7 +336,7 @@ module Files
326
336
  raise InvalidParameterError.new("Bad parameter: query_target_platform must be an String") if params[:query_target_platform] and !params[:query_target_platform].is_a?(String)
327
337
  raise InvalidParameterError.new("Bad parameter: query_target_permission_set must be an String") if params[:query_target_permission_set] and !params[:query_target_permission_set].is_a?(String)
328
338
 
329
- response, options = Api.send_request("/history_exports", :post, params, options)
339
+ response, options = Api.send_request("/history_exports", :post, params, options) { |reply| reply.require_object("HistoryExport") }
330
340
  HistoryExport.new(response.data, options)
331
341
  end
332
342
  end
@@ -144,6 +144,11 @@ module Files
144
144
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
145
145
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
146
146
  # history_export_id (required) - int64 - ID of the associated history export.
147
+ #
148
+ # params:: Hash of API operation parameter values.
149
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
150
+ #
151
+ # Returns a Files::List of Files::HistoryExportResult objects.
147
152
  def self.list(params = {}, options = {})
148
153
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
149
154
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
@@ -151,8 +156,8 @@ module Files
151
156
  raise InvalidParameterError.new("Bad parameter: history_export_id must be an Integer") if params[:history_export_id] and !params[:history_export_id].is_a?(Integer)
152
157
  raise MissingParameterError.new("Parameter missing: history_export_id") unless params[:history_export_id]
153
158
 
154
- List.new(HistoryExportResult, params) do
155
- Api.send_request("/history_export_results", :get, params, options)
159
+ List.new(HistoryExportResult, params) do |page_params, &check_page|
160
+ Api.send_request("/history_export_results", :get, page_params, options, &check_page)
156
161
  end
157
162
  end
158
163
 
@@ -57,7 +57,9 @@ module Files
57
57
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
58
58
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
59
59
 
60
- Api.send_request("/holiday_calendars/#{@attributes[:id]}", :patch, params, @options)
60
+ response, options = Api.send_request("/holiday_calendars/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("HolidayCalendar") }
61
+ @attributes = response.data
62
+ [ response, options ]
61
63
  end
62
64
 
63
65
  def delete(params = {})
@@ -77,12 +79,12 @@ module Files
77
79
 
78
80
  def save
79
81
  if @attributes[:id]
80
- new_obj = update(@attributes)
82
+ update(@attributes)
81
83
  else
82
84
  new_obj = HolidayCalendar.create(@attributes, @options)
85
+ @attributes = new_obj.attributes
83
86
  end
84
87
 
85
- @attributes = new_obj.attributes
86
88
  true
87
89
  end
88
90
 
@@ -90,13 +92,18 @@ module Files
90
92
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
91
93
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
92
94
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
95
+ #
96
+ # params:: Hash of API operation parameter values.
97
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
98
+ #
99
+ # Returns a Files::List of Files::HolidayCalendar objects.
93
100
  def self.list(params = {}, options = {})
94
101
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
95
102
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
96
103
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
97
104
 
98
- List.new(HolidayCalendar, params) do
99
- Api.send_request("/holiday_calendars", :get, params, options)
105
+ List.new(HolidayCalendar, params) do |page_params, &check_page|
106
+ Api.send_request("/holiday_calendars", :get, page_params, options, &check_page)
100
107
  end
101
108
  end
102
109
 
@@ -106,13 +113,18 @@ module Files
106
113
 
107
114
  # Parameters:
108
115
  # id (required) - int64 - Holiday Calendar ID.
116
+ #
117
+ # params:: Hash of API operation parameter values.
118
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
119
+ #
120
+ # Returns a Files::HolidayCalendar.
109
121
  def self.find(id, params = {}, options = {})
110
122
  params ||= {}
111
123
  params[:id] = id
112
124
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
113
125
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
114
126
 
115
- response, options = Api.send_request("/holiday_calendars/#{params[:id]}", :get, params, options)
127
+ response, options = Api.send_request("/holiday_calendars/#{params[:id]}", :get, params, options) { |reply| reply.require_object("HolidayCalendar") }
116
128
  HolidayCalendar.new(response.data, options)
117
129
  end
118
130
 
@@ -123,19 +135,29 @@ module Files
123
135
  # Parameters:
124
136
  # definition (required) - object - Holiday rules for the calendar.
125
137
  # name (required) - string - Holiday Calendar name.
138
+ #
139
+ # params:: Hash of API operation parameter values.
140
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
141
+ #
142
+ # Returns a Files::HolidayCalendar.
126
143
  def self.create(params = {}, options = {})
127
144
  raise InvalidParameterError.new("Bad parameter: definition must be an Hash") if params[:definition] and !params[:definition].is_a?(Hash)
128
145
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
129
146
  raise MissingParameterError.new("Parameter missing: definition") unless params[:definition]
130
147
  raise MissingParameterError.new("Parameter missing: name") unless params[:name]
131
148
 
132
- response, options = Api.send_request("/holiday_calendars", :post, params, options)
149
+ response, options = Api.send_request("/holiday_calendars", :post, params, options) { |reply| reply.require_object("HolidayCalendar") }
133
150
  HolidayCalendar.new(response.data, options)
134
151
  end
135
152
 
136
153
  # Parameters:
137
154
  # definition - object - Holiday rules for the calendar.
138
155
  # name - string - Holiday Calendar name.
156
+ #
157
+ # params:: Hash of API operation parameter values.
158
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
159
+ #
160
+ # Returns a Files::HolidayCalendar.
139
161
  def self.update(id, params = {}, options = {})
140
162
  params ||= {}
141
163
  params[:id] = id
@@ -144,10 +166,14 @@ module Files
144
166
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
145
167
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
146
168
 
147
- response, options = Api.send_request("/holiday_calendars/#{params[:id]}", :patch, params, options)
169
+ response, options = Api.send_request("/holiday_calendars/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("HolidayCalendar") }
148
170
  HolidayCalendar.new(response.data, options)
149
171
  end
150
172
 
173
+ # params:: Hash of API operation parameter values.
174
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
175
+ #
176
+ # Returns nil.
151
177
  def self.delete(id, params = {}, options = {})
152
178
  params ||= {}
153
179
  params[:id] = id
@@ -22,12 +22,17 @@ module Files
22
22
  # Parameters:
23
23
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
24
24
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
25
+ #
26
+ # params:: Hash of API operation parameter values.
27
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
28
+ #
29
+ # Returns a Files::List of Files::HolidayRegion objects.
25
30
  def self.get_supported(params = {}, options = {})
26
31
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
27
32
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
28
33
 
29
- List.new(HolidayRegion, params) do
30
- Api.send_request("/holiday_regions/supported", :get, params, options)
34
+ List.new(HolidayRegion, params) do |page_params, &check_page|
35
+ Api.send_request("/holiday_regions/supported", :get, page_params, options, &check_page)
31
36
  end
32
37
  end
33
38
  end
@@ -73,6 +73,11 @@ module Files
73
73
  # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `operation`, `status`, `path` or `client_ip`. Valid field combinations are `[ operation ]`, `[ status ]`, `[ path ]`, `[ client_ip ]`, `[ created_at ]`, `[ operation, status ]`, `[ operation, path ]`, `[ operation, client_ip ]`, `[ operation, created_at ]`, `[ status, path ]`, `[ status, client_ip ]`, `[ status, created_at ]`, `[ path, client_ip ]`, `[ path, created_at ]`, `[ client_ip, created_at ]`, `[ operation, status, path ]`, `[ operation, status, client_ip ]`, `[ operation, status, created_at ]`, `[ operation, path, client_ip ]`, `[ operation, path, created_at ]`, `[ operation, client_ip, created_at ]`, `[ status, path, client_ip ]`, `[ status, path, created_at ]`, `[ status, client_ip, created_at ]`, `[ path, client_ip, created_at ]`, `[ operation, status, path, client_ip ]`, `[ operation, status, path, created_at ]`, `[ operation, status, client_ip, created_at ]`, `[ operation, path, client_ip, created_at ]` or `[ status, path, client_ip, created_at ]`.
74
74
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ operation ]`, `[ status ]`, `[ path ]`, `[ client_ip ]`, `[ created_at ]`, `[ operation, status ]`, `[ operation, path ]`, `[ operation, client_ip ]`, `[ operation, created_at ]`, `[ status, path ]`, `[ status, client_ip ]`, `[ status, created_at ]`, `[ path, client_ip ]`, `[ path, created_at ]`, `[ client_ip, created_at ]`, `[ operation, status, path ]`, `[ operation, status, client_ip ]`, `[ operation, status, created_at ]`, `[ operation, path, client_ip ]`, `[ operation, path, created_at ]`, `[ operation, client_ip, created_at ]`, `[ status, path, client_ip ]`, `[ status, path, created_at ]`, `[ status, client_ip, created_at ]`, `[ path, client_ip, created_at ]`, `[ operation, status, path, client_ip ]`, `[ operation, status, path, created_at ]`, `[ operation, status, client_ip, created_at ]`, `[ operation, path, client_ip, created_at ]` or `[ status, path, client_ip, created_at ]`.
75
75
  # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ operation ]`, `[ status ]`, `[ path ]`, `[ client_ip ]`, `[ created_at ]`, `[ operation, status ]`, `[ operation, path ]`, `[ operation, client_ip ]`, `[ operation, created_at ]`, `[ status, path ]`, `[ status, client_ip ]`, `[ status, created_at ]`, `[ path, client_ip ]`, `[ path, created_at ]`, `[ client_ip, created_at ]`, `[ operation, status, path ]`, `[ operation, status, client_ip ]`, `[ operation, status, created_at ]`, `[ operation, path, client_ip ]`, `[ operation, path, created_at ]`, `[ operation, client_ip, created_at ]`, `[ status, path, client_ip ]`, `[ status, path, created_at ]`, `[ status, client_ip, created_at ]`, `[ path, client_ip, created_at ]`, `[ operation, status, path, client_ip ]`, `[ operation, status, path, created_at ]`, `[ operation, status, client_ip, created_at ]`, `[ operation, path, client_ip, created_at ]` or `[ status, path, client_ip, created_at ]`.
76
+ #
77
+ # params:: Hash of API operation parameter values.
78
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
79
+ #
80
+ # Returns a Files::List of Files::InboundS3Log objects.
76
81
  def self.list(params = {}, options = {})
77
82
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
78
83
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
@@ -83,8 +88,8 @@ module Files
83
88
  raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
84
89
  raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
85
90
 
86
- List.new(InboundS3Log, params) do
87
- Api.send_request("/inbound_s3_logs", :get, params, options)
91
+ List.new(InboundS3Log, params) do |page_params, &check_page|
92
+ Api.send_request("/inbound_s3_logs", :get, page_params, options, &check_page)
88
93
  end
89
94
  end
90
95
 
@@ -77,9 +77,9 @@ module Files
77
77
  raise NotImplementedError.new("The InboxRecipient object doesn't support updates.")
78
78
  else
79
79
  new_obj = InboxRecipient.create(@attributes, @options)
80
+ @attributes = new_obj.attributes
80
81
  end
81
82
 
82
- @attributes = new_obj.attributes
83
83
  true
84
84
  end
85
85
 
@@ -89,6 +89,11 @@ module Files
89
89
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
90
90
  # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`.
91
91
  # inbox_id (required) - int64 - List recipients for the inbox with this ID.
92
+ #
93
+ # params:: Hash of API operation parameter values.
94
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
95
+ #
96
+ # Returns a Files::List of Files::InboxRecipient objects.
92
97
  def self.list(params = {}, options = {})
93
98
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
94
99
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
@@ -97,8 +102,8 @@ module Files
97
102
  raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params[:inbox_id] and !params[:inbox_id].is_a?(Integer)
98
103
  raise MissingParameterError.new("Parameter missing: inbox_id") unless params[:inbox_id]
99
104
 
100
- List.new(InboxRecipient, params) do
101
- Api.send_request("/inbox_recipients", :get, params, options)
105
+ List.new(InboxRecipient, params) do |page_params, &check_page|
106
+ Api.send_request("/inbox_recipients", :get, page_params, options, &check_page)
102
107
  end
103
108
  end
104
109
 
@@ -113,6 +118,11 @@ module Files
113
118
  # company - string - Company of recipient.
114
119
  # note - string - Note to include in email.
115
120
  # share_after_create - boolean - Set to true to share the link with the recipient upon creation.
121
+ #
122
+ # params:: Hash of API operation parameter values.
123
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
124
+ #
125
+ # Returns a Files::InboxRecipient.
116
126
  def self.create(params = {}, options = {})
117
127
  raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params[:inbox_id] and !params[:inbox_id].is_a?(Integer)
118
128
  raise InvalidParameterError.new("Bad parameter: recipient must be an String") if params[:recipient] and !params[:recipient].is_a?(String)
@@ -122,7 +132,7 @@ module Files
122
132
  raise MissingParameterError.new("Parameter missing: inbox_id") unless params[:inbox_id]
123
133
  raise MissingParameterError.new("Parameter missing: recipient") unless params[:recipient]
124
134
 
125
- response, options = Api.send_request("/inbox_recipients", :post, params, options)
135
+ response, options = Api.send_request("/inbox_recipients", :post, params, options) { |reply| reply.require_object("InboxRecipient") }
126
136
  InboxRecipient.new(response.data, options)
127
137
  end
128
138
  end
@@ -73,13 +73,18 @@ module Files
73
73
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
74
74
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
75
75
  # folder_behavior_id - int64 - ID of the associated Inbox. This is required if the user is not a site admin.
76
+ #
77
+ # params:: Hash of API operation parameter values.
78
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
79
+ #
80
+ # Returns a Files::List of Files::InboxRegistration objects.
76
81
  def self.list(params = {}, options = {})
77
82
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
78
83
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
79
84
  raise InvalidParameterError.new("Bad parameter: folder_behavior_id must be an Integer") if params[:folder_behavior_id] and !params[:folder_behavior_id].is_a?(Integer)
80
85
 
81
- List.new(InboxRegistration, params) do
82
- Api.send_request("/inbox_registrations", :get, params, options)
86
+ List.new(InboxRegistration, params) do |page_params, &check_page|
87
+ Api.send_request("/inbox_registrations", :get, page_params, options, &check_page)
83
88
  end
84
89
  end
85
90
 
@@ -33,6 +33,11 @@ module Files
33
33
  # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
34
34
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
35
35
  # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
36
+ #
37
+ # params:: Hash of API operation parameter values.
38
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
39
+ #
40
+ # Returns a Files::List of Files::InboxUpload objects.
36
41
  def self.list(params = {}, options = {})
37
42
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
38
43
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
@@ -43,8 +48,8 @@ module Files
43
48
  raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
44
49
  raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
45
50
 
46
- List.new(InboxUpload, params) do
47
- Api.send_request("/inbox_uploads", :get, params, options)
51
+ List.new(InboxUpload, params) do |page_params, &check_page|
52
+ Api.send_request("/inbox_uploads", :get, page_params, options, &check_page)
48
53
  end
49
54
  end
50
55