files.com 1.1.786 → 1.1.787
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/_VERSION +1 -1
- data/lib/files.com/api.rb +20 -5
- data/lib/files.com/api_client.rb +196 -17
- data/lib/files.com/list.rb +4 -2
- data/lib/files.com/models/action_log.rb +4 -1
- data/lib/files.com/models/action_notification_export.rb +3 -1
- data/lib/files.com/models/action_notification_export_result.rb +4 -1
- data/lib/files.com/models/ai_assistant_personality.rb +20 -7
- data/lib/files.com/models/ai_task.rb +22 -10
- data/lib/files.com/models/api_key.rb +15 -7
- data/lib/files.com/models/api_request_log.rb +4 -1
- data/lib/files.com/models/app.rb +4 -1
- data/lib/files.com/models/as2_incoming_message.rb +4 -1
- data/lib/files.com/models/as2_outgoing_message.rb +4 -1
- data/lib/files.com/models/as2_partner.rb +18 -7
- data/lib/files.com/models/as2_station.rb +14 -7
- data/lib/files.com/models/automation.rb +47 -13
- data/lib/files.com/models/automation_log.rb +4 -1
- data/lib/files.com/models/automation_run.rb +16 -9
- data/lib/files.com/models/bandwidth_snapshot.rb +4 -1
- data/lib/files.com/models/behavior.rb +27 -9
- data/lib/files.com/models/bundle.rb +57 -10
- data/lib/files.com/models/bundle_action.rb +4 -1
- data/lib/files.com/models/bundle_download.rb +4 -1
- data/lib/files.com/models/bundle_notification.rb +20 -7
- data/lib/files.com/models/bundle_recipient.rb +6 -1
- data/lib/files.com/models/bundle_registration.rb +4 -1
- data/lib/files.com/models/chat_session.rb +5 -2
- data/lib/files.com/models/child_site_management_policy.rb +18 -7
- data/lib/files.com/models/clickwrap.rb +14 -7
- data/lib/files.com/models/custom_domain.rb +18 -8
- data/lib/files.com/models/desktop_configuration_profile.rb +21 -7
- data/lib/files.com/models/dns_record.rb +4 -1
- data/lib/files.com/models/email_incoming_message.rb +4 -1
- data/lib/files.com/models/email_log.rb +4 -1
- data/lib/files.com/models/event_channel.rb +20 -7
- data/lib/files.com/models/event_delivery_attempt.rb +5 -2
- data/lib/files.com/models/event_record.rb +5 -2
- data/lib/files.com/models/event_subscription.rb +25 -7
- data/lib/files.com/models/event_target.rb +22 -7
- data/lib/files.com/models/exavault_api_request_log.rb +4 -1
- data/lib/files.com/models/expectation.rb +23 -10
- data/lib/files.com/models/expectation_evaluation.rb +5 -2
- data/lib/files.com/models/expectation_incident.rb +20 -11
- data/lib/files.com/models/external_event.rb +6 -2
- data/lib/files.com/models/file.rb +110 -37
- data/lib/files.com/models/file_comment.rb +14 -7
- data/lib/files.com/models/file_comment_reaction.rb +6 -3
- data/lib/files.com/models/file_migration.rb +1 -1
- data/lib/files.com/models/file_migration_log.rb +4 -1
- data/lib/files.com/models/folder.rb +11 -3
- data/lib/files.com/models/form_field_set.rb +26 -7
- data/lib/files.com/models/ftp_action_log.rb +4 -1
- data/lib/files.com/models/gpg_key.rb +15 -7
- data/lib/files.com/models/group.rb +30 -7
- data/lib/files.com/models/group_user.rb +16 -6
- data/lib/files.com/models/history.rb +23 -8
- data/lib/files.com/models/history_export.rb +2 -1
- data/lib/files.com/models/history_export_result.rb +4 -1
- data/lib/files.com/models/holiday_calendar.rb +15 -7
- data/lib/files.com/models/holiday_region.rb +4 -1
- data/lib/files.com/models/inbound_s3_log.rb +4 -1
- data/lib/files.com/models/inbox_recipient.rb +6 -1
- data/lib/files.com/models/inbox_registration.rb +4 -1
- data/lib/files.com/models/inbox_upload.rb +4 -1
- data/lib/files.com/models/integration_centric_profile.rb +17 -7
- data/lib/files.com/models/invoice.rb +5 -2
- data/lib/files.com/models/ip_address.rb +16 -4
- data/lib/files.com/models/key_lifecycle_rule.rb +17 -7
- data/lib/files.com/models/lock.rb +16 -6
- data/lib/files.com/models/metadata_category.rb +19 -9
- data/lib/files.com/models/notification.rb +39 -7
- data/lib/files.com/models/outbound_connection_log.rb +4 -1
- data/lib/files.com/models/partner.rb +32 -7
- data/lib/files.com/models/partner_channel.rb +17 -7
- data/lib/files.com/models/partner_channel_template.rb +17 -7
- data/lib/files.com/models/partner_site.rb +5 -3
- data/lib/files.com/models/partner_site_request.rb +10 -4
- data/lib/files.com/models/payment.rb +5 -2
- data/lib/files.com/models/pending_work_event.rb +5 -2
- data/lib/files.com/models/permission.rb +12 -4
- data/lib/files.com/models/public_hosting_request_log.rb +4 -1
- data/lib/files.com/models/public_key.rb +15 -7
- data/lib/files.com/models/remote_bandwidth_snapshot.rb +4 -1
- data/lib/files.com/models/remote_mount_backend.rb +25 -10
- data/lib/files.com/models/remote_server.rb +46 -14
- data/lib/files.com/models/remote_server_credential.rb +14 -7
- data/lib/files.com/models/request.rb +17 -6
- data/lib/files.com/models/restore.rb +8 -1
- data/lib/files.com/models/schedule.rb +14 -7
- data/lib/files.com/models/scheduled_export.rb +18 -7
- data/lib/files.com/models/scim_log.rb +5 -2
- data/lib/files.com/models/secret.rb +15 -7
- data/lib/files.com/models/session.rb +1 -0
- data/lib/files.com/models/settings_change.rb +4 -1
- data/lib/files.com/models/sftp_action_log.rb +4 -1
- data/lib/files.com/models/sftp_host_key.rb +17 -7
- data/lib/files.com/models/share_group.rb +14 -7
- data/lib/files.com/models/siem_http_destination.rb +67 -7
- data/lib/files.com/models/siem_http_destination_event.rb +5 -2
- data/lib/files.com/models/site.rb +109 -0
- data/lib/files.com/models/site_subdomain_redirect.rb +10 -5
- data/lib/files.com/models/snapshot.rb +19 -10
- data/lib/files.com/models/sso_event.rb +5 -2
- data/lib/files.com/models/sso_strategy.rb +10 -5
- data/lib/files.com/models/style.rb +9 -6
- data/lib/files.com/models/sync.rb +36 -13
- data/lib/files.com/models/sync_log.rb +4 -1
- data/lib/files.com/models/sync_run.rb +5 -2
- data/lib/files.com/models/usage_daily_snapshot.rb +4 -1
- data/lib/files.com/models/usage_snapshot.rb +4 -1
- data/lib/files.com/models/user.rb +124 -16
- data/lib/files.com/models/user_additional_email_recipient.rb +14 -7
- data/lib/files.com/models/user_cipher_use.rb +4 -1
- data/lib/files.com/models/user_lifecycle_rule.rb +26 -7
- data/lib/files.com/models/user_request.rb +11 -5
- data/lib/files.com/models/user_security_event.rb +5 -2
- data/lib/files.com/models/user_sftp_client_use.rb +4 -1
- data/lib/files.com/models/web_dav_action_log.rb +4 -1
- data/lib/files.com/models/webhook_test.rb +3 -0
- data/lib/files.com/models/workspace.rb +14 -7
- data/lib/files.com/util.rb +32 -1
- data/lib/files.com.rb +54 -1
- data/spec/lib/api_client_spec.rb +483 -0
- data/spec/list_spec.rb +31 -2
- data/spec/models/persistence_spec.rb +1 -1
- data/spec/models/user_spec.rb +20 -0
- metadata +2 -1
|
@@ -484,6 +484,7 @@ module Files
|
|
|
484
484
|
def save
|
|
485
485
|
new_obj = Folder.create(path, @attributes, @options)
|
|
486
486
|
@attributes = new_obj.attributes
|
|
487
|
+
@options = @options.merge(new_obj.options)
|
|
487
488
|
true
|
|
488
489
|
end
|
|
489
490
|
|
|
@@ -506,7 +507,7 @@ module Files
|
|
|
506
507
|
#
|
|
507
508
|
# Returns a Files::List of Files::File objects.
|
|
508
509
|
def self.list_for(path, params = {}, options = {})
|
|
509
|
-
params
|
|
510
|
+
params = (params || {}).dup
|
|
510
511
|
params[:path] = path
|
|
511
512
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if !params[:cursor].nil? and !params[:cursor].is_a?(String)
|
|
512
513
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if !params[:per_page].nil? and !params[:per_page].is_a?(Integer)
|
|
@@ -515,12 +516,18 @@ module Files
|
|
|
515
516
|
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if !params[:sort_by].nil? and !params[:sort_by].is_a?(Hash)
|
|
516
517
|
raise InvalidParameterError.new("Bad parameter: search must be an String") if !params[:search].nil? and !params[:search].is_a?(String)
|
|
517
518
|
raise InvalidParameterError.new("Bad parameter: search_custom_metadata_key must be an String") if !params[:search_custom_metadata_key].nil? and !params[:search_custom_metadata_key].is_a?(String)
|
|
519
|
+
raise InvalidParameterError.new("Bad parameter: search_all must be a single value, not #{params[:search_all].class}") if [ Array, Hash ].any? { |klass| params[:search_all].is_a?(klass) }
|
|
520
|
+
raise InvalidParameterError.new("Bad parameter: with_previews must be a single value, not #{params[:with_previews].class}") if [ Array, Hash ].any? { |klass| params[:with_previews].is_a?(klass) }
|
|
521
|
+
raise InvalidParameterError.new("Bad parameter: with_priority_color must be a single value, not #{params[:with_priority_color].class}") if [ Array, Hash ].any? { |klass| params[:with_priority_color].is_a?(klass) }
|
|
518
522
|
raise InvalidParameterError.new("Bad parameter: type must be an String") if !params[:type].nil? and !params[:type].is_a?(String)
|
|
519
523
|
raise InvalidParameterError.new("Bad parameter: modified_at_datetime must be an String") if !params[:modified_at_datetime].nil? and !params[:modified_at_datetime].is_a?(String)
|
|
520
524
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
521
525
|
|
|
526
|
+
list_options = options.dup
|
|
522
527
|
List.new(File, params) do |page_params, &check_page|
|
|
523
|
-
Api.send_request("/folders/#{page_params[:path]}", :get, page_params,
|
|
528
|
+
response, page_options = Api.send_request("/folders/#{page_params[:path]}", :get, page_params, list_options, &check_page)
|
|
529
|
+
list_options = list_options.merge(page_options)
|
|
530
|
+
[ response, page_options ]
|
|
524
531
|
end
|
|
525
532
|
end
|
|
526
533
|
|
|
@@ -534,9 +541,10 @@ module Files
|
|
|
534
541
|
#
|
|
535
542
|
# Returns a Files::File.
|
|
536
543
|
def self.create(path, params = {}, options = {})
|
|
537
|
-
params
|
|
544
|
+
params = (params || {}).dup
|
|
538
545
|
params[:path] = path
|
|
539
546
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
547
|
+
raise InvalidParameterError.new("Bad parameter: mkdir_parents must be a single value, not #{params[:mkdir_parents].class}") if [ Array, Hash ].any? { |klass| params[:mkdir_parents].is_a?(klass) }
|
|
540
548
|
raise InvalidParameterError.new("Bad parameter: provided_mtime must be an String") if !params[:provided_mtime].nil? and !params[:provided_mtime].is_a?(String)
|
|
541
549
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
542
550
|
|
|
@@ -119,29 +119,36 @@ module Files
|
|
|
119
119
|
# skip_company - boolean - Skip validating company
|
|
120
120
|
# form_fields - array(object)
|
|
121
121
|
def update(params = {})
|
|
122
|
-
params
|
|
122
|
+
params = (params || {}).dup
|
|
123
123
|
params[:id] = @attributes[:id]
|
|
124
124
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
125
125
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
126
126
|
raise InvalidParameterError.new("Bad parameter: title must be an String") if !params[:title].nil? and !params[:title].is_a?(String)
|
|
127
|
+
raise InvalidParameterError.new("Bad parameter: require_complete_metadata_capture must be a single value, not #{params[:require_complete_metadata_capture].class}") if [ Array, Hash ].any? { |klass| params[:require_complete_metadata_capture].is_a?(klass) }
|
|
127
128
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if !params[:workspace_id].nil? and !params[:workspace_id].is_a?(Integer)
|
|
129
|
+
raise InvalidParameterError.new("Bad parameter: skip_email must be a single value, not #{params[:skip_email].class}") if [ Array, Hash ].any? { |klass| params[:skip_email].is_a?(klass) }
|
|
130
|
+
raise InvalidParameterError.new("Bad parameter: skip_name must be a single value, not #{params[:skip_name].class}") if [ Array, Hash ].any? { |klass| params[:skip_name].is_a?(klass) }
|
|
131
|
+
raise InvalidParameterError.new("Bad parameter: skip_company must be a single value, not #{params[:skip_company].class}") if [ Array, Hash ].any? { |klass| params[:skip_company].is_a?(klass) }
|
|
128
132
|
raise InvalidParameterError.new("Bad parameter: form_fields must be an Array") if !params[:form_fields].nil? and !params[:form_fields].is_a?(Array)
|
|
129
133
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
130
134
|
|
|
131
135
|
response, options = Api.send_request("/form_field_sets/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("FormFieldSet") }
|
|
132
136
|
@attributes = response.data
|
|
137
|
+
@options = @options.merge(options)
|
|
133
138
|
[ response, options ]
|
|
134
139
|
end
|
|
135
140
|
|
|
136
141
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
137
142
|
def delete(params = {})
|
|
138
|
-
params
|
|
143
|
+
params = (params || {}).dup
|
|
139
144
|
params[:id] = @attributes[:id]
|
|
140
145
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
141
146
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
142
147
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
143
148
|
|
|
144
|
-
Api.send_request("/form_field_sets/#{@attributes[:id]}", :delete, params, @options)
|
|
149
|
+
response, options = Api.send_request("/form_field_sets/#{@attributes[:id]}", :delete, params, @options)
|
|
150
|
+
@options = @options.merge(options)
|
|
151
|
+
[ response, options ]
|
|
145
152
|
end
|
|
146
153
|
|
|
147
154
|
# Alias for #delete. Returns nil.
|
|
@@ -156,6 +163,7 @@ module Files
|
|
|
156
163
|
else
|
|
157
164
|
new_obj = FormFieldSet.create(@attributes, @options)
|
|
158
165
|
@attributes = new_obj.attributes
|
|
166
|
+
@options = @options.merge(new_obj.options)
|
|
159
167
|
end
|
|
160
168
|
|
|
161
169
|
true
|
|
@@ -175,8 +183,11 @@ module Files
|
|
|
175
183
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if !params[:cursor].nil? and !params[:cursor].is_a?(String)
|
|
176
184
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if !params[:per_page].nil? and !params[:per_page].is_a?(Integer)
|
|
177
185
|
|
|
186
|
+
list_options = options.dup
|
|
178
187
|
List.new(FormFieldSet, params) do |page_params, &check_page|
|
|
179
|
-
Api.send_request("/form_field_sets", :get, page_params,
|
|
188
|
+
response, page_options = Api.send_request("/form_field_sets", :get, page_params, list_options, &check_page)
|
|
189
|
+
list_options = list_options.merge(page_options)
|
|
190
|
+
[ response, page_options ]
|
|
180
191
|
end
|
|
181
192
|
end
|
|
182
193
|
|
|
@@ -192,7 +203,7 @@ module Files
|
|
|
192
203
|
#
|
|
193
204
|
# Returns a Files::FormFieldSet.
|
|
194
205
|
def self.find(id, params = {}, options = {})
|
|
195
|
-
params
|
|
206
|
+
params = (params || {}).dup
|
|
196
207
|
params[:id] = id
|
|
197
208
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
198
209
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -222,7 +233,11 @@ module Files
|
|
|
222
233
|
def self.create(params = {}, options = {})
|
|
223
234
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if !params[:user_id].nil? and !params[:user_id].is_a?(Integer)
|
|
224
235
|
raise InvalidParameterError.new("Bad parameter: title must be an String") if !params[:title].nil? and !params[:title].is_a?(String)
|
|
236
|
+
raise InvalidParameterError.new("Bad parameter: require_complete_metadata_capture must be a single value, not #{params[:require_complete_metadata_capture].class}") if [ Array, Hash ].any? { |klass| params[:require_complete_metadata_capture].is_a?(klass) }
|
|
225
237
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if !params[:workspace_id].nil? and !params[:workspace_id].is_a?(Integer)
|
|
238
|
+
raise InvalidParameterError.new("Bad parameter: skip_email must be a single value, not #{params[:skip_email].class}") if [ Array, Hash ].any? { |klass| params[:skip_email].is_a?(klass) }
|
|
239
|
+
raise InvalidParameterError.new("Bad parameter: skip_name must be a single value, not #{params[:skip_name].class}") if [ Array, Hash ].any? { |klass| params[:skip_name].is_a?(klass) }
|
|
240
|
+
raise InvalidParameterError.new("Bad parameter: skip_company must be a single value, not #{params[:skip_company].class}") if [ Array, Hash ].any? { |klass| params[:skip_company].is_a?(klass) }
|
|
226
241
|
raise InvalidParameterError.new("Bad parameter: form_fields must be an Array") if !params[:form_fields].nil? and !params[:form_fields].is_a?(Array)
|
|
227
242
|
|
|
228
243
|
response, options = Api.send_request("/form_field_sets", :post, params, options) { |reply| reply.require_object("FormFieldSet") }
|
|
@@ -243,11 +258,15 @@ module Files
|
|
|
243
258
|
#
|
|
244
259
|
# Returns a Files::FormFieldSet.
|
|
245
260
|
def self.update(id, params = {}, options = {})
|
|
246
|
-
params
|
|
261
|
+
params = (params || {}).dup
|
|
247
262
|
params[:id] = id
|
|
248
263
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
249
264
|
raise InvalidParameterError.new("Bad parameter: title must be an String") if !params[:title].nil? and !params[:title].is_a?(String)
|
|
265
|
+
raise InvalidParameterError.new("Bad parameter: require_complete_metadata_capture must be a single value, not #{params[:require_complete_metadata_capture].class}") if [ Array, Hash ].any? { |klass| params[:require_complete_metadata_capture].is_a?(klass) }
|
|
250
266
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if !params[:workspace_id].nil? and !params[:workspace_id].is_a?(Integer)
|
|
267
|
+
raise InvalidParameterError.new("Bad parameter: skip_email must be a single value, not #{params[:skip_email].class}") if [ Array, Hash ].any? { |klass| params[:skip_email].is_a?(klass) }
|
|
268
|
+
raise InvalidParameterError.new("Bad parameter: skip_name must be a single value, not #{params[:skip_name].class}") if [ Array, Hash ].any? { |klass| params[:skip_name].is_a?(klass) }
|
|
269
|
+
raise InvalidParameterError.new("Bad parameter: skip_company must be a single value, not #{params[:skip_company].class}") if [ Array, Hash ].any? { |klass| params[:skip_company].is_a?(klass) }
|
|
251
270
|
raise InvalidParameterError.new("Bad parameter: form_fields must be an Array") if !params[:form_fields].nil? and !params[:form_fields].is_a?(Array)
|
|
252
271
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
253
272
|
|
|
@@ -260,7 +279,7 @@ module Files
|
|
|
260
279
|
#
|
|
261
280
|
# Returns nil.
|
|
262
281
|
def self.delete(id, params = {}, options = {})
|
|
263
|
-
params
|
|
282
|
+
params = (params || {}).dup
|
|
264
283
|
params[:id] = id
|
|
265
284
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
266
285
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -135,8 +135,11 @@ module Files
|
|
|
135
135
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if !params[:filter_lt].nil? and !params[:filter_lt].is_a?(Hash)
|
|
136
136
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if !params[:filter_lteq].nil? and !params[:filter_lteq].is_a?(Hash)
|
|
137
137
|
|
|
138
|
+
list_options = options.dup
|
|
138
139
|
List.new(FtpActionLog, params) do |page_params, &check_page|
|
|
139
|
-
Api.send_request("/ftp_action_logs", :get, page_params,
|
|
140
|
+
response, page_options = Api.send_request("/ftp_action_logs", :get, page_params, list_options, &check_page)
|
|
141
|
+
list_options = list_options.merge(page_options)
|
|
142
|
+
[ response, page_options ]
|
|
140
143
|
end
|
|
141
144
|
end
|
|
142
145
|
|
|
@@ -189,7 +189,7 @@ module Files
|
|
|
189
189
|
# private_key_password - string - The GPG private key password
|
|
190
190
|
# name - string - GPG key name.
|
|
191
191
|
def update(params = {})
|
|
192
|
-
params
|
|
192
|
+
params = (params || {}).dup
|
|
193
193
|
params[:id] = @attributes[:id]
|
|
194
194
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
195
195
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
@@ -202,18 +202,21 @@ module Files
|
|
|
202
202
|
|
|
203
203
|
response, options = Api.send_request("/gpg_keys/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("GpgKey") }
|
|
204
204
|
@attributes = response.data
|
|
205
|
+
@options = @options.merge(options)
|
|
205
206
|
[ response, options ]
|
|
206
207
|
end
|
|
207
208
|
|
|
208
209
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
209
210
|
def delete(params = {})
|
|
210
|
-
params
|
|
211
|
+
params = (params || {}).dup
|
|
211
212
|
params[:id] = @attributes[:id]
|
|
212
213
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
213
214
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
214
215
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
215
216
|
|
|
216
|
-
Api.send_request("/gpg_keys/#{@attributes[:id]}", :delete, params, @options)
|
|
217
|
+
response, options = Api.send_request("/gpg_keys/#{@attributes[:id]}", :delete, params, @options)
|
|
218
|
+
@options = @options.merge(options)
|
|
219
|
+
[ response, options ]
|
|
217
220
|
end
|
|
218
221
|
|
|
219
222
|
# Alias for #delete. Returns nil.
|
|
@@ -228,6 +231,7 @@ module Files
|
|
|
228
231
|
else
|
|
229
232
|
new_obj = GpgKey.create(@attributes, @options)
|
|
230
233
|
@attributes = new_obj.attributes
|
|
234
|
+
@options = @options.merge(new_obj.options)
|
|
231
235
|
end
|
|
232
236
|
|
|
233
237
|
true
|
|
@@ -259,8 +263,11 @@ module Files
|
|
|
259
263
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if !params[:filter_lt].nil? and !params[:filter_lt].is_a?(Hash)
|
|
260
264
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if !params[:filter_lteq].nil? and !params[:filter_lteq].is_a?(Hash)
|
|
261
265
|
|
|
266
|
+
list_options = options.dup
|
|
262
267
|
List.new(GpgKey, params) do |page_params, &check_page|
|
|
263
|
-
Api.send_request("/gpg_keys", :get, page_params,
|
|
268
|
+
response, page_options = Api.send_request("/gpg_keys", :get, page_params, list_options, &check_page)
|
|
269
|
+
list_options = list_options.merge(page_options)
|
|
270
|
+
[ response, page_options ]
|
|
264
271
|
end
|
|
265
272
|
end
|
|
266
273
|
|
|
@@ -276,7 +283,7 @@ module Files
|
|
|
276
283
|
#
|
|
277
284
|
# Returns a Files::GpgKey.
|
|
278
285
|
def self.find(id, params = {}, options = {})
|
|
279
|
-
params
|
|
286
|
+
params = (params || {}).dup
|
|
280
287
|
params[:id] = id
|
|
281
288
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
282
289
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -315,6 +322,7 @@ module Files
|
|
|
315
322
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if !params[:name].nil? and !params[:name].is_a?(String)
|
|
316
323
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if !params[:workspace_id].nil? and !params[:workspace_id].is_a?(Integer)
|
|
317
324
|
raise InvalidParameterError.new("Bad parameter: generate_expires_at must be an String") if !params[:generate_expires_at].nil? and !params[:generate_expires_at].is_a?(String)
|
|
325
|
+
raise InvalidParameterError.new("Bad parameter: generate_keypair must be a single value, not #{params[:generate_keypair].class}") if [ Array, Hash ].any? { |klass| params[:generate_keypair].is_a?(klass) }
|
|
318
326
|
raise InvalidParameterError.new("Bad parameter: generate_full_name must be an String") if !params[:generate_full_name].nil? and !params[:generate_full_name].is_a?(String)
|
|
319
327
|
raise InvalidParameterError.new("Bad parameter: generate_email must be an String") if !params[:generate_email].nil? and !params[:generate_email].is_a?(String)
|
|
320
328
|
raise MissingParameterError.new("Parameter missing: name") if params[:name].nil?
|
|
@@ -335,7 +343,7 @@ module Files
|
|
|
335
343
|
#
|
|
336
344
|
# Returns a Files::GpgKey.
|
|
337
345
|
def self.update(id, params = {}, options = {})
|
|
338
|
-
params
|
|
346
|
+
params = (params || {}).dup
|
|
339
347
|
params[:id] = id
|
|
340
348
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
341
349
|
raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if !params[:partner_id].nil? and !params[:partner_id].is_a?(Integer)
|
|
@@ -354,7 +362,7 @@ module Files
|
|
|
354
362
|
#
|
|
355
363
|
# Returns nil.
|
|
356
364
|
def self.delete(id, params = {}, options = {})
|
|
357
|
-
params
|
|
365
|
+
params = (params || {}).dup
|
|
358
366
|
params[:id] = id
|
|
359
367
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
360
368
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -179,7 +179,7 @@ module Files
|
|
|
179
179
|
# allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
|
|
180
180
|
# name - string - Group name.
|
|
181
181
|
def update(params = {})
|
|
182
|
-
params
|
|
182
|
+
params = (params || {}).dup
|
|
183
183
|
params[:id] = @attributes[:id]
|
|
184
184
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
185
185
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
@@ -187,6 +187,11 @@ module Files
|
|
|
187
187
|
raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if !params[:user_ids].nil? and !params[:user_ids].is_a?(String)
|
|
188
188
|
raise InvalidParameterError.new("Bad parameter: admin_ids must be an String") if !params[:admin_ids].nil? and !params[:admin_ids].is_a?(String)
|
|
189
189
|
raise InvalidParameterError.new("Bad parameter: ai_assistant_personality_id must be an Integer") if !params[:ai_assistant_personality_id].nil? and !params[:ai_assistant_personality_id].is_a?(Integer)
|
|
190
|
+
raise InvalidParameterError.new("Bad parameter: ftp_permission must be a single value, not #{params[:ftp_permission].class}") if [ Array, Hash ].any? { |klass| params[:ftp_permission].is_a?(klass) }
|
|
191
|
+
raise InvalidParameterError.new("Bad parameter: sftp_permission must be a single value, not #{params[:sftp_permission].class}") if [ Array, Hash ].any? { |klass| params[:sftp_permission].is_a?(klass) }
|
|
192
|
+
raise InvalidParameterError.new("Bad parameter: dav_permission must be a single value, not #{params[:dav_permission].class}") if [ Array, Hash ].any? { |klass| params[:dav_permission].is_a?(klass) }
|
|
193
|
+
raise InvalidParameterError.new("Bad parameter: restapi_permission must be a single value, not #{params[:restapi_permission].class}") if [ Array, Hash ].any? { |klass| params[:restapi_permission].is_a?(klass) }
|
|
194
|
+
raise InvalidParameterError.new("Bad parameter: s3_compatible_endpoint_permission must be a single value, not #{params[:s3_compatible_endpoint_permission].class}") if [ Array, Hash ].any? { |klass| params[:s3_compatible_endpoint_permission].is_a?(klass) }
|
|
190
195
|
raise InvalidParameterError.new("Bad parameter: desktop_configuration_profile_id must be an Integer") if !params[:desktop_configuration_profile_id].nil? and !params[:desktop_configuration_profile_id].is_a?(Integer)
|
|
191
196
|
raise InvalidParameterError.new("Bad parameter: integration_centric_profile_id must be an Integer") if !params[:integration_centric_profile_id].nil? and !params[:integration_centric_profile_id].is_a?(Integer)
|
|
192
197
|
raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if !params[:allowed_ips].nil? and !params[:allowed_ips].is_a?(String)
|
|
@@ -195,18 +200,21 @@ module Files
|
|
|
195
200
|
|
|
196
201
|
response, options = Api.send_request("/groups/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("Group") }
|
|
197
202
|
@attributes = response.data
|
|
203
|
+
@options = @options.merge(options)
|
|
198
204
|
[ response, options ]
|
|
199
205
|
end
|
|
200
206
|
|
|
201
207
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
202
208
|
def delete(params = {})
|
|
203
|
-
params
|
|
209
|
+
params = (params || {}).dup
|
|
204
210
|
params[:id] = @attributes[:id]
|
|
205
211
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
206
212
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
207
213
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
208
214
|
|
|
209
|
-
Api.send_request("/groups/#{@attributes[:id]}", :delete, params, @options)
|
|
215
|
+
response, options = Api.send_request("/groups/#{@attributes[:id]}", :delete, params, @options)
|
|
216
|
+
@options = @options.merge(options)
|
|
217
|
+
[ response, options ]
|
|
210
218
|
end
|
|
211
219
|
|
|
212
220
|
# Alias for #delete. Returns nil.
|
|
@@ -221,6 +229,7 @@ module Files
|
|
|
221
229
|
else
|
|
222
230
|
new_obj = Group.create(@attributes, @options)
|
|
223
231
|
@attributes = new_obj.attributes
|
|
232
|
+
@options = @options.merge(new_obj.options)
|
|
224
233
|
end
|
|
225
234
|
|
|
226
235
|
true
|
|
@@ -246,9 +255,13 @@ module Files
|
|
|
246
255
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if !params[:filter].nil? and !params[:filter].is_a?(Hash)
|
|
247
256
|
raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if !params[:filter_prefix].nil? and !params[:filter_prefix].is_a?(Hash)
|
|
248
257
|
raise InvalidParameterError.new("Bad parameter: ids must be an String") if !params[:ids].nil? and !params[:ids].is_a?(String)
|
|
258
|
+
raise InvalidParameterError.new("Bad parameter: include_parent_site_groups must be a single value, not #{params[:include_parent_site_groups].class}") if [ Array, Hash ].any? { |klass| params[:include_parent_site_groups].is_a?(klass) }
|
|
249
259
|
|
|
260
|
+
list_options = options.dup
|
|
250
261
|
List.new(Group, params) do |page_params, &check_page|
|
|
251
|
-
Api.send_request("/groups", :get, page_params,
|
|
262
|
+
response, page_options = Api.send_request("/groups", :get, page_params, list_options, &check_page)
|
|
263
|
+
list_options = list_options.merge(page_options)
|
|
264
|
+
[ response, page_options ]
|
|
252
265
|
end
|
|
253
266
|
end
|
|
254
267
|
|
|
@@ -264,7 +277,7 @@ module Files
|
|
|
264
277
|
#
|
|
265
278
|
# Returns a Files::Group.
|
|
266
279
|
def self.find(id, params = {}, options = {})
|
|
267
|
-
params
|
|
280
|
+
params = (params || {}).dup
|
|
268
281
|
params[:id] = id
|
|
269
282
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
270
283
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -302,6 +315,11 @@ module Files
|
|
|
302
315
|
raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if !params[:user_ids].nil? and !params[:user_ids].is_a?(String)
|
|
303
316
|
raise InvalidParameterError.new("Bad parameter: admin_ids must be an String") if !params[:admin_ids].nil? and !params[:admin_ids].is_a?(String)
|
|
304
317
|
raise InvalidParameterError.new("Bad parameter: ai_assistant_personality_id must be an Integer") if !params[:ai_assistant_personality_id].nil? and !params[:ai_assistant_personality_id].is_a?(Integer)
|
|
318
|
+
raise InvalidParameterError.new("Bad parameter: ftp_permission must be a single value, not #{params[:ftp_permission].class}") if [ Array, Hash ].any? { |klass| params[:ftp_permission].is_a?(klass) }
|
|
319
|
+
raise InvalidParameterError.new("Bad parameter: sftp_permission must be a single value, not #{params[:sftp_permission].class}") if [ Array, Hash ].any? { |klass| params[:sftp_permission].is_a?(klass) }
|
|
320
|
+
raise InvalidParameterError.new("Bad parameter: dav_permission must be a single value, not #{params[:dav_permission].class}") if [ Array, Hash ].any? { |klass| params[:dav_permission].is_a?(klass) }
|
|
321
|
+
raise InvalidParameterError.new("Bad parameter: restapi_permission must be a single value, not #{params[:restapi_permission].class}") if [ Array, Hash ].any? { |klass| params[:restapi_permission].is_a?(klass) }
|
|
322
|
+
raise InvalidParameterError.new("Bad parameter: s3_compatible_endpoint_permission must be a single value, not #{params[:s3_compatible_endpoint_permission].class}") if [ Array, Hash ].any? { |klass| params[:s3_compatible_endpoint_permission].is_a?(klass) }
|
|
305
323
|
raise InvalidParameterError.new("Bad parameter: desktop_configuration_profile_id must be an Integer") if !params[:desktop_configuration_profile_id].nil? and !params[:desktop_configuration_profile_id].is_a?(Integer)
|
|
306
324
|
raise InvalidParameterError.new("Bad parameter: integration_centric_profile_id must be an Integer") if !params[:integration_centric_profile_id].nil? and !params[:integration_centric_profile_id].is_a?(Integer)
|
|
307
325
|
raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if !params[:allowed_ips].nil? and !params[:allowed_ips].is_a?(String)
|
|
@@ -333,13 +351,18 @@ module Files
|
|
|
333
351
|
#
|
|
334
352
|
# Returns a Files::Group.
|
|
335
353
|
def self.update(id, params = {}, options = {})
|
|
336
|
-
params
|
|
354
|
+
params = (params || {}).dup
|
|
337
355
|
params[:id] = id
|
|
338
356
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
339
357
|
raise InvalidParameterError.new("Bad parameter: notes must be an String") if !params[:notes].nil? and !params[:notes].is_a?(String)
|
|
340
358
|
raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if !params[:user_ids].nil? and !params[:user_ids].is_a?(String)
|
|
341
359
|
raise InvalidParameterError.new("Bad parameter: admin_ids must be an String") if !params[:admin_ids].nil? and !params[:admin_ids].is_a?(String)
|
|
342
360
|
raise InvalidParameterError.new("Bad parameter: ai_assistant_personality_id must be an Integer") if !params[:ai_assistant_personality_id].nil? and !params[:ai_assistant_personality_id].is_a?(Integer)
|
|
361
|
+
raise InvalidParameterError.new("Bad parameter: ftp_permission must be a single value, not #{params[:ftp_permission].class}") if [ Array, Hash ].any? { |klass| params[:ftp_permission].is_a?(klass) }
|
|
362
|
+
raise InvalidParameterError.new("Bad parameter: sftp_permission must be a single value, not #{params[:sftp_permission].class}") if [ Array, Hash ].any? { |klass| params[:sftp_permission].is_a?(klass) }
|
|
363
|
+
raise InvalidParameterError.new("Bad parameter: dav_permission must be a single value, not #{params[:dav_permission].class}") if [ Array, Hash ].any? { |klass| params[:dav_permission].is_a?(klass) }
|
|
364
|
+
raise InvalidParameterError.new("Bad parameter: restapi_permission must be a single value, not #{params[:restapi_permission].class}") if [ Array, Hash ].any? { |klass| params[:restapi_permission].is_a?(klass) }
|
|
365
|
+
raise InvalidParameterError.new("Bad parameter: s3_compatible_endpoint_permission must be a single value, not #{params[:s3_compatible_endpoint_permission].class}") if [ Array, Hash ].any? { |klass| params[:s3_compatible_endpoint_permission].is_a?(klass) }
|
|
343
366
|
raise InvalidParameterError.new("Bad parameter: desktop_configuration_profile_id must be an Integer") if !params[:desktop_configuration_profile_id].nil? and !params[:desktop_configuration_profile_id].is_a?(Integer)
|
|
344
367
|
raise InvalidParameterError.new("Bad parameter: integration_centric_profile_id must be an Integer") if !params[:integration_centric_profile_id].nil? and !params[:integration_centric_profile_id].is_a?(Integer)
|
|
345
368
|
raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if !params[:allowed_ips].nil? and !params[:allowed_ips].is_a?(String)
|
|
@@ -355,7 +378,7 @@ module Files
|
|
|
355
378
|
#
|
|
356
379
|
# Returns nil.
|
|
357
380
|
def self.delete(id, params = {}, options = {})
|
|
358
|
-
params
|
|
381
|
+
params = (params || {}).dup
|
|
359
382
|
params[:id] = id
|
|
360
383
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
361
384
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -70,18 +70,20 @@ module Files
|
|
|
70
70
|
# user_id (required) - int64 - User ID to add to group.
|
|
71
71
|
# admin - boolean - Is the user a group administrator?
|
|
72
72
|
def update(params = {})
|
|
73
|
-
params
|
|
73
|
+
params = (params || {}).dup
|
|
74
74
|
params[:id] = @attributes[:id]
|
|
75
75
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
76
76
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
77
77
|
raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if !params[:group_id].nil? and !params[:group_id].is_a?(Integer)
|
|
78
78
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if !params[:user_id].nil? and !params[:user_id].is_a?(Integer)
|
|
79
|
+
raise InvalidParameterError.new("Bad parameter: admin must be a single value, not #{params[:admin].class}") if [ Array, Hash ].any? { |klass| params[:admin].is_a?(klass) }
|
|
79
80
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
80
81
|
raise MissingParameterError.new("Parameter missing: group_id") if params[:group_id].nil?
|
|
81
82
|
raise MissingParameterError.new("Parameter missing: user_id") if params[:user_id].nil?
|
|
82
83
|
|
|
83
84
|
response, options = Api.send_request("/group_users/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("GroupUser") }
|
|
84
85
|
@attributes = response.data
|
|
86
|
+
@options = @options.merge(options)
|
|
85
87
|
[ response, options ]
|
|
86
88
|
end
|
|
87
89
|
|
|
@@ -91,7 +93,7 @@ module Files
|
|
|
91
93
|
#
|
|
92
94
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
93
95
|
def delete(params = {})
|
|
94
|
-
params
|
|
96
|
+
params = (params || {}).dup
|
|
95
97
|
params[:id] = @attributes[:id]
|
|
96
98
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
97
99
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
@@ -101,7 +103,9 @@ module Files
|
|
|
101
103
|
raise MissingParameterError.new("Parameter missing: group_id") if params[:group_id].nil?
|
|
102
104
|
raise MissingParameterError.new("Parameter missing: user_id") if params[:user_id].nil?
|
|
103
105
|
|
|
104
|
-
Api.send_request("/group_users/#{@attributes[:id]}", :delete, params, @options)
|
|
106
|
+
response, options = Api.send_request("/group_users/#{@attributes[:id]}", :delete, params, @options)
|
|
107
|
+
@options = @options.merge(options)
|
|
108
|
+
[ response, options ]
|
|
105
109
|
end
|
|
106
110
|
|
|
107
111
|
# Alias for #delete. Returns nil.
|
|
@@ -116,6 +120,7 @@ module Files
|
|
|
116
120
|
else
|
|
117
121
|
new_obj = GroupUser.create(@attributes, @options)
|
|
118
122
|
@attributes = new_obj.attributes
|
|
123
|
+
@options = @options.merge(new_obj.options)
|
|
119
124
|
end
|
|
120
125
|
|
|
121
126
|
true
|
|
@@ -137,8 +142,11 @@ module Files
|
|
|
137
142
|
raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if !params[:group_id].nil? and !params[:group_id].is_a?(Integer)
|
|
138
143
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if !params[:user_id].nil? and !params[:user_id].is_a?(Integer)
|
|
139
144
|
|
|
145
|
+
list_options = options.dup
|
|
140
146
|
List.new(GroupUser, params) do |page_params, &check_page|
|
|
141
|
-
Api.send_request("/group_users", :get, page_params,
|
|
147
|
+
response, page_options = Api.send_request("/group_users", :get, page_params, list_options, &check_page)
|
|
148
|
+
list_options = list_options.merge(page_options)
|
|
149
|
+
[ response, page_options ]
|
|
142
150
|
end
|
|
143
151
|
end
|
|
144
152
|
|
|
@@ -158,6 +166,7 @@ module Files
|
|
|
158
166
|
def self.create(params = {}, options = {})
|
|
159
167
|
raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if !params[:group_id].nil? and !params[:group_id].is_a?(Integer)
|
|
160
168
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if !params[:user_id].nil? and !params[:user_id].is_a?(Integer)
|
|
169
|
+
raise InvalidParameterError.new("Bad parameter: admin must be a single value, not #{params[:admin].class}") if [ Array, Hash ].any? { |klass| params[:admin].is_a?(klass) }
|
|
161
170
|
raise MissingParameterError.new("Parameter missing: group_id") if params[:group_id].nil?
|
|
162
171
|
raise MissingParameterError.new("Parameter missing: user_id") if params[:user_id].nil?
|
|
163
172
|
|
|
@@ -175,11 +184,12 @@ module Files
|
|
|
175
184
|
#
|
|
176
185
|
# Returns a Files::GroupUser.
|
|
177
186
|
def self.update(id, params = {}, options = {})
|
|
178
|
-
params
|
|
187
|
+
params = (params || {}).dup
|
|
179
188
|
params[:id] = id
|
|
180
189
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
181
190
|
raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if !params[:group_id].nil? and !params[:group_id].is_a?(Integer)
|
|
182
191
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if !params[:user_id].nil? and !params[:user_id].is_a?(Integer)
|
|
192
|
+
raise InvalidParameterError.new("Bad parameter: admin must be a single value, not #{params[:admin].class}") if [ Array, Hash ].any? { |klass| params[:admin].is_a?(klass) }
|
|
183
193
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
184
194
|
raise MissingParameterError.new("Parameter missing: group_id") if params[:group_id].nil?
|
|
185
195
|
raise MissingParameterError.new("Parameter missing: user_id") if params[:user_id].nil?
|
|
@@ -197,7 +207,7 @@ module Files
|
|
|
197
207
|
#
|
|
198
208
|
# Returns nil.
|
|
199
209
|
def self.delete(id, params = {}, options = {})
|
|
200
|
-
params
|
|
210
|
+
params = (params || {}).dup
|
|
201
211
|
params[:id] = id
|
|
202
212
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
203
213
|
raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if !params[:group_id].nil? and !params[:group_id].is_a?(Integer)
|
|
@@ -95,7 +95,7 @@ module Files
|
|
|
95
95
|
#
|
|
96
96
|
# Returns a Files::List of Files::Action objects.
|
|
97
97
|
def self.list_for_file(path, params = {}, options = {})
|
|
98
|
-
params
|
|
98
|
+
params = (params || {}).dup
|
|
99
99
|
params[:path] = path
|
|
100
100
|
raise InvalidParameterError.new("Bad parameter: start_at must be an String") if !params[:start_at].nil? and !params[:start_at].is_a?(String)
|
|
101
101
|
raise InvalidParameterError.new("Bad parameter: end_at must be an String") if !params[:end_at].nil? and !params[:end_at].is_a?(String)
|
|
@@ -106,8 +106,11 @@ module Files
|
|
|
106
106
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
107
107
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
108
108
|
|
|
109
|
+
list_options = options.dup
|
|
109
110
|
List.new(Action, params) do |page_params, &check_page|
|
|
110
|
-
Api.send_request("/history/files/#{page_params[:path]}", :get, page_params,
|
|
111
|
+
response, page_options = Api.send_request("/history/files/#{page_params[:path]}", :get, page_params, list_options, &check_page)
|
|
112
|
+
list_options = list_options.merge(page_options)
|
|
113
|
+
[ response, page_options ]
|
|
111
114
|
end
|
|
112
115
|
end
|
|
113
116
|
|
|
@@ -125,7 +128,7 @@ module Files
|
|
|
125
128
|
#
|
|
126
129
|
# Returns a Files::List of Files::Action objects.
|
|
127
130
|
def self.list_for_folder(path, params = {}, options = {})
|
|
128
|
-
params
|
|
131
|
+
params = (params || {}).dup
|
|
129
132
|
params[:path] = path
|
|
130
133
|
raise InvalidParameterError.new("Bad parameter: start_at must be an String") if !params[:start_at].nil? and !params[:start_at].is_a?(String)
|
|
131
134
|
raise InvalidParameterError.new("Bad parameter: end_at must be an String") if !params[:end_at].nil? and !params[:end_at].is_a?(String)
|
|
@@ -136,8 +139,11 @@ module Files
|
|
|
136
139
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
137
140
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
138
141
|
|
|
142
|
+
list_options = options.dup
|
|
139
143
|
List.new(Action, params) do |page_params, &check_page|
|
|
140
|
-
Api.send_request("/history/folders/#{page_params[:path]}", :get, page_params,
|
|
144
|
+
response, page_options = Api.send_request("/history/folders/#{page_params[:path]}", :get, page_params, list_options, &check_page)
|
|
145
|
+
list_options = list_options.merge(page_options)
|
|
146
|
+
[ response, page_options ]
|
|
141
147
|
end
|
|
142
148
|
end
|
|
143
149
|
|
|
@@ -155,7 +161,7 @@ module Files
|
|
|
155
161
|
#
|
|
156
162
|
# Returns a Files::List of Files::Action objects.
|
|
157
163
|
def self.list_for_user(user_id, params = {}, options = {})
|
|
158
|
-
params
|
|
164
|
+
params = (params || {}).dup
|
|
159
165
|
params[:user_id] = user_id
|
|
160
166
|
raise InvalidParameterError.new("Bad parameter: start_at must be an String") if !params[:start_at].nil? and !params[:start_at].is_a?(String)
|
|
161
167
|
raise InvalidParameterError.new("Bad parameter: end_at must be an String") if !params[:end_at].nil? and !params[:end_at].is_a?(String)
|
|
@@ -166,8 +172,11 @@ module Files
|
|
|
166
172
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if !params[:user_id].nil? and !params[:user_id].is_a?(Integer)
|
|
167
173
|
raise MissingParameterError.new("Parameter missing: user_id") if params[:user_id].nil?
|
|
168
174
|
|
|
175
|
+
list_options = options.dup
|
|
169
176
|
List.new(Action, params) do |page_params, &check_page|
|
|
170
|
-
Api.send_request("/history/users/#{page_params[:user_id]}", :get, page_params,
|
|
177
|
+
response, page_options = Api.send_request("/history/users/#{page_params[:user_id]}", :get, page_params, list_options, &check_page)
|
|
178
|
+
list_options = list_options.merge(page_options)
|
|
179
|
+
[ response, page_options ]
|
|
171
180
|
end
|
|
172
181
|
end
|
|
173
182
|
|
|
@@ -191,8 +200,11 @@ module Files
|
|
|
191
200
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if !params[:per_page].nil? and !params[:per_page].is_a?(Integer)
|
|
192
201
|
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if !params[:sort_by].nil? and !params[:sort_by].is_a?(Hash)
|
|
193
202
|
|
|
203
|
+
list_options = options.dup
|
|
194
204
|
List.new(Action, params) do |page_params, &check_page|
|
|
195
|
-
Api.send_request("/history/login", :get, page_params,
|
|
205
|
+
response, page_options = Api.send_request("/history/login", :get, page_params, list_options, &check_page)
|
|
206
|
+
list_options = list_options.merge(page_options)
|
|
207
|
+
[ response, page_options ]
|
|
196
208
|
end
|
|
197
209
|
end
|
|
198
210
|
|
|
@@ -220,8 +232,11 @@ module Files
|
|
|
220
232
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if !params[:filter].nil? and !params[:filter].is_a?(Hash)
|
|
221
233
|
raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if !params[:filter_prefix].nil? and !params[:filter_prefix].is_a?(Hash)
|
|
222
234
|
|
|
235
|
+
list_options = options.dup
|
|
223
236
|
List.new(Action, params) do |page_params, &check_page|
|
|
224
|
-
Api.send_request("/history", :get, page_params,
|
|
237
|
+
response, page_options = Api.send_request("/history", :get, page_params, list_options, &check_page)
|
|
238
|
+
list_options = list_options.merge(page_options)
|
|
239
|
+
[ response, page_options ]
|
|
225
240
|
end
|
|
226
241
|
end
|
|
227
242
|
|
|
@@ -260,6 +260,7 @@ module Files
|
|
|
260
260
|
else
|
|
261
261
|
new_obj = HistoryExport.create(@attributes, @options)
|
|
262
262
|
@attributes = new_obj.attributes
|
|
263
|
+
@options = @options.merge(new_obj.options)
|
|
263
264
|
end
|
|
264
265
|
|
|
265
266
|
true
|
|
@@ -273,7 +274,7 @@ module Files
|
|
|
273
274
|
#
|
|
274
275
|
# Returns a Files::HistoryExport.
|
|
275
276
|
def self.find(id, params = {}, options = {})
|
|
276
|
-
params
|
|
277
|
+
params = (params || {}).dup
|
|
277
278
|
params[:id] = id
|
|
278
279
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
279
280
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -158,8 +158,11 @@ module Files
|
|
|
158
158
|
raise InvalidParameterError.new("Bad parameter: history_export_id must be an Integer") if !params[:history_export_id].nil? and !params[:history_export_id].is_a?(Integer)
|
|
159
159
|
raise MissingParameterError.new("Parameter missing: history_export_id") if params[:history_export_id].nil?
|
|
160
160
|
|
|
161
|
+
list_options = options.dup
|
|
161
162
|
List.new(HistoryExportResult, params) do |page_params, &check_page|
|
|
162
|
-
Api.send_request("/history_export_results", :get, page_params,
|
|
163
|
+
response, page_options = Api.send_request("/history_export_results", :get, page_params, list_options, &check_page)
|
|
164
|
+
list_options = list_options.merge(page_options)
|
|
165
|
+
[ response, page_options ]
|
|
163
166
|
end
|
|
164
167
|
end
|
|
165
168
|
|