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
|
@@ -1106,15 +1106,20 @@ module Files
|
|
|
1106
1106
|
# with_priority_color - boolean - Include file priority color information?
|
|
1107
1107
|
# with_direct_connection_info - boolean - Include optional direct connection information for a direct Agent transfer attempt?
|
|
1108
1108
|
def download(params = {})
|
|
1109
|
-
params
|
|
1109
|
+
params = (params || {}).dup
|
|
1110
1110
|
params[:path] = @attributes[:path]
|
|
1111
1111
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1112
1112
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1113
1113
|
raise InvalidParameterError.new("Bad parameter: action must be an String") if !params[:action].nil? and !params[:action].is_a?(String)
|
|
1114
1114
|
raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if !params[:preview_size].nil? and !params[:preview_size].is_a?(String)
|
|
1115
|
+
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) }
|
|
1116
|
+
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) }
|
|
1117
|
+
raise InvalidParameterError.new("Bad parameter: with_direct_connection_info must be a single value, not #{params[:with_direct_connection_info].class}") if [ Array, Hash ].any? { |klass| params[:with_direct_connection_info].is_a?(klass) }
|
|
1115
1118
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1116
1119
|
|
|
1117
|
-
Api.send_request("/files/#{@attributes[:path]}", :get, params, @options)
|
|
1120
|
+
response, options = Api.send_request("/files/#{@attributes[:path]}", :get, params, @options)
|
|
1121
|
+
@options = @options.merge(options)
|
|
1122
|
+
[ response, options ]
|
|
1118
1123
|
end
|
|
1119
1124
|
|
|
1120
1125
|
# Parameters:
|
|
@@ -1122,16 +1127,18 @@ module Files
|
|
|
1122
1127
|
# provided_mtime - string - Modified time of file.
|
|
1123
1128
|
# priority_color - string - Priority/Bookmark color of file.
|
|
1124
1129
|
def update(params = {})
|
|
1125
|
-
params
|
|
1130
|
+
params = (params || {}).dup
|
|
1126
1131
|
params[:path] = @attributes[:path]
|
|
1127
1132
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1128
1133
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1134
|
+
raise InvalidParameterError.new("Bad parameter: custom_metadata must be an Hash") if !params[:custom_metadata].nil? and !params[:custom_metadata].is_a?(Hash)
|
|
1129
1135
|
raise InvalidParameterError.new("Bad parameter: provided_mtime must be an String") if !params[:provided_mtime].nil? and !params[:provided_mtime].is_a?(String)
|
|
1130
1136
|
raise InvalidParameterError.new("Bad parameter: priority_color must be an String") if !params[:priority_color].nil? and !params[:priority_color].is_a?(String)
|
|
1131
1137
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1132
1138
|
|
|
1133
1139
|
response, options = Api.send_request("/files/#{@attributes[:path]}", :patch, params, @options) { |reply| reply.require_object("File") }
|
|
1134
1140
|
@attributes = response.data
|
|
1141
|
+
@options = @options.merge(options)
|
|
1135
1142
|
[ response, options ]
|
|
1136
1143
|
end
|
|
1137
1144
|
|
|
@@ -1140,13 +1147,16 @@ module Files
|
|
|
1140
1147
|
#
|
|
1141
1148
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
1142
1149
|
def delete(params = {})
|
|
1143
|
-
params
|
|
1150
|
+
params = (params || {}).dup
|
|
1144
1151
|
params[:path] = @attributes[:path]
|
|
1145
1152
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1146
1153
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1154
|
+
raise InvalidParameterError.new("Bad parameter: recursive must be a single value, not #{params[:recursive].class}") if [ Array, Hash ].any? { |klass| params[:recursive].is_a?(klass) }
|
|
1147
1155
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1148
1156
|
|
|
1149
|
-
Api.send_request("/files/#{@attributes[:path]}", :delete, params, @options)
|
|
1157
|
+
response, options = Api.send_request("/files/#{@attributes[:path]}", :delete, params, @options)
|
|
1158
|
+
@options = @options.merge(options)
|
|
1159
|
+
[ response, options ]
|
|
1150
1160
|
end
|
|
1151
1161
|
|
|
1152
1162
|
# Alias for #delete. Returns nil.
|
|
@@ -1157,13 +1167,15 @@ module Files
|
|
|
1157
1167
|
|
|
1158
1168
|
# List the contents of a ZIP file
|
|
1159
1169
|
def zip_list_contents(params = {})
|
|
1160
|
-
params
|
|
1170
|
+
params = (params || {}).dup
|
|
1161
1171
|
params[:path] = @attributes[:path]
|
|
1162
1172
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1163
1173
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1164
1174
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1165
1175
|
|
|
1166
|
-
Api.send_request("/file_actions/zip_list/#{@attributes[:path]}", :get, params, @options)
|
|
1176
|
+
response, options = Api.send_request("/file_actions/zip_list/#{@attributes[:path]}", :get, params, @options)
|
|
1177
|
+
@options = @options.merge(options)
|
|
1178
|
+
[ response, options ]
|
|
1167
1179
|
end
|
|
1168
1180
|
|
|
1169
1181
|
# Delete File/Folder and return its File Action. A pending or processing deletion continues in the background after this returns; check its File Migration for completion. Waiting for the File Migration does not cancel the deletion
|
|
@@ -1171,13 +1183,16 @@ module Files
|
|
|
1171
1183
|
# Parameters:
|
|
1172
1184
|
# recursive - boolean - If true, will recursively delete folders. Otherwise, will error on non-empty folders.
|
|
1173
1185
|
def begin_delete(params = {})
|
|
1174
|
-
params
|
|
1186
|
+
params = (params || {}).dup
|
|
1175
1187
|
params[:path] = @attributes[:path]
|
|
1176
1188
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1177
1189
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1190
|
+
raise InvalidParameterError.new("Bad parameter: recursive must be a single value, not #{params[:recursive].class}") if [ Array, Hash ].any? { |klass| params[:recursive].is_a?(klass) }
|
|
1178
1191
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1179
1192
|
|
|
1180
|
-
Api.send_request("/file_actions/delete/#{@attributes[:path]}", :post, params, @options)
|
|
1193
|
+
response, options = Api.send_request("/file_actions/delete/#{@attributes[:path]}", :post, params, @options)
|
|
1194
|
+
@options = @options.merge(options)
|
|
1195
|
+
[ response, options ]
|
|
1181
1196
|
end
|
|
1182
1197
|
|
|
1183
1198
|
# Copy File/Folder
|
|
@@ -1188,15 +1203,20 @@ module Files
|
|
|
1188
1203
|
# structure - boolean - Copy structure only?
|
|
1189
1204
|
# overwrite - boolean - Overwrite existing file(s) in the destination?
|
|
1190
1205
|
def copy(params = {})
|
|
1191
|
-
params
|
|
1206
|
+
params = (params || {}).dup
|
|
1192
1207
|
params[:path] = @attributes[:path]
|
|
1193
1208
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1194
1209
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1195
1210
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1211
|
+
raise InvalidParameterError.new("Bad parameter: copy_behaviors must be a single value, not #{params[:copy_behaviors].class}") if [ Array, Hash ].any? { |klass| params[:copy_behaviors].is_a?(klass) }
|
|
1212
|
+
raise InvalidParameterError.new("Bad parameter: structure must be a single value, not #{params[:structure].class}") if [ Array, Hash ].any? { |klass| params[:structure].is_a?(klass) }
|
|
1213
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1196
1214
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1197
1215
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1198
1216
|
|
|
1199
|
-
Api.send_request("/file_actions/copy/#{@attributes[:path]}", :post, params, @options)
|
|
1217
|
+
response, options = Api.send_request("/file_actions/copy/#{@attributes[:path]}", :post, params, @options)
|
|
1218
|
+
@options = @options.merge(options)
|
|
1219
|
+
[ response, options ]
|
|
1200
1220
|
end
|
|
1201
1221
|
|
|
1202
1222
|
# Move File/Folder
|
|
@@ -1205,15 +1225,18 @@ module Files
|
|
|
1205
1225
|
# destination (required) - string - Move destination path.
|
|
1206
1226
|
# overwrite - boolean - Overwrite existing file(s) in the destination?
|
|
1207
1227
|
def move(params = {})
|
|
1208
|
-
params
|
|
1228
|
+
params = (params || {}).dup
|
|
1209
1229
|
params[:path] = @attributes[:path]
|
|
1210
1230
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1211
1231
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1212
1232
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1233
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1213
1234
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1214
1235
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1215
1236
|
|
|
1216
|
-
Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
|
|
1237
|
+
response, options = Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
|
|
1238
|
+
@options = @options.merge(options)
|
|
1239
|
+
[ response, options ]
|
|
1217
1240
|
end
|
|
1218
1241
|
|
|
1219
1242
|
# Transform a file and save the output to a destination path
|
|
@@ -1227,7 +1250,7 @@ module Files
|
|
|
1227
1250
|
# height - int64 - Maximum output height for image_convert.
|
|
1228
1251
|
# overwrite - boolean - Overwrite existing file in the destination?
|
|
1229
1252
|
def transform(params = {})
|
|
1230
|
-
params
|
|
1253
|
+
params = (params || {}).dup
|
|
1231
1254
|
params[:path] = @attributes[:path]
|
|
1232
1255
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1233
1256
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
@@ -1237,12 +1260,15 @@ module Files
|
|
|
1237
1260
|
raise InvalidParameterError.new("Bad parameter: script must be an String") if !params[:script].nil? and !params[:script].is_a?(String)
|
|
1238
1261
|
raise InvalidParameterError.new("Bad parameter: width must be an Integer") if !params[:width].nil? and !params[:width].is_a?(Integer)
|
|
1239
1262
|
raise InvalidParameterError.new("Bad parameter: height must be an Integer") if !params[:height].nil? and !params[:height].is_a?(Integer)
|
|
1263
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1240
1264
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1241
1265
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1242
1266
|
raise MissingParameterError.new("Parameter missing: transform_type") if params[:transform_type].nil?
|
|
1243
1267
|
raise MissingParameterError.new("Parameter missing: target_format") if params[:target_format].nil?
|
|
1244
1268
|
|
|
1245
|
-
Api.send_request("/file_actions/transform/#{@attributes[:path]}", :post, params, @options)
|
|
1269
|
+
response, options = Api.send_request("/file_actions/transform/#{@attributes[:path]}", :post, params, @options)
|
|
1270
|
+
@options = @options.merge(options)
|
|
1271
|
+
[ response, options ]
|
|
1246
1272
|
end
|
|
1247
1273
|
|
|
1248
1274
|
# Decrypt a GPG-encrypted file and save it to a destination path
|
|
@@ -1255,17 +1281,22 @@ module Files
|
|
|
1255
1281
|
# ignore_mdc_error - boolean - Ignore errors from the MDC (modification detection code) check.
|
|
1256
1282
|
# overwrite - boolean - Overwrite existing file in the destination?
|
|
1257
1283
|
def gpg_decrypt(params = {})
|
|
1258
|
-
params
|
|
1284
|
+
params = (params || {}).dup
|
|
1259
1285
|
params[:path] = @attributes[:path]
|
|
1260
1286
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1261
1287
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1262
1288
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1263
1289
|
raise InvalidParameterError.new("Bad parameter: gpg_key_ids must be an Array") if !params[:gpg_key_ids].nil? and !params[:gpg_key_ids].is_a?(Array)
|
|
1264
1290
|
raise InvalidParameterError.new("Bad parameter: gpg_key_partner_id must be an Integer") if !params[:gpg_key_partner_id].nil? and !params[:gpg_key_partner_id].is_a?(Integer)
|
|
1291
|
+
raise InvalidParameterError.new("Bad parameter: use_all_private_keys must be a single value, not #{params[:use_all_private_keys].class}") if [ Array, Hash ].any? { |klass| params[:use_all_private_keys].is_a?(klass) }
|
|
1292
|
+
raise InvalidParameterError.new("Bad parameter: ignore_mdc_error must be a single value, not #{params[:ignore_mdc_error].class}") if [ Array, Hash ].any? { |klass| params[:ignore_mdc_error].is_a?(klass) }
|
|
1293
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1265
1294
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1266
1295
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1267
1296
|
|
|
1268
|
-
Api.send_request("/file_actions/gpg_decrypt/#{@attributes[:path]}", :post, params, @options)
|
|
1297
|
+
response, options = Api.send_request("/file_actions/gpg_decrypt/#{@attributes[:path]}", :post, params, @options)
|
|
1298
|
+
@options = @options.merge(options)
|
|
1299
|
+
[ response, options ]
|
|
1269
1300
|
end
|
|
1270
1301
|
|
|
1271
1302
|
# Encrypt a file with GPG and save it to a destination path
|
|
@@ -1278,7 +1309,7 @@ module Files
|
|
|
1278
1309
|
# armor - boolean - Output ASCII-armored encrypted data.
|
|
1279
1310
|
# overwrite - boolean - Overwrite existing file in the destination?
|
|
1280
1311
|
def gpg_encrypt(params = {})
|
|
1281
|
-
params
|
|
1312
|
+
params = (params || {}).dup
|
|
1282
1313
|
params[:path] = @attributes[:path]
|
|
1283
1314
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1284
1315
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
@@ -1286,10 +1317,14 @@ module Files
|
|
|
1286
1317
|
raise InvalidParameterError.new("Bad parameter: gpg_key_ids must be an Array") if !params[:gpg_key_ids].nil? and !params[:gpg_key_ids].is_a?(Array)
|
|
1287
1318
|
raise InvalidParameterError.new("Bad parameter: gpg_key_partner_id must be an Integer") if !params[:gpg_key_partner_id].nil? and !params[:gpg_key_partner_id].is_a?(Integer)
|
|
1288
1319
|
raise InvalidParameterError.new("Bad parameter: signing_key_id must be an Integer") if !params[:signing_key_id].nil? and !params[:signing_key_id].is_a?(Integer)
|
|
1320
|
+
raise InvalidParameterError.new("Bad parameter: armor must be a single value, not #{params[:armor].class}") if [ Array, Hash ].any? { |klass| params[:armor].is_a?(klass) }
|
|
1321
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1289
1322
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1290
1323
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1291
1324
|
|
|
1292
|
-
Api.send_request("/file_actions/gpg_encrypt/#{@attributes[:path]}", :post, params, @options)
|
|
1325
|
+
response, options = Api.send_request("/file_actions/gpg_encrypt/#{@attributes[:path]}", :post, params, @options)
|
|
1326
|
+
@options = @options.merge(options)
|
|
1327
|
+
[ response, options ]
|
|
1293
1328
|
end
|
|
1294
1329
|
|
|
1295
1330
|
# Extract a ZIP file to a destination folder
|
|
@@ -1299,16 +1334,19 @@ module Files
|
|
|
1299
1334
|
# filename - string - Optional single entry filename to extract.
|
|
1300
1335
|
# overwrite - boolean - Overwrite existing files in the destination?
|
|
1301
1336
|
def unzip(params = {})
|
|
1302
|
-
params
|
|
1337
|
+
params = (params || {}).dup
|
|
1303
1338
|
params[:path] = @attributes[:path]
|
|
1304
1339
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1305
1340
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1306
1341
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1307
1342
|
raise InvalidParameterError.new("Bad parameter: filename must be an String") if !params[:filename].nil? and !params[:filename].is_a?(String)
|
|
1343
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1308
1344
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1309
1345
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1310
1346
|
|
|
1311
|
-
Api.send_request("/file_actions/unzip", :post, params, @options)
|
|
1347
|
+
response, options = Api.send_request("/file_actions/unzip", :post, params, @options)
|
|
1348
|
+
@options = @options.merge(options)
|
|
1349
|
+
[ response, options ]
|
|
1312
1350
|
end
|
|
1313
1351
|
|
|
1314
1352
|
# Begin File Upload
|
|
@@ -1324,23 +1362,30 @@ module Files
|
|
|
1324
1362
|
# buffered_upload - boolean - If true, and the path refers to a destination not stored on Files.com (such as a remote server mount), the upload will be uploaded first to Files.com before being sent to the remote server mount. This can allow clients to upload using parallel parts to a remote server destination that does not offer parallel parts support natively.
|
|
1325
1363
|
# with_direct_connection_info - boolean - Include optional direct connection information for a direct Agent transfer attempt?
|
|
1326
1364
|
def begin_upload(params = {})
|
|
1327
|
-
params
|
|
1365
|
+
params = (params || {}).dup
|
|
1328
1366
|
params[:path] = @attributes[:path]
|
|
1329
1367
|
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
|
1330
1368
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1369
|
+
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) }
|
|
1331
1370
|
raise InvalidParameterError.new("Bad parameter: part must be an Integer") if !params[:part].nil? and !params[:part].is_a?(Integer)
|
|
1332
1371
|
raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if !params[:parts].nil? and !params[:parts].is_a?(Integer)
|
|
1333
1372
|
raise InvalidParameterError.new("Bad parameter: ref must be an String") if !params[:ref].nil? and !params[:ref].is_a?(String)
|
|
1334
1373
|
raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if !params[:restart].nil? and !params[:restart].is_a?(Integer)
|
|
1335
1374
|
raise InvalidParameterError.new("Bad parameter: size must be an Integer") if !params[:size].nil? and !params[:size].is_a?(Integer)
|
|
1375
|
+
raise InvalidParameterError.new("Bad parameter: with_rename must be a single value, not #{params[:with_rename].class}") if [ Array, Hash ].any? { |klass| params[:with_rename].is_a?(klass) }
|
|
1376
|
+
raise InvalidParameterError.new("Bad parameter: buffered_upload must be a single value, not #{params[:buffered_upload].class}") if [ Array, Hash ].any? { |klass| params[:buffered_upload].is_a?(klass) }
|
|
1377
|
+
raise InvalidParameterError.new("Bad parameter: with_direct_connection_info must be a single value, not #{params[:with_direct_connection_info].class}") if [ Array, Hash ].any? { |klass| params[:with_direct_connection_info].is_a?(klass) }
|
|
1336
1378
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1337
1379
|
|
|
1338
|
-
Api.send_request("/file_actions/begin_upload/#{@attributes[:path]}", :post, params, @options)
|
|
1380
|
+
response, options = Api.send_request("/file_actions/begin_upload/#{@attributes[:path]}", :post, params, @options)
|
|
1381
|
+
@options = @options.merge(options)
|
|
1382
|
+
[ response, options ]
|
|
1339
1383
|
end
|
|
1340
1384
|
|
|
1341
1385
|
def save
|
|
1342
1386
|
new_obj = File.create(path, @attributes, @options)
|
|
1343
1387
|
@attributes = new_obj.attributes
|
|
1388
|
+
@options = @options.merge(new_obj.options)
|
|
1344
1389
|
true
|
|
1345
1390
|
end
|
|
1346
1391
|
|
|
@@ -1358,11 +1403,14 @@ module Files
|
|
|
1358
1403
|
#
|
|
1359
1404
|
# Returns a Files::File.
|
|
1360
1405
|
def self.download(path, params = {}, options = {})
|
|
1361
|
-
params
|
|
1406
|
+
params = (params || {}).dup
|
|
1362
1407
|
params[:path] = path
|
|
1363
1408
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1364
1409
|
raise InvalidParameterError.new("Bad parameter: action must be an String") if !params[:action].nil? and !params[:action].is_a?(String)
|
|
1365
1410
|
raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if !params[:preview_size].nil? and !params[:preview_size].is_a?(String)
|
|
1411
|
+
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) }
|
|
1412
|
+
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) }
|
|
1413
|
+
raise InvalidParameterError.new("Bad parameter: with_direct_connection_info must be a single value, not #{params[:with_direct_connection_info].class}") if [ Array, Hash ].any? { |klass| params[:with_direct_connection_info].is_a?(klass) }
|
|
1366
1414
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1367
1415
|
|
|
1368
1416
|
response, options = Api.send_request("/files/#{params[:path]}", :get, params, options) { |reply| reply.require_object("File") }
|
|
@@ -1394,19 +1442,24 @@ module Files
|
|
|
1394
1442
|
#
|
|
1395
1443
|
# Returns a Files::File.
|
|
1396
1444
|
def self.create(path, params = {}, options = {})
|
|
1397
|
-
params
|
|
1445
|
+
params = (params || {}).dup
|
|
1398
1446
|
params[:path] = path
|
|
1399
1447
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1400
1448
|
raise InvalidParameterError.new("Bad parameter: action must be an String") if !params[:action].nil? and !params[:action].is_a?(String)
|
|
1401
1449
|
raise InvalidParameterError.new("Bad parameter: custom_metadata must be an Hash") if !params[:custom_metadata].nil? and !params[:custom_metadata].is_a?(Hash)
|
|
1402
1450
|
raise InvalidParameterError.new("Bad parameter: length must be an Integer") if !params[:length].nil? and !params[:length].is_a?(Integer)
|
|
1451
|
+
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) }
|
|
1403
1452
|
raise InvalidParameterError.new("Bad parameter: part must be an Integer") if !params[:part].nil? and !params[:part].is_a?(Integer)
|
|
1404
1453
|
raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if !params[:parts].nil? and !params[:parts].is_a?(Integer)
|
|
1405
1454
|
raise InvalidParameterError.new("Bad parameter: provided_mtime must be an String") if !params[:provided_mtime].nil? and !params[:provided_mtime].is_a?(String)
|
|
1406
1455
|
raise InvalidParameterError.new("Bad parameter: ref must be an String") if !params[:ref].nil? and !params[:ref].is_a?(String)
|
|
1407
1456
|
raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if !params[:restart].nil? and !params[:restart].is_a?(Integer)
|
|
1408
1457
|
raise InvalidParameterError.new("Bad parameter: size must be an Integer") if !params[:size].nil? and !params[:size].is_a?(Integer)
|
|
1458
|
+
raise InvalidParameterError.new("Bad parameter: copy_behaviors must be a single value, not #{params[:copy_behaviors].class}") if [ Array, Hash ].any? { |klass| params[:copy_behaviors].is_a?(klass) }
|
|
1409
1459
|
raise InvalidParameterError.new("Bad parameter: structure must be an String") if !params[:structure].nil? and !params[:structure].is_a?(String)
|
|
1460
|
+
raise InvalidParameterError.new("Bad parameter: with_rename must be a single value, not #{params[:with_rename].class}") if [ Array, Hash ].any? { |klass| params[:with_rename].is_a?(klass) }
|
|
1461
|
+
raise InvalidParameterError.new("Bad parameter: buffered_upload must be a single value, not #{params[:buffered_upload].class}") if [ Array, Hash ].any? { |klass| params[:buffered_upload].is_a?(klass) }
|
|
1462
|
+
raise InvalidParameterError.new("Bad parameter: with_direct_connection_info must be a single value, not #{params[:with_direct_connection_info].class}") if [ Array, Hash ].any? { |klass| params[:with_direct_connection_info].is_a?(klass) }
|
|
1410
1463
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1411
1464
|
|
|
1412
1465
|
response, options = Api.send_request("/files/#{params[:path]}", :post, params, options) { |reply| reply.require_object("File") }
|
|
@@ -1423,7 +1476,7 @@ module Files
|
|
|
1423
1476
|
#
|
|
1424
1477
|
# Returns a Files::File.
|
|
1425
1478
|
def self.update(path, params = {}, options = {})
|
|
1426
|
-
params
|
|
1479
|
+
params = (params || {}).dup
|
|
1427
1480
|
params[:path] = path
|
|
1428
1481
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1429
1482
|
raise InvalidParameterError.new("Bad parameter: custom_metadata must be an Hash") if !params[:custom_metadata].nil? and !params[:custom_metadata].is_a?(Hash)
|
|
@@ -1443,9 +1496,10 @@ module Files
|
|
|
1443
1496
|
#
|
|
1444
1497
|
# Returns nil.
|
|
1445
1498
|
def self.delete(path, params = {}, options = {})
|
|
1446
|
-
params
|
|
1499
|
+
params = (params || {}).dup
|
|
1447
1500
|
params[:path] = path
|
|
1448
1501
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1502
|
+
raise InvalidParameterError.new("Bad parameter: recursive must be a single value, not #{params[:recursive].class}") if [ Array, Hash ].any? { |klass| params[:recursive].is_a?(klass) }
|
|
1449
1503
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1450
1504
|
|
|
1451
1505
|
Api.send_request("/files/#{params[:path]}", :delete, params, options)
|
|
@@ -1469,10 +1523,12 @@ module Files
|
|
|
1469
1523
|
#
|
|
1470
1524
|
# Returns a Files::File.
|
|
1471
1525
|
def self.find(path, params = {}, options = {})
|
|
1472
|
-
params
|
|
1526
|
+
params = (params || {}).dup
|
|
1473
1527
|
params[:path] = path
|
|
1474
1528
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1475
1529
|
raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if !params[:preview_size].nil? and !params[:preview_size].is_a?(String)
|
|
1530
|
+
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) }
|
|
1531
|
+
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) }
|
|
1476
1532
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1477
1533
|
|
|
1478
1534
|
response, options = Api.send_request("/file_actions/metadata/#{params[:path]}", :get, params, options) { |reply| reply.require_object("File") }
|
|
@@ -1490,7 +1546,7 @@ module Files
|
|
|
1490
1546
|
#
|
|
1491
1547
|
# Returns an Array of Files::ZipListEntry objects.
|
|
1492
1548
|
def self.zip_list_contents(path, params = {}, options = {})
|
|
1493
|
-
params
|
|
1549
|
+
params = (params || {}).dup
|
|
1494
1550
|
params[:path] = path
|
|
1495
1551
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1496
1552
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
@@ -1511,9 +1567,10 @@ module Files
|
|
|
1511
1567
|
#
|
|
1512
1568
|
# Returns a Files::FileAction.
|
|
1513
1569
|
def self.begin_delete(path, params = {}, options = {})
|
|
1514
|
-
params
|
|
1570
|
+
params = (params || {}).dup
|
|
1515
1571
|
params[:path] = path
|
|
1516
1572
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1573
|
+
raise InvalidParameterError.new("Bad parameter: recursive must be a single value, not #{params[:recursive].class}") if [ Array, Hash ].any? { |klass| params[:recursive].is_a?(klass) }
|
|
1517
1574
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1518
1575
|
|
|
1519
1576
|
response, options = Api.send_request("/file_actions/delete/#{params[:path]}", :post, params, options) { |reply| reply.require_object("FileAction") }
|
|
@@ -1533,10 +1590,13 @@ module Files
|
|
|
1533
1590
|
#
|
|
1534
1591
|
# Returns a Files::FileAction.
|
|
1535
1592
|
def self.copy(path, params = {}, options = {})
|
|
1536
|
-
params
|
|
1593
|
+
params = (params || {}).dup
|
|
1537
1594
|
params[:path] = path
|
|
1538
1595
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1539
1596
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1597
|
+
raise InvalidParameterError.new("Bad parameter: copy_behaviors must be a single value, not #{params[:copy_behaviors].class}") if [ Array, Hash ].any? { |klass| params[:copy_behaviors].is_a?(klass) }
|
|
1598
|
+
raise InvalidParameterError.new("Bad parameter: structure must be a single value, not #{params[:structure].class}") if [ Array, Hash ].any? { |klass| params[:structure].is_a?(klass) }
|
|
1599
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1540
1600
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1541
1601
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1542
1602
|
|
|
@@ -1555,10 +1615,11 @@ module Files
|
|
|
1555
1615
|
#
|
|
1556
1616
|
# Returns a Files::FileAction.
|
|
1557
1617
|
def self.move(path, params = {}, options = {})
|
|
1558
|
-
params
|
|
1618
|
+
params = (params || {}).dup
|
|
1559
1619
|
params[:path] = path
|
|
1560
1620
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1561
1621
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1622
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1562
1623
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1563
1624
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1564
1625
|
|
|
@@ -1582,7 +1643,7 @@ module Files
|
|
|
1582
1643
|
#
|
|
1583
1644
|
# Returns a Files::FileAction.
|
|
1584
1645
|
def self.transform(path, params = {}, options = {})
|
|
1585
|
-
params
|
|
1646
|
+
params = (params || {}).dup
|
|
1586
1647
|
params[:path] = path
|
|
1587
1648
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1588
1649
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
@@ -1591,6 +1652,7 @@ module Files
|
|
|
1591
1652
|
raise InvalidParameterError.new("Bad parameter: script must be an String") if !params[:script].nil? and !params[:script].is_a?(String)
|
|
1592
1653
|
raise InvalidParameterError.new("Bad parameter: width must be an Integer") if !params[:width].nil? and !params[:width].is_a?(Integer)
|
|
1593
1654
|
raise InvalidParameterError.new("Bad parameter: height must be an Integer") if !params[:height].nil? and !params[:height].is_a?(Integer)
|
|
1655
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1594
1656
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1595
1657
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1596
1658
|
raise MissingParameterError.new("Parameter missing: transform_type") if params[:transform_type].nil?
|
|
@@ -1615,12 +1677,15 @@ module Files
|
|
|
1615
1677
|
#
|
|
1616
1678
|
# Returns a Files::FileAction.
|
|
1617
1679
|
def self.gpg_decrypt(path, params = {}, options = {})
|
|
1618
|
-
params
|
|
1680
|
+
params = (params || {}).dup
|
|
1619
1681
|
params[:path] = path
|
|
1620
1682
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1621
1683
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1622
1684
|
raise InvalidParameterError.new("Bad parameter: gpg_key_ids must be an Array") if !params[:gpg_key_ids].nil? and !params[:gpg_key_ids].is_a?(Array)
|
|
1623
1685
|
raise InvalidParameterError.new("Bad parameter: gpg_key_partner_id must be an Integer") if !params[:gpg_key_partner_id].nil? and !params[:gpg_key_partner_id].is_a?(Integer)
|
|
1686
|
+
raise InvalidParameterError.new("Bad parameter: use_all_private_keys must be a single value, not #{params[:use_all_private_keys].class}") if [ Array, Hash ].any? { |klass| params[:use_all_private_keys].is_a?(klass) }
|
|
1687
|
+
raise InvalidParameterError.new("Bad parameter: ignore_mdc_error must be a single value, not #{params[:ignore_mdc_error].class}") if [ Array, Hash ].any? { |klass| params[:ignore_mdc_error].is_a?(klass) }
|
|
1688
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1624
1689
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1625
1690
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1626
1691
|
|
|
@@ -1643,13 +1708,15 @@ module Files
|
|
|
1643
1708
|
#
|
|
1644
1709
|
# Returns a Files::FileAction.
|
|
1645
1710
|
def self.gpg_encrypt(path, params = {}, options = {})
|
|
1646
|
-
params
|
|
1711
|
+
params = (params || {}).dup
|
|
1647
1712
|
params[:path] = path
|
|
1648
1713
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1649
1714
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1650
1715
|
raise InvalidParameterError.new("Bad parameter: gpg_key_ids must be an Array") if !params[:gpg_key_ids].nil? and !params[:gpg_key_ids].is_a?(Array)
|
|
1651
1716
|
raise InvalidParameterError.new("Bad parameter: gpg_key_partner_id must be an Integer") if !params[:gpg_key_partner_id].nil? and !params[:gpg_key_partner_id].is_a?(Integer)
|
|
1652
1717
|
raise InvalidParameterError.new("Bad parameter: signing_key_id must be an Integer") if !params[:signing_key_id].nil? and !params[:signing_key_id].is_a?(Integer)
|
|
1718
|
+
raise InvalidParameterError.new("Bad parameter: armor must be a single value, not #{params[:armor].class}") if [ Array, Hash ].any? { |klass| params[:armor].is_a?(klass) }
|
|
1719
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1653
1720
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1654
1721
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1655
1722
|
|
|
@@ -1669,11 +1736,12 @@ module Files
|
|
|
1669
1736
|
#
|
|
1670
1737
|
# Returns a Files::FileAction.
|
|
1671
1738
|
def self.unzip(path, params = {}, options = {})
|
|
1672
|
-
params
|
|
1739
|
+
params = (params || {}).dup
|
|
1673
1740
|
params[:path] = path
|
|
1674
1741
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1675
1742
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1676
1743
|
raise InvalidParameterError.new("Bad parameter: filename must be an String") if !params[:filename].nil? and !params[:filename].is_a?(String)
|
|
1744
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1677
1745
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1678
1746
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1679
1747
|
|
|
@@ -1693,6 +1761,7 @@ module Files
|
|
|
1693
1761
|
def self.zip(params = {}, options = {})
|
|
1694
1762
|
raise InvalidParameterError.new("Bad parameter: paths must be an Array") if !params[:paths].nil? and !params[:paths].is_a?(Array)
|
|
1695
1763
|
raise InvalidParameterError.new("Bad parameter: destination must be an String") if !params[:destination].nil? and !params[:destination].is_a?(String)
|
|
1764
|
+
raise InvalidParameterError.new("Bad parameter: overwrite must be a single value, not #{params[:overwrite].class}") if [ Array, Hash ].any? { |klass| params[:overwrite].is_a?(klass) }
|
|
1696
1765
|
raise MissingParameterError.new("Parameter missing: paths") if params[:paths].nil?
|
|
1697
1766
|
raise MissingParameterError.new("Parameter missing: destination") if params[:destination].nil?
|
|
1698
1767
|
|
|
@@ -1718,14 +1787,18 @@ module Files
|
|
|
1718
1787
|
#
|
|
1719
1788
|
# Returns an Array of Files::FileUploadPart objects.
|
|
1720
1789
|
def self.begin_upload(path, params = {}, options = {})
|
|
1721
|
-
params
|
|
1790
|
+
params = (params || {}).dup
|
|
1722
1791
|
params[:path] = path
|
|
1723
1792
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
1793
|
+
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) }
|
|
1724
1794
|
raise InvalidParameterError.new("Bad parameter: part must be an Integer") if !params[:part].nil? and !params[:part].is_a?(Integer)
|
|
1725
1795
|
raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if !params[:parts].nil? and !params[:parts].is_a?(Integer)
|
|
1726
1796
|
raise InvalidParameterError.new("Bad parameter: ref must be an String") if !params[:ref].nil? and !params[:ref].is_a?(String)
|
|
1727
1797
|
raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if !params[:restart].nil? and !params[:restart].is_a?(Integer)
|
|
1728
1798
|
raise InvalidParameterError.new("Bad parameter: size must be an Integer") if !params[:size].nil? and !params[:size].is_a?(Integer)
|
|
1799
|
+
raise InvalidParameterError.new("Bad parameter: with_rename must be a single value, not #{params[:with_rename].class}") if [ Array, Hash ].any? { |klass| params[:with_rename].is_a?(klass) }
|
|
1800
|
+
raise InvalidParameterError.new("Bad parameter: buffered_upload must be a single value, not #{params[:buffered_upload].class}") if [ Array, Hash ].any? { |klass| params[:buffered_upload].is_a?(klass) }
|
|
1801
|
+
raise InvalidParameterError.new("Bad parameter: with_direct_connection_info must be a single value, not #{params[:with_direct_connection_info].class}") if [ Array, Hash ].any? { |klass| params[:with_direct_connection_info].is_a?(klass) }
|
|
1729
1802
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
1730
1803
|
|
|
1731
1804
|
response, options = Api.send_request("/file_actions/begin_upload/#{params[:path]}", :post, params, options) { |reply| reply.require_list("FileUploadPart") }
|
|
@@ -50,7 +50,7 @@ module Files
|
|
|
50
50
|
# Parameters:
|
|
51
51
|
# body (required) - string - Comment body.
|
|
52
52
|
def update(params = {})
|
|
53
|
-
params
|
|
53
|
+
params = (params || {}).dup
|
|
54
54
|
params[:id] = @attributes[:id]
|
|
55
55
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
56
56
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
@@ -60,18 +60,21 @@ module Files
|
|
|
60
60
|
|
|
61
61
|
response, options = Api.send_request("/file_comments/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("FileComment") }
|
|
62
62
|
@attributes = response.data
|
|
63
|
+
@options = @options.merge(options)
|
|
63
64
|
[ response, options ]
|
|
64
65
|
end
|
|
65
66
|
|
|
66
67
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
67
68
|
def delete(params = {})
|
|
68
|
-
params
|
|
69
|
+
params = (params || {}).dup
|
|
69
70
|
params[:id] = @attributes[:id]
|
|
70
71
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
71
72
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
72
73
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
73
74
|
|
|
74
|
-
Api.send_request("/file_comments/#{@attributes[:id]}", :delete, params, @options)
|
|
75
|
+
response, options = Api.send_request("/file_comments/#{@attributes[:id]}", :delete, params, @options)
|
|
76
|
+
@options = @options.merge(options)
|
|
77
|
+
[ response, options ]
|
|
75
78
|
end
|
|
76
79
|
|
|
77
80
|
# Alias for #delete. Returns nil.
|
|
@@ -86,6 +89,7 @@ module Files
|
|
|
86
89
|
else
|
|
87
90
|
new_obj = FileComment.create(@attributes, @options)
|
|
88
91
|
@attributes = new_obj.attributes
|
|
92
|
+
@options = @options.merge(new_obj.options)
|
|
89
93
|
end
|
|
90
94
|
|
|
91
95
|
true
|
|
@@ -101,15 +105,18 @@ module Files
|
|
|
101
105
|
#
|
|
102
106
|
# Returns a Files::List of Files::FileComment objects.
|
|
103
107
|
def self.list_for(path, params = {}, options = {})
|
|
104
|
-
params
|
|
108
|
+
params = (params || {}).dup
|
|
105
109
|
params[:path] = path
|
|
106
110
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if !params[:cursor].nil? and !params[:cursor].is_a?(String)
|
|
107
111
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if !params[:per_page].nil? and !params[:per_page].is_a?(Integer)
|
|
108
112
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if !params[:path].nil? and !params[:path].is_a?(String)
|
|
109
113
|
raise MissingParameterError.new("Parameter missing: path") if params[:path].nil?
|
|
110
114
|
|
|
115
|
+
list_options = options.dup
|
|
111
116
|
List.new(FileComment, params) do |page_params, &check_page|
|
|
112
|
-
Api.send_request("/file_comments/files/#{page_params[:path]}", :get, page_params,
|
|
117
|
+
response, page_options = Api.send_request("/file_comments/files/#{page_params[:path]}", :get, page_params, list_options, &check_page)
|
|
118
|
+
list_options = list_options.merge(page_options)
|
|
119
|
+
[ response, page_options ]
|
|
113
120
|
end
|
|
114
121
|
end
|
|
115
122
|
|
|
@@ -139,7 +146,7 @@ module Files
|
|
|
139
146
|
#
|
|
140
147
|
# Returns a Files::FileComment.
|
|
141
148
|
def self.update(id, params = {}, options = {})
|
|
142
|
-
params
|
|
149
|
+
params = (params || {}).dup
|
|
143
150
|
params[:id] = id
|
|
144
151
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
145
152
|
raise InvalidParameterError.new("Bad parameter: body must be an String") if !params[:body].nil? and !params[:body].is_a?(String)
|
|
@@ -155,7 +162,7 @@ module Files
|
|
|
155
162
|
#
|
|
156
163
|
# Returns nil.
|
|
157
164
|
def self.delete(id, params = {}, options = {})
|
|
158
|
-
params
|
|
165
|
+
params = (params || {}).dup
|
|
159
166
|
params[:id] = id
|
|
160
167
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
161
168
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -49,13 +49,15 @@ module Files
|
|
|
49
49
|
|
|
50
50
|
# Returns the [response, options] pair from Files::Api.send_request.
|
|
51
51
|
def delete(params = {})
|
|
52
|
-
params
|
|
52
|
+
params = (params || {}).dup
|
|
53
53
|
params[:id] = @attributes[:id]
|
|
54
54
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
55
55
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
56
56
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
57
57
|
|
|
58
|
-
Api.send_request("/file_comment_reactions/#{@attributes[:id]}", :delete, params, @options)
|
|
58
|
+
response, options = Api.send_request("/file_comment_reactions/#{@attributes[:id]}", :delete, params, @options)
|
|
59
|
+
@options = @options.merge(options)
|
|
60
|
+
[ response, options ]
|
|
59
61
|
end
|
|
60
62
|
|
|
61
63
|
# Alias for #delete. Returns nil.
|
|
@@ -70,6 +72,7 @@ module Files
|
|
|
70
72
|
else
|
|
71
73
|
new_obj = FileCommentReaction.create(@attributes, @options)
|
|
72
74
|
@attributes = new_obj.attributes
|
|
75
|
+
@options = @options.merge(new_obj.options)
|
|
73
76
|
end
|
|
74
77
|
|
|
75
78
|
true
|
|
@@ -100,7 +103,7 @@ module Files
|
|
|
100
103
|
#
|
|
101
104
|
# Returns nil.
|
|
102
105
|
def self.delete(id, params = {}, options = {})
|
|
103
|
-
params
|
|
106
|
+
params = (params || {}).dup
|
|
104
107
|
params[:id] = id
|
|
105
108
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
106
109
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -69,7 +69,7 @@ module Files
|
|
|
69
69
|
#
|
|
70
70
|
# Returns a Files::FileMigration.
|
|
71
71
|
def self.find(id, params = {}, options = {})
|
|
72
|
-
params
|
|
72
|
+
params = (params || {}).dup
|
|
73
73
|
params[:id] = id
|
|
74
74
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if !params[:id].nil? and !params[:id].is_a?(Integer)
|
|
75
75
|
raise MissingParameterError.new("Parameter missing: id") if params[:id].nil?
|
|
@@ -78,8 +78,11 @@ module Files
|
|
|
78
78
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if !params[:filter_lt].nil? and !params[:filter_lt].is_a?(Hash)
|
|
79
79
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if !params[:filter_lteq].nil? and !params[:filter_lteq].is_a?(Hash)
|
|
80
80
|
|
|
81
|
+
list_options = options.dup
|
|
81
82
|
List.new(FileMigrationLog, params) do |page_params, &check_page|
|
|
82
|
-
Api.send_request("/file_migration_logs", :get, page_params,
|
|
83
|
+
response, page_options = Api.send_request("/file_migration_logs", :get, page_params, list_options, &check_page)
|
|
84
|
+
list_options = list_options.merge(page_options)
|
|
85
|
+
[ response, page_options ]
|
|
83
86
|
end
|
|
84
87
|
end
|
|
85
88
|
|