files.com 1.1.767 → 1.1.769
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/Gemfile.lock +1 -1
- data/README.md +47 -7
- data/_VERSION +1 -1
- data/docs/event_record.md +2 -2
- data/docs/event_subscription.md +8 -8
- data/docs/file.md +37 -0
- data/docs/public_key.md +1 -1
- data/lib/files.com/api.rb +9 -4
- data/lib/files.com/api_client.rb +181 -55
- data/lib/files.com/list.rb +98 -66
- data/lib/files.com/models/action_log.rb +2 -2
- data/lib/files.com/models/action_notification_export.rb +3 -3
- data/lib/files.com/models/action_notification_export_result.rb +2 -2
- data/lib/files.com/models/ai_assistant_personality.rb +10 -8
- data/lib/files.com/models/ai_task.rb +10 -8
- data/lib/files.com/models/api_key.rb +12 -10
- data/lib/files.com/models/api_request_log.rb +2 -2
- data/lib/files.com/models/app.rb +2 -2
- data/lib/files.com/models/as2_incoming_message.rb +2 -2
- data/lib/files.com/models/as2_outgoing_message.rb +2 -2
- data/lib/files.com/models/as2_partner.rb +10 -8
- data/lib/files.com/models/as2_station.rb +10 -8
- data/lib/files.com/models/automation.rb +12 -10
- data/lib/files.com/models/automation_log.rb +2 -2
- data/lib/files.com/models/automation_run.rb +6 -6
- data/lib/files.com/models/bandwidth_snapshot.rb +2 -2
- data/lib/files.com/models/behavior.rb +12 -10
- data/lib/files.com/models/bundle.rb +10 -8
- data/lib/files.com/models/bundle_action.rb +2 -2
- data/lib/files.com/models/bundle_download.rb +2 -2
- data/lib/files.com/models/bundle_notification.rb +10 -8
- data/lib/files.com/models/bundle_recipient.rb +4 -4
- data/lib/files.com/models/bundle_registration.rb +2 -2
- data/lib/files.com/models/chat_session.rb +3 -3
- data/lib/files.com/models/child_site_management_policy.rb +10 -8
- data/lib/files.com/models/clickwrap.rb +10 -8
- data/lib/files.com/models/custom_domain.rb +11 -9
- data/lib/files.com/models/desktop_configuration_profile.rb +10 -8
- data/lib/files.com/models/dns_record.rb +2 -2
- data/lib/files.com/models/email_incoming_message.rb +2 -2
- data/lib/files.com/models/email_log.rb +2 -2
- data/lib/files.com/models/event_channel.rb +10 -8
- data/lib/files.com/models/event_delivery_attempt.rb +3 -3
- data/lib/files.com/models/event_record.rb +4 -4
- data/lib/files.com/models/event_subscription.rb +14 -12
- data/lib/files.com/models/event_target.rb +10 -8
- data/lib/files.com/models/exavault_api_request_log.rb +2 -2
- data/lib/files.com/models/expectation.rb +11 -9
- data/lib/files.com/models/expectation_evaluation.rb +3 -3
- data/lib/files.com/models/expectation_incident.rb +6 -6
- data/lib/files.com/models/external_event.rb +5 -5
- data/lib/files.com/models/file.rb +23 -15
- data/lib/files.com/models/file_comment.rb +9 -7
- data/lib/files.com/models/file_comment_reaction.rb +2 -2
- data/lib/files.com/models/file_migration.rb +1 -1
- data/lib/files.com/models/file_migration_log.rb +2 -2
- data/lib/files.com/models/folder.rb +3 -3
- data/lib/files.com/models/form_field_set.rb +10 -8
- data/lib/files.com/models/ftp_action_log.rb +2 -2
- data/lib/files.com/models/gpg_key.rb +10 -8
- data/lib/files.com/models/group.rb +10 -8
- data/lib/files.com/models/group_user.rb +9 -7
- data/lib/files.com/models/history.rb +10 -10
- data/lib/files.com/models/history_export.rb +3 -3
- data/lib/files.com/models/history_export_result.rb +2 -2
- data/lib/files.com/models/holiday_calendar.rb +10 -8
- data/lib/files.com/models/holiday_region.rb +2 -2
- data/lib/files.com/models/inbound_s3_log.rb +2 -2
- data/lib/files.com/models/inbox_recipient.rb +4 -4
- data/lib/files.com/models/inbox_registration.rb +2 -2
- data/lib/files.com/models/inbox_upload.rb +2 -2
- data/lib/files.com/models/integration_centric_profile.rb +10 -8
- data/lib/files.com/models/invoice.rb +3 -3
- data/lib/files.com/models/ip_address.rb +8 -8
- data/lib/files.com/models/key_lifecycle_rule.rb +10 -8
- data/lib/files.com/models/lock.rb +3 -3
- data/lib/files.com/models/metadata_category.rb +12 -10
- data/lib/files.com/models/notification.rb +10 -8
- data/lib/files.com/models/outbound_connection_log.rb +2 -2
- data/lib/files.com/models/partner.rb +10 -8
- data/lib/files.com/models/partner_channel.rb +10 -8
- data/lib/files.com/models/partner_channel_template.rb +10 -8
- data/lib/files.com/models/partner_site_request.rb +4 -4
- data/lib/files.com/models/payment.rb +3 -3
- data/lib/files.com/models/pending_work_event.rb +3 -3
- data/lib/files.com/models/permission.rb +4 -4
- data/lib/files.com/models/public_hosting_request_log.rb +2 -2
- data/lib/files.com/models/public_key.rb +11 -9
- data/lib/files.com/models/remote_bandwidth_snapshot.rb +2 -2
- data/lib/files.com/models/remote_mount_backend.rb +10 -8
- data/lib/files.com/models/remote_server.rb +13 -11
- data/lib/files.com/models/remote_server_credential.rb +10 -8
- data/lib/files.com/models/request.rb +6 -6
- data/lib/files.com/models/restore.rb +4 -4
- data/lib/files.com/models/schedule.rb +10 -8
- data/lib/files.com/models/scheduled_export.rb +10 -8
- data/lib/files.com/models/scim_log.rb +3 -3
- data/lib/files.com/models/secret.rb +10 -8
- data/lib/files.com/models/session.rb +2 -2
- data/lib/files.com/models/settings_change.rb +2 -2
- data/lib/files.com/models/sftp_action_log.rb +2 -2
- data/lib/files.com/models/sftp_host_key.rb +10 -8
- data/lib/files.com/models/share_group.rb +10 -8
- data/lib/files.com/models/siem_http_destination.rb +10 -8
- data/lib/files.com/models/siem_http_destination_event.rb +3 -3
- data/lib/files.com/models/site.rb +3 -3
- data/lib/files.com/models/site_subdomain_redirect.rb +3 -3
- data/lib/files.com/models/snapshot.rb +10 -8
- data/lib/files.com/models/sso_event.rb +3 -3
- data/lib/files.com/models/sso_strategy.rb +3 -3
- data/lib/files.com/models/style.rb +6 -5
- data/lib/files.com/models/sync.rb +10 -8
- data/lib/files.com/models/sync_log.rb +2 -2
- data/lib/files.com/models/sync_run.rb +3 -3
- data/lib/files.com/models/usage_daily_snapshot.rb +2 -2
- data/lib/files.com/models/usage_snapshot.rb +2 -2
- data/lib/files.com/models/user.rb +10 -8
- data/lib/files.com/models/user_additional_email_recipient.rb +10 -8
- data/lib/files.com/models/user_cipher_use.rb +2 -2
- data/lib/files.com/models/user_lifecycle_rule.rb +10 -8
- data/lib/files.com/models/user_request.rb +5 -5
- data/lib/files.com/models/user_security_event.rb +3 -3
- data/lib/files.com/models/user_sftp_client_use.rb +2 -2
- data/lib/files.com/models/web_dav_action_log.rb +2 -2
- data/lib/files.com/models/webhook_test.rb +2 -2
- data/lib/files.com/models/workspace.rb +10 -8
- data/lib/files.com/response.rb +24 -0
- data/lib/files.com/sizable_io.rb +65 -4
- data/lib/files.com/version.rb +1 -1
- data/lib/files.com.rb +23 -1
- data/spec/language_spec.rb +20 -10
- data/spec/lib/api_client_spec.rb +173 -18
- data/spec/list_spec.rb +203 -187
- data/spec/models/file_transfer_spec.rb +346 -0
- data/spec/models/persistence_spec.rb +167 -0
- data/spec/spec_helper.rb +122 -6
- data/spec/support/stubbed_api.rb +14 -0
- data/spec/support/transfer_server.rb +60 -0
- metadata +5 -1
|
@@ -370,7 +370,9 @@ module Files
|
|
|
370
370
|
raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
|
|
371
371
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
372
372
|
|
|
373
|
-
Api.send_request("/syncs/#{@attributes[:id]}", :patch, params, @options)
|
|
373
|
+
response, options = Api.send_request("/syncs/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("Sync") }
|
|
374
|
+
@attributes = response.data
|
|
375
|
+
[ response, options ]
|
|
374
376
|
end
|
|
375
377
|
|
|
376
378
|
def delete(params = {})
|
|
@@ -390,12 +392,12 @@ module Files
|
|
|
390
392
|
|
|
391
393
|
def save
|
|
392
394
|
if @attributes[:id]
|
|
393
|
-
|
|
395
|
+
update(@attributes)
|
|
394
396
|
else
|
|
395
397
|
new_obj = Sync.create(@attributes, @options)
|
|
398
|
+
@attributes = new_obj.attributes
|
|
396
399
|
end
|
|
397
400
|
|
|
398
|
-
@attributes = new_obj.attributes
|
|
399
401
|
true
|
|
400
402
|
end
|
|
401
403
|
|
|
@@ -410,8 +412,8 @@ module Files
|
|
|
410
412
|
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
|
411
413
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
412
414
|
|
|
413
|
-
List.new(Sync, params) do
|
|
414
|
-
Api.send_request("/syncs", :get,
|
|
415
|
+
List.new(Sync, params) do |page_params, &check_page|
|
|
416
|
+
Api.send_request("/syncs", :get, page_params, options, &check_page)
|
|
415
417
|
end
|
|
416
418
|
end
|
|
417
419
|
|
|
@@ -427,7 +429,7 @@ module Files
|
|
|
427
429
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
428
430
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
429
431
|
|
|
430
|
-
response, options = Api.send_request("/syncs/#{params[:id]}", :get, params, options)
|
|
432
|
+
response, options = Api.send_request("/syncs/#{params[:id]}", :get, params, options) { |reply| reply.require_object("Sync") }
|
|
431
433
|
Sync.new(response.data, options)
|
|
432
434
|
end
|
|
433
435
|
|
|
@@ -482,7 +484,7 @@ module Files
|
|
|
482
484
|
raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
|
|
483
485
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
484
486
|
|
|
485
|
-
response, options = Api.send_request("/syncs", :post, params, options)
|
|
487
|
+
response, options = Api.send_request("/syncs", :post, params, options) { |reply| reply.require_object("Sync") }
|
|
486
488
|
Sync.new(response.data, options)
|
|
487
489
|
end
|
|
488
490
|
|
|
@@ -557,7 +559,7 @@ module Files
|
|
|
557
559
|
raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
|
|
558
560
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
559
561
|
|
|
560
|
-
response, options = Api.send_request("/syncs/#{params[:id]}", :patch, params, options)
|
|
562
|
+
response, options = Api.send_request("/syncs/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("Sync") }
|
|
561
563
|
Sync.new(response.data, options)
|
|
562
564
|
end
|
|
563
565
|
|
|
@@ -86,8 +86,8 @@ module Files
|
|
|
86
86
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
87
87
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
88
88
|
|
|
89
|
-
List.new(SyncLog, params) do
|
|
90
|
-
Api.send_request("/sync_logs", :get,
|
|
89
|
+
List.new(SyncLog, params) do |page_params, &check_page|
|
|
90
|
+
Api.send_request("/sync_logs", :get, page_params, options, &check_page)
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
93
|
|
|
@@ -145,8 +145,8 @@ module Files
|
|
|
145
145
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
146
146
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
147
147
|
|
|
148
|
-
List.new(SyncRun, params) do
|
|
149
|
-
Api.send_request("/sync_runs", :get,
|
|
148
|
+
List.new(SyncRun, params) do |page_params, &check_page|
|
|
149
|
+
Api.send_request("/sync_runs", :get, page_params, options, &check_page)
|
|
150
150
|
end
|
|
151
151
|
end
|
|
152
152
|
|
|
@@ -162,7 +162,7 @@ module Files
|
|
|
162
162
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
163
163
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
164
164
|
|
|
165
|
-
response, options = Api.send_request("/sync_runs/#{params[:id]}", :get, params, options)
|
|
165
|
+
response, options = Api.send_request("/sync_runs/#{params[:id]}", :get, params, options) { |reply| reply.require_object("SyncRun") }
|
|
166
166
|
SyncRun.new(response.data, options)
|
|
167
167
|
end
|
|
168
168
|
|
|
@@ -88,8 +88,8 @@ module Files
|
|
|
88
88
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
89
89
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
90
90
|
|
|
91
|
-
List.new(UsageDailySnapshot, params) do
|
|
92
|
-
Api.send_request("/usage_daily_snapshots", :get,
|
|
91
|
+
List.new(UsageDailySnapshot, params) do |page_params, &check_page|
|
|
92
|
+
Api.send_request("/usage_daily_snapshots", :get, page_params, options, &check_page)
|
|
93
93
|
end
|
|
94
94
|
end
|
|
95
95
|
|
|
@@ -96,8 +96,8 @@ module Files
|
|
|
96
96
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
97
97
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
98
98
|
|
|
99
|
-
List.new(UsageSnapshot, params) do
|
|
100
|
-
Api.send_request("/usage_snapshots", :get,
|
|
99
|
+
List.new(UsageSnapshot, params) do |page_params, &check_page|
|
|
100
|
+
Api.send_request("/usage_snapshots", :get, page_params, options, &check_page)
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -1064,7 +1064,9 @@ module Files
|
|
|
1064
1064
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
1065
1065
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
1066
1066
|
|
|
1067
|
-
Api.send_request("/users/#{@attributes[:id]}", :patch, params, @options)
|
|
1067
|
+
response, options = Api.send_request("/users/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("User") }
|
|
1068
|
+
@attributes = response.data
|
|
1069
|
+
[ response, options ]
|
|
1068
1070
|
end
|
|
1069
1071
|
|
|
1070
1072
|
# Parameters:
|
|
@@ -1087,12 +1089,12 @@ module Files
|
|
|
1087
1089
|
|
|
1088
1090
|
def save
|
|
1089
1091
|
if @attributes[:id]
|
|
1090
|
-
|
|
1092
|
+
update(@attributes)
|
|
1091
1093
|
else
|
|
1092
1094
|
new_obj = User.create(@attributes, @options)
|
|
1095
|
+
@attributes = new_obj.attributes
|
|
1093
1096
|
end
|
|
1094
1097
|
|
|
1095
|
-
@attributes = new_obj.attributes
|
|
1096
1098
|
true
|
|
1097
1099
|
end
|
|
1098
1100
|
|
|
@@ -1122,8 +1124,8 @@ module Files
|
|
|
1122
1124
|
raise InvalidParameterError.new("Bad parameter: ids must be an String") if params[:ids] and !params[:ids].is_a?(String)
|
|
1123
1125
|
raise InvalidParameterError.new("Bad parameter: search must be an String") if params[:search] and !params[:search].is_a?(String)
|
|
1124
1126
|
|
|
1125
|
-
List.new(User, params) do
|
|
1126
|
-
Api.send_request("/users", :get,
|
|
1127
|
+
List.new(User, params) do |page_params, &check_page|
|
|
1128
|
+
Api.send_request("/users", :get, page_params, options, &check_page)
|
|
1127
1129
|
end
|
|
1128
1130
|
end
|
|
1129
1131
|
|
|
@@ -1139,7 +1141,7 @@ module Files
|
|
|
1139
1141
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
1140
1142
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
1141
1143
|
|
|
1142
|
-
response, options = Api.send_request("/users/#{params[:id]}", :get, params, options)
|
|
1144
|
+
response, options = Api.send_request("/users/#{params[:id]}", :get, params, options) { |reply| reply.require_object("User") }
|
|
1143
1145
|
User.new(response.data, options)
|
|
1144
1146
|
end
|
|
1145
1147
|
|
|
@@ -1258,7 +1260,7 @@ module Files
|
|
|
1258
1260
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
1259
1261
|
raise MissingParameterError.new("Parameter missing: username") unless params[:username]
|
|
1260
1262
|
|
|
1261
|
-
response, options = Api.send_request("/users", :post, params, options)
|
|
1263
|
+
response, options = Api.send_request("/users", :post, params, options) { |reply| reply.require_object("User") }
|
|
1262
1264
|
User.new(response.data, options)
|
|
1263
1265
|
end
|
|
1264
1266
|
|
|
@@ -1411,7 +1413,7 @@ module Files
|
|
|
1411
1413
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
1412
1414
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
1413
1415
|
|
|
1414
|
-
response, options = Api.send_request("/users/#{params[:id]}", :patch, params, options)
|
|
1416
|
+
response, options = Api.send_request("/users/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("User") }
|
|
1415
1417
|
User.new(response.data, options)
|
|
1416
1418
|
end
|
|
1417
1419
|
|
|
@@ -60,7 +60,9 @@ module Files
|
|
|
60
60
|
raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String)
|
|
61
61
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
62
62
|
|
|
63
|
-
Api.send_request("/user_additional_email_recipients/#{@attributes[:id]}", :patch, params, @options)
|
|
63
|
+
response, options = Api.send_request("/user_additional_email_recipients/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("UserAdditionalEmailRecipient") }
|
|
64
|
+
@attributes = response.data
|
|
65
|
+
[ response, options ]
|
|
64
66
|
end
|
|
65
67
|
|
|
66
68
|
def delete(params = {})
|
|
@@ -80,12 +82,12 @@ module Files
|
|
|
80
82
|
|
|
81
83
|
def save
|
|
82
84
|
if @attributes[:id]
|
|
83
|
-
|
|
85
|
+
update(@attributes)
|
|
84
86
|
else
|
|
85
87
|
new_obj = UserAdditionalEmailRecipient.create(@attributes, @options)
|
|
88
|
+
@attributes = new_obj.attributes
|
|
86
89
|
end
|
|
87
90
|
|
|
88
|
-
@attributes = new_obj.attributes
|
|
89
91
|
true
|
|
90
92
|
end
|
|
91
93
|
|
|
@@ -104,8 +106,8 @@ module Files
|
|
|
104
106
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
105
107
|
raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
|
|
106
108
|
|
|
107
|
-
List.new(UserAdditionalEmailRecipient, params) do
|
|
108
|
-
Api.send_request("/user_additional_email_recipients", :get,
|
|
109
|
+
List.new(UserAdditionalEmailRecipient, params) do |page_params, &check_page|
|
|
110
|
+
Api.send_request("/user_additional_email_recipients", :get, page_params, options, &check_page)
|
|
109
111
|
end
|
|
110
112
|
end
|
|
111
113
|
|
|
@@ -121,7 +123,7 @@ module Files
|
|
|
121
123
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
122
124
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
123
125
|
|
|
124
|
-
response, options = Api.send_request("/user_additional_email_recipients/#{params[:id]}", :get, params, options)
|
|
126
|
+
response, options = Api.send_request("/user_additional_email_recipients/#{params[:id]}", :get, params, options) { |reply| reply.require_object("UserAdditionalEmailRecipient") }
|
|
125
127
|
UserAdditionalEmailRecipient.new(response.data, options)
|
|
126
128
|
end
|
|
127
129
|
|
|
@@ -137,7 +139,7 @@ module Files
|
|
|
137
139
|
raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String)
|
|
138
140
|
raise MissingParameterError.new("Parameter missing: email") unless params[:email]
|
|
139
141
|
|
|
140
|
-
response, options = Api.send_request("/user_additional_email_recipients", :post, params, options)
|
|
142
|
+
response, options = Api.send_request("/user_additional_email_recipients", :post, params, options) { |reply| reply.require_object("UserAdditionalEmailRecipient") }
|
|
141
143
|
UserAdditionalEmailRecipient.new(response.data, options)
|
|
142
144
|
end
|
|
143
145
|
|
|
@@ -150,7 +152,7 @@ module Files
|
|
|
150
152
|
raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String)
|
|
151
153
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
152
154
|
|
|
153
|
-
response, options = Api.send_request("/user_additional_email_recipients/#{params[:id]}", :patch, params, options)
|
|
155
|
+
response, options = Api.send_request("/user_additional_email_recipients/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("UserAdditionalEmailRecipient") }
|
|
154
156
|
UserAdditionalEmailRecipient.new(response.data, options)
|
|
155
157
|
end
|
|
156
158
|
|
|
@@ -70,8 +70,8 @@ module Files
|
|
|
70
70
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
71
71
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
72
72
|
|
|
73
|
-
List.new(UserCipherUse, params) do
|
|
74
|
-
Api.send_request("/user_cipher_uses", :get,
|
|
73
|
+
List.new(UserCipherUse, params) do |page_params, &check_page|
|
|
74
|
+
Api.send_request("/user_cipher_uses", :get, page_params, options, &check_page)
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
77
|
|
|
@@ -174,7 +174,9 @@ module Files
|
|
|
174
174
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
175
175
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
176
176
|
|
|
177
|
-
Api.send_request("/user_lifecycle_rules/#{@attributes[:id]}", :patch, params, @options)
|
|
177
|
+
response, options = Api.send_request("/user_lifecycle_rules/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("UserLifecycleRule") }
|
|
178
|
+
@attributes = response.data
|
|
179
|
+
[ response, options ]
|
|
178
180
|
end
|
|
179
181
|
|
|
180
182
|
def delete(params = {})
|
|
@@ -194,12 +196,12 @@ module Files
|
|
|
194
196
|
|
|
195
197
|
def save
|
|
196
198
|
if @attributes[:id]
|
|
197
|
-
|
|
199
|
+
update(@attributes)
|
|
198
200
|
else
|
|
199
201
|
new_obj = UserLifecycleRule.create(@attributes, @options)
|
|
202
|
+
@attributes = new_obj.attributes
|
|
200
203
|
end
|
|
201
204
|
|
|
202
|
-
@attributes = new_obj.attributes
|
|
203
205
|
true
|
|
204
206
|
end
|
|
205
207
|
|
|
@@ -214,8 +216,8 @@ module Files
|
|
|
214
216
|
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
|
215
217
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
216
218
|
|
|
217
|
-
List.new(UserLifecycleRule, params) do
|
|
218
|
-
Api.send_request("/user_lifecycle_rules", :get,
|
|
219
|
+
List.new(UserLifecycleRule, params) do |page_params, &check_page|
|
|
220
|
+
Api.send_request("/user_lifecycle_rules", :get, page_params, options, &check_page)
|
|
219
221
|
end
|
|
220
222
|
end
|
|
221
223
|
|
|
@@ -231,7 +233,7 @@ module Files
|
|
|
231
233
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
232
234
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
233
235
|
|
|
234
|
-
response, options = Api.send_request("/user_lifecycle_rules/#{params[:id]}", :get, params, options)
|
|
236
|
+
response, options = Api.send_request("/user_lifecycle_rules/#{params[:id]}", :get, params, options) { |reply| reply.require_object("UserLifecycleRule") }
|
|
235
237
|
UserLifecycleRule.new(response.data, options)
|
|
236
238
|
end
|
|
237
239
|
|
|
@@ -264,7 +266,7 @@ module Files
|
|
|
264
266
|
raise InvalidParameterError.new("Bad parameter: user_tag must be an String") if params[:user_tag] and !params[:user_tag].is_a?(String)
|
|
265
267
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
266
268
|
|
|
267
|
-
response, options = Api.send_request("/user_lifecycle_rules", :post, params, options)
|
|
269
|
+
response, options = Api.send_request("/user_lifecycle_rules", :post, params, options) { |reply| reply.require_object("UserLifecycleRule") }
|
|
268
270
|
UserLifecycleRule.new(response.data, options)
|
|
269
271
|
end
|
|
270
272
|
|
|
@@ -297,7 +299,7 @@ module Files
|
|
|
297
299
|
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
298
300
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
299
301
|
|
|
300
|
-
response, options = Api.send_request("/user_lifecycle_rules/#{params[:id]}", :patch, params, options)
|
|
302
|
+
response, options = Api.send_request("/user_lifecycle_rules/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("UserLifecycleRule") }
|
|
301
303
|
UserLifecycleRule.new(response.data, options)
|
|
302
304
|
end
|
|
303
305
|
|
|
@@ -74,9 +74,9 @@ module Files
|
|
|
74
74
|
raise NotImplementedError.new("The UserRequest object doesn't support updates.")
|
|
75
75
|
else
|
|
76
76
|
new_obj = UserRequest.create(@attributes, @options)
|
|
77
|
+
@attributes = new_obj.attributes
|
|
77
78
|
end
|
|
78
79
|
|
|
79
|
-
@attributes = new_obj.attributes
|
|
80
80
|
true
|
|
81
81
|
end
|
|
82
82
|
|
|
@@ -87,8 +87,8 @@ module Files
|
|
|
87
87
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
88
88
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
89
89
|
|
|
90
|
-
List.new(UserRequest, params) do
|
|
91
|
-
Api.send_request("/user_requests", :get,
|
|
90
|
+
List.new(UserRequest, params) do |page_params, &check_page|
|
|
91
|
+
Api.send_request("/user_requests", :get, page_params, options, &check_page)
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
@@ -104,7 +104,7 @@ module Files
|
|
|
104
104
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
105
105
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
106
106
|
|
|
107
|
-
response, options = Api.send_request("/user_requests/#{params[:id]}", :get, params, options)
|
|
107
|
+
response, options = Api.send_request("/user_requests/#{params[:id]}", :get, params, options) { |reply| reply.require_object("UserRequest") }
|
|
108
108
|
UserRequest.new(response.data, options)
|
|
109
109
|
end
|
|
110
110
|
|
|
@@ -126,7 +126,7 @@ module Files
|
|
|
126
126
|
raise MissingParameterError.new("Parameter missing: email") unless params[:email]
|
|
127
127
|
raise MissingParameterError.new("Parameter missing: details") unless params[:details]
|
|
128
128
|
|
|
129
|
-
response, options = Api.send_request("/user_requests", :post, params, options)
|
|
129
|
+
response, options = Api.send_request("/user_requests", :post, params, options) { |reply| reply.require_object("UserRequest") }
|
|
130
130
|
UserRequest.new(response.data, options)
|
|
131
131
|
end
|
|
132
132
|
|
|
@@ -63,8 +63,8 @@ module Files
|
|
|
63
63
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
64
64
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
65
65
|
|
|
66
|
-
List.new(UserSecurityEvent, params) do
|
|
67
|
-
Api.send_request("/user_security_events", :get,
|
|
66
|
+
List.new(UserSecurityEvent, params) do |page_params, &check_page|
|
|
67
|
+
Api.send_request("/user_security_events", :get, page_params, options, &check_page)
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -80,7 +80,7 @@ module Files
|
|
|
80
80
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
81
81
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
82
82
|
|
|
83
|
-
response, options = Api.send_request("/user_security_events/#{params[:id]}", :get, params, options)
|
|
83
|
+
response, options = Api.send_request("/user_security_events/#{params[:id]}", :get, params, options) { |reply| reply.require_object("UserSecurityEvent") }
|
|
84
84
|
UserSecurityEvent.new(response.data, options)
|
|
85
85
|
end
|
|
86
86
|
|
|
@@ -45,8 +45,8 @@ module Files
|
|
|
45
45
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
46
46
|
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
|
47
47
|
|
|
48
|
-
List.new(UserSftpClientUse, params) do
|
|
49
|
-
Api.send_request("/user_sftp_client_uses", :get,
|
|
48
|
+
List.new(UserSftpClientUse, params) do |page_params, &check_page|
|
|
49
|
+
Api.send_request("/user_sftp_client_uses", :get, page_params, options, &check_page)
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -118,8 +118,8 @@ module Files
|
|
|
118
118
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
119
119
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
120
120
|
|
|
121
|
-
List.new(WebDavActionLog, params) do
|
|
122
|
-
Api.send_request("/web_dav_action_logs", :get,
|
|
121
|
+
List.new(WebDavActionLog, params) do |page_params, &check_page|
|
|
122
|
+
Api.send_request("/web_dav_action_logs", :get, page_params, options, &check_page)
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
125
|
|
|
@@ -149,9 +149,9 @@ module Files
|
|
|
149
149
|
raise NotImplementedError.new("The WebhookTest object doesn't support updates.")
|
|
150
150
|
else
|
|
151
151
|
new_obj = WebhookTest.create(@attributes, @options)
|
|
152
|
+
@attributes = new_obj.attributes
|
|
152
153
|
end
|
|
153
154
|
|
|
154
|
-
@attributes = new_obj.attributes
|
|
155
155
|
true
|
|
156
156
|
end
|
|
157
157
|
|
|
@@ -177,7 +177,7 @@ module Files
|
|
|
177
177
|
raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String)
|
|
178
178
|
raise MissingParameterError.new("Parameter missing: url") unless params[:url]
|
|
179
179
|
|
|
180
|
-
response, options = Api.send_request("/webhook_tests", :post, params, options)
|
|
180
|
+
response, options = Api.send_request("/webhook_tests", :post, params, options) { |reply| reply.require_object("WebhookTest") }
|
|
181
181
|
WebhookTest.new(response.data, options)
|
|
182
182
|
end
|
|
183
183
|
end
|
|
@@ -37,7 +37,9 @@ module Files
|
|
|
37
37
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
38
38
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
39
39
|
|
|
40
|
-
Api.send_request("/workspaces/#{@attributes[:id]}", :patch, params, @options)
|
|
40
|
+
response, options = Api.send_request("/workspaces/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("Workspace") }
|
|
41
|
+
@attributes = response.data
|
|
42
|
+
[ response, options ]
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
def delete(params = {})
|
|
@@ -57,12 +59,12 @@ module Files
|
|
|
57
59
|
|
|
58
60
|
def save
|
|
59
61
|
if @attributes[:id]
|
|
60
|
-
|
|
62
|
+
update(@attributes)
|
|
61
63
|
else
|
|
62
64
|
new_obj = Workspace.create(@attributes, @options)
|
|
65
|
+
@attributes = new_obj.attributes
|
|
63
66
|
end
|
|
64
67
|
|
|
65
|
-
@attributes = new_obj.attributes
|
|
66
68
|
true
|
|
67
69
|
end
|
|
68
70
|
|
|
@@ -79,8 +81,8 @@ module Files
|
|
|
79
81
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
80
82
|
raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
|
|
81
83
|
|
|
82
|
-
List.new(Workspace, params) do
|
|
83
|
-
Api.send_request("/workspaces", :get,
|
|
84
|
+
List.new(Workspace, params) do |page_params, &check_page|
|
|
85
|
+
Api.send_request("/workspaces", :get, page_params, options, &check_page)
|
|
84
86
|
end
|
|
85
87
|
end
|
|
86
88
|
|
|
@@ -96,7 +98,7 @@ module Files
|
|
|
96
98
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
97
99
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
98
100
|
|
|
99
|
-
response, options = Api.send_request("/workspaces/#{params[:id]}", :get, params, options)
|
|
101
|
+
response, options = Api.send_request("/workspaces/#{params[:id]}", :get, params, options) { |reply| reply.require_object("Workspace") }
|
|
100
102
|
Workspace.new(response.data, options)
|
|
101
103
|
end
|
|
102
104
|
|
|
@@ -109,7 +111,7 @@ module Files
|
|
|
109
111
|
def self.create(params = {}, options = {})
|
|
110
112
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
111
113
|
|
|
112
|
-
response, options = Api.send_request("/workspaces", :post, params, options)
|
|
114
|
+
response, options = Api.send_request("/workspaces", :post, params, options) { |reply| reply.require_object("Workspace") }
|
|
113
115
|
Workspace.new(response.data, options)
|
|
114
116
|
end
|
|
115
117
|
|
|
@@ -122,7 +124,7 @@ module Files
|
|
|
122
124
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
123
125
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
124
126
|
|
|
125
|
-
response, options = Api.send_request("/workspaces/#{params[:id]}", :patch, params, options)
|
|
127
|
+
response, options = Api.send_request("/workspaces/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("Workspace") }
|
|
126
128
|
Workspace.new(response.data, options)
|
|
127
129
|
end
|
|
128
130
|
|
data/lib/files.com/response.rb
CHANGED
|
@@ -21,5 +21,29 @@ module Files
|
|
|
21
21
|
resp.http_status = http_resp.status
|
|
22
22
|
resp
|
|
23
23
|
end
|
|
24
|
+
|
|
25
|
+
# The error for a successful response that is not what its operation
|
|
26
|
+
# promises, such as JSON null where a list belongs. It carries this
|
|
27
|
+
# response for inspection, but its message leaves out the body.
|
|
28
|
+
def unexpected_shape_error(expected)
|
|
29
|
+
error = APIConnectionError.new("The Files.com API returned something other than #{expected} (HTTP response code was #{http_status})",
|
|
30
|
+
http_status: http_status, http_headers: http_headers, http_body: http_body
|
|
31
|
+
)
|
|
32
|
+
error.response = self
|
|
33
|
+
error
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Raises unexpected_shape_error unless the body is a JSON object, as an
|
|
37
|
+
# operation that returns one +model+ promises.
|
|
38
|
+
def require_object(model)
|
|
39
|
+
raise unexpected_shape_error("a #{model} object") unless data.is_a?(Hash)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Raises unexpected_shape_error unless the body is a JSON list of objects,
|
|
43
|
+
# as an operation that returns +model+ records promises. An empty list is
|
|
44
|
+
# fine.
|
|
45
|
+
def require_list(model)
|
|
46
|
+
raise unexpected_shape_error("a list of #{model} objects") unless data.is_a?(Array) && data.all?(Hash)
|
|
47
|
+
end
|
|
24
48
|
end
|
|
25
49
|
end
|
data/lib/files.com/sizable_io.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require "English"
|
|
2
|
+
|
|
1
3
|
module Files
|
|
2
4
|
class SizableIO < IO
|
|
3
5
|
def self.pipe
|
|
@@ -27,25 +29,77 @@ module Files
|
|
|
27
29
|
read_io.ready_promise.execute
|
|
28
30
|
end
|
|
29
31
|
|
|
32
|
+
# Closing always releases the pipe. A reader then raises a download failure
|
|
33
|
+
# that no read has reported, so a caller using IO.copy_stream or another
|
|
34
|
+
# native read cannot mistake a failed download for a finished one. It never
|
|
35
|
+
# raises over an exception that is already propagating, and a failure that
|
|
36
|
+
# starts after the caller chose to close, such as the download no longer
|
|
37
|
+
# being able to write to the pipe, is not reported. Only the reader raises;
|
|
38
|
+
# the writer's close is the producer's cleanup.
|
|
30
39
|
def close
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
unreported_failure = with_error if read_io? && !failure_reported
|
|
33
41
|
super
|
|
34
42
|
read_io.content_length_promise.try_set(nil)
|
|
35
43
|
read_io.ready_promise.try_set(true)
|
|
44
|
+
report_failure(unreported_failure) if unreported_failure && $ERROR_INFO.nil?
|
|
36
45
|
end
|
|
37
46
|
|
|
38
47
|
def error!
|
|
39
|
-
|
|
48
|
+
report_failure(read_io.with_error) if read_io.with_error
|
|
40
49
|
end
|
|
41
50
|
|
|
42
51
|
def do_set_error(e)
|
|
43
52
|
read_io.with_error = e
|
|
44
53
|
end
|
|
45
54
|
|
|
55
|
+
# A failed download reaches the reader as an ordinary end of file, so these
|
|
56
|
+
# reads and eof? raise the download's failure instead, no later than they
|
|
57
|
+
# reach the end.
|
|
58
|
+
def read(...)
|
|
59
|
+
data = super(...)
|
|
60
|
+
error!
|
|
61
|
+
data
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def gets(...)
|
|
65
|
+
line = super(...)
|
|
66
|
+
error!
|
|
67
|
+
line
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def readline(...)
|
|
71
|
+
super(...)
|
|
72
|
+
rescue EOFError
|
|
73
|
+
error!
|
|
74
|
+
raise
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def readpartial(...)
|
|
78
|
+
super(...)
|
|
79
|
+
rescue EOFError
|
|
80
|
+
error!
|
|
81
|
+
raise
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def each_line(...)
|
|
85
|
+
return enum_for(:each_line, ...) unless block_given?
|
|
86
|
+
|
|
87
|
+
super(...)
|
|
88
|
+
error!
|
|
89
|
+
self
|
|
90
|
+
end
|
|
91
|
+
alias each each_line
|
|
92
|
+
|
|
93
|
+
def eof?
|
|
94
|
+
at_end = super
|
|
95
|
+
error! if at_end
|
|
96
|
+
at_end
|
|
97
|
+
end
|
|
98
|
+
alias eof eof?
|
|
99
|
+
|
|
46
100
|
protected
|
|
47
101
|
|
|
48
|
-
attr_accessor :content_length, :with_error
|
|
102
|
+
attr_accessor :content_length, :with_error, :failure_reported
|
|
49
103
|
|
|
50
104
|
def content_length_promise
|
|
51
105
|
@content_length_promise ||= Concurrent::Promise.new { content_length }
|
|
@@ -62,5 +116,12 @@ module Files
|
|
|
62
116
|
def read_io?
|
|
63
117
|
read_io == self
|
|
64
118
|
end
|
|
119
|
+
|
|
120
|
+
private
|
|
121
|
+
|
|
122
|
+
def report_failure(failure)
|
|
123
|
+
read_io.failure_reported = true
|
|
124
|
+
raise failure
|
|
125
|
+
end
|
|
65
126
|
end
|
|
66
127
|
end
|
data/lib/files.com/version.rb
CHANGED