files.com 1.1.768 → 1.1.770
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +47 -7
- data/_VERSION +1 -1
- data/docs/file.md +37 -0
- 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 +7 -2
- data/lib/files.com/models/action_notification_export.rb +13 -3
- data/lib/files.com/models/action_notification_export_result.rb +7 -2
- data/lib/files.com/models/ai_assistant_personality.rb +34 -8
- data/lib/files.com/models/ai_task.rb +39 -8
- data/lib/files.com/models/api_key.rb +49 -10
- data/lib/files.com/models/api_request_log.rb +7 -2
- data/lib/files.com/models/app.rb +7 -2
- data/lib/files.com/models/as2_incoming_message.rb +7 -2
- data/lib/files.com/models/as2_outgoing_message.rb +7 -2
- data/lib/files.com/models/as2_partner.rb +34 -8
- data/lib/files.com/models/as2_station.rb +34 -8
- data/lib/files.com/models/automation.rb +50 -10
- data/lib/files.com/models/automation_log.rb +7 -2
- data/lib/files.com/models/automation_run.rb +31 -6
- data/lib/files.com/models/bandwidth_snapshot.rb +7 -2
- data/lib/files.com/models/behavior.rb +46 -10
- data/lib/files.com/models/bundle.rb +39 -8
- data/lib/files.com/models/bundle_action.rb +7 -2
- data/lib/files.com/models/bundle_download.rb +7 -2
- data/lib/files.com/models/bundle_notification.rb +34 -8
- data/lib/files.com/models/bundle_recipient.rb +14 -4
- data/lib/files.com/models/bundle_registration.rb +7 -2
- data/lib/files.com/models/chat_session.rb +13 -3
- data/lib/files.com/models/child_site_management_policy.rb +34 -8
- data/lib/files.com/models/clickwrap.rb +34 -8
- data/lib/files.com/models/custom_domain.rb +40 -9
- data/lib/files.com/models/desktop_configuration_profile.rb +34 -8
- data/lib/files.com/models/dns_record.rb +7 -2
- data/lib/files.com/models/email_incoming_message.rb +7 -2
- data/lib/files.com/models/email_log.rb +7 -2
- data/lib/files.com/models/event_channel.rb +34 -8
- data/lib/files.com/models/event_delivery_attempt.rb +13 -3
- data/lib/files.com/models/event_record.rb +13 -3
- data/lib/files.com/models/event_subscription.rb +34 -8
- data/lib/files.com/models/event_target.rb +34 -8
- data/lib/files.com/models/exavault_api_request_log.rb +7 -2
- data/lib/files.com/models/expectation.rb +40 -9
- data/lib/files.com/models/expectation_evaluation.rb +13 -3
- data/lib/files.com/models/expectation_incident.rb +31 -6
- data/lib/files.com/models/external_event.rb +20 -5
- data/lib/files.com/models/file.rb +93 -15
- data/lib/files.com/models/file_comment.rb +28 -7
- data/lib/files.com/models/file_comment_reaction.rb +11 -2
- data/lib/files.com/models/file_migration.rb +6 -1
- data/lib/files.com/models/file_migration_log.rb +7 -2
- data/lib/files.com/models/folder.rb +13 -3
- data/lib/files.com/models/form_field_set.rb +34 -8
- data/lib/files.com/models/ftp_action_log.rb +7 -2
- data/lib/files.com/models/gpg_key.rb +34 -8
- data/lib/files.com/models/group.rb +34 -8
- data/lib/files.com/models/group_user.rb +29 -7
- data/lib/files.com/models/history.rb +35 -10
- data/lib/files.com/models/history_export.rb +13 -3
- data/lib/files.com/models/history_export_result.rb +7 -2
- data/lib/files.com/models/holiday_calendar.rb +34 -8
- data/lib/files.com/models/holiday_region.rb +7 -2
- data/lib/files.com/models/inbound_s3_log.rb +7 -2
- data/lib/files.com/models/inbox_recipient.rb +14 -4
- data/lib/files.com/models/inbox_registration.rb +7 -2
- data/lib/files.com/models/inbox_upload.rb +7 -2
- data/lib/files.com/models/integration_centric_profile.rb +34 -8
- data/lib/files.com/models/invoice.rb +13 -3
- data/lib/files.com/models/ip_address.rb +28 -8
- data/lib/files.com/models/key_lifecycle_rule.rb +34 -8
- data/lib/files.com/models/lock.rb +18 -3
- data/lib/files.com/models/metadata_category.rb +41 -10
- data/lib/files.com/models/notification.rb +34 -8
- data/lib/files.com/models/outbound_connection_log.rb +7 -2
- data/lib/files.com/models/partner.rb +34 -8
- data/lib/files.com/models/partner_channel.rb +34 -8
- data/lib/files.com/models/partner_channel_template.rb +34 -8
- data/lib/files.com/models/partner_site.rb +4 -0
- data/lib/files.com/models/partner_site_request.rb +33 -4
- data/lib/files.com/models/payment.rb +13 -3
- data/lib/files.com/models/pending_work_event.rb +13 -3
- data/lib/files.com/models/permission.rb +18 -4
- data/lib/files.com/models/public_hosting_request_log.rb +7 -2
- data/lib/files.com/models/public_key.rb +34 -8
- data/lib/files.com/models/remote_bandwidth_snapshot.rb +7 -2
- data/lib/files.com/models/remote_mount_backend.rb +39 -8
- data/lib/files.com/models/remote_server.rb +52 -11
- data/lib/files.com/models/remote_server_credential.rb +34 -8
- data/lib/files.com/models/request.rb +25 -6
- data/lib/files.com/models/restore.rb +14 -4
- data/lib/files.com/models/schedule.rb +34 -8
- data/lib/files.com/models/scheduled_export.rb +34 -8
- data/lib/files.com/models/scim_log.rb +13 -3
- data/lib/files.com/models/secret.rb +34 -8
- data/lib/files.com/models/session.rb +11 -2
- data/lib/files.com/models/settings_change.rb +7 -2
- data/lib/files.com/models/sftp_action_log.rb +7 -2
- data/lib/files.com/models/sftp_host_key.rb +34 -8
- data/lib/files.com/models/share_group.rb +34 -8
- data/lib/files.com/models/siem_http_destination.rb +39 -8
- data/lib/files.com/models/siem_http_destination_event.rb +13 -3
- data/lib/files.com/models/site.rb +16 -3
- data/lib/files.com/models/site_subdomain_redirect.rb +17 -3
- data/lib/files.com/models/snapshot.rb +39 -8
- data/lib/files.com/models/sso_event.rb +13 -3
- data/lib/files.com/models/sso_strategy.rb +18 -3
- data/lib/files.com/models/style.rb +20 -5
- data/lib/files.com/models/sync.rb +44 -8
- data/lib/files.com/models/sync_log.rb +7 -2
- data/lib/files.com/models/sync_run.rb +13 -3
- data/lib/files.com/models/usage_daily_snapshot.rb +7 -2
- data/lib/files.com/models/usage_snapshot.rb +7 -2
- data/lib/files.com/models/user.rb +50 -8
- data/lib/files.com/models/user_additional_email_recipient.rb +34 -8
- data/lib/files.com/models/user_cipher_use.rb +7 -2
- data/lib/files.com/models/user_lifecycle_rule.rb +34 -8
- data/lib/files.com/models/user_request.rb +24 -5
- data/lib/files.com/models/user_security_event.rb +13 -3
- data/lib/files.com/models/user_sftp_client_use.rb +7 -2
- data/lib/files.com/models/web_dav_action_log.rb +7 -2
- data/lib/files.com/models/webhook_test.rb +7 -2
- data/lib/files.com/models/workspace.rb +34 -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 +6 -2
|
@@ -108,6 +108,11 @@ module Files
|
|
|
108
108
|
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`, `true_path`, `action_type` or `username`. Valid field combinations are `[ path ]`, `[ true_path ]`, `[ remote_ip ]`, `[ success ]`, `[ status ]`, `[ action_type ]`, `[ username ]`, `[ created_at ]`, `[ path, true_path ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, status ]`, `[ path, action_type ]`, `[ path, username ]`, `[ path, created_at ]`, `[ true_path, remote_ip ]`, `[ true_path, success ]`, `[ true_path, status ]`, `[ true_path, action_type ]`, `[ true_path, username ]`, `[ true_path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, status ]`, `[ remote_ip, action_type ]`, `[ remote_ip, username ]`, `[ remote_ip, created_at ]`, `[ success, status ]`, `[ success, action_type ]`, `[ success, username ]`, `[ success, created_at ]`, `[ status, action_type ]`, `[ status, username ]`, `[ status, created_at ]`, `[ action_type, username ]`, `[ action_type, created_at ]`, `[ username, created_at ]`, `[ path, true_path, remote_ip ]`, `[ path, true_path, success ]`, `[ path, true_path, status ]`, `[ path, true_path, action_type ]`, `[ path, true_path, username ]`, `[ path, true_path, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, status ]`, `[ path, remote_ip, action_type ]`, `[ path, remote_ip, username ]`, `[ path, remote_ip, created_at ]`, `[ path, success, status ]`, `[ path, success, action_type ]`, `[ path, success, username ]`, `[ path, success, created_at ]`, `[ path, status, action_type ]`, `[ path, status, username ]`, `[ path, status, created_at ]`, `[ path, action_type, username ]`, `[ path, action_type, created_at ]`, `[ path, username, created_at ]`, `[ true_path, remote_ip, success ]`, `[ true_path, remote_ip, status ]`, `[ true_path, remote_ip, action_type ]`, `[ true_path, remote_ip, username ]`, `[ true_path, remote_ip, created_at ]`, `[ true_path, success, status ]`, `[ true_path, success, action_type ]`, `[ true_path, success, username ]`, `[ true_path, success, created_at ]`, `[ true_path, status, action_type ]`, `[ true_path, status, username ]`, `[ true_path, status, created_at ]`, `[ true_path, action_type, username ]`, `[ true_path, action_type, created_at ]`, `[ true_path, username, created_at ]`, `[ remote_ip, success, status ]`, `[ remote_ip, success, action_type ]`, `[ remote_ip, success, username ]`, `[ remote_ip, success, created_at ]`, `[ remote_ip, status, action_type ]`, `[ remote_ip, status, username ]`, `[ remote_ip, status, created_at ]`, `[ remote_ip, action_type, username ]`, `[ remote_ip, action_type, created_at ]`, `[ remote_ip, username, created_at ]`, `[ success, status, action_type ]`, `[ success, status, username ]`, `[ success, status, created_at ]`, `[ success, action_type, username ]`, `[ success, action_type, created_at ]`, `[ success, username, created_at ]`, `[ status, action_type, username ]`, `[ status, action_type, created_at ]`, `[ status, username, created_at ]`, `[ action_type, username, created_at ]`, `[ path, true_path, remote_ip, success ]`, `[ path, true_path, remote_ip, status ]`, `[ path, true_path, remote_ip, action_type ]`, `[ path, true_path, remote_ip, username ]`, `[ path, true_path, remote_ip, created_at ]`, `[ path, true_path, success, status ]`, `[ path, true_path, success, action_type ]`, `[ path, true_path, success, username ]`, `[ path, true_path, success, created_at ]`, `[ path, true_path, status, action_type ]`, `[ path, true_path, status, username ]`, `[ path, true_path, status, created_at ]`, `[ path, true_path, action_type, username ]`, `[ path, true_path, action_type, created_at ]`, `[ path, true_path, username, created_at ]`, `[ path, remote_ip, success, status ]`, `[ path, remote_ip, success, action_type ]`, `[ path, remote_ip, success, username ]`, `[ path, remote_ip, success, created_at ]`, `[ path, remote_ip, status, action_type ]`, `[ path, remote_ip, status, username ]`, `[ path, remote_ip, status, created_at ]`, `[ path, remote_ip, action_type, username ]`, `[ path, remote_ip, action_type, created_at ]`, `[ path, remote_ip, username, created_at ]`, `[ path, success, status, action_type ]`, `[ path, success, status, username ]`, `[ path, success, status, created_at ]`, `[ path, success, action_type, username ]`, `[ path, success, action_type, created_at ]`, `[ path, success, username, created_at ]`, `[ path, status, action_type, username ]`, `[ path, status, action_type, created_at ]`, `[ path, status, username, created_at ]`, `[ path, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status ]`, `[ true_path, remote_ip, success, action_type ]`, `[ true_path, remote_ip, success, username ]`, `[ true_path, remote_ip, success, created_at ]`, `[ true_path, remote_ip, status, action_type ]`, `[ true_path, remote_ip, status, username ]`, `[ true_path, remote_ip, status, created_at ]`, `[ true_path, remote_ip, action_type, username ]`, `[ true_path, remote_ip, action_type, created_at ]`, `[ true_path, remote_ip, username, created_at ]`, `[ true_path, success, status, action_type ]`, `[ true_path, success, status, username ]`, `[ true_path, success, status, created_at ]`, `[ true_path, success, action_type, username ]`, `[ true_path, success, action_type, created_at ]`, `[ true_path, success, username, created_at ]`, `[ true_path, status, action_type, username ]`, `[ true_path, status, action_type, created_at ]`, `[ true_path, status, username, created_at ]`, `[ true_path, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type ]`, `[ remote_ip, success, status, username ]`, `[ remote_ip, success, status, created_at ]`, `[ remote_ip, success, action_type, username ]`, `[ remote_ip, success, action_type, created_at ]`, `[ remote_ip, success, username, created_at ]`, `[ remote_ip, status, action_type, username ]`, `[ remote_ip, status, action_type, created_at ]`, `[ remote_ip, status, username, created_at ]`, `[ remote_ip, action_type, username, created_at ]`, `[ success, status, action_type, username ]`, `[ success, status, action_type, created_at ]`, `[ success, status, username, created_at ]`, `[ success, action_type, username, created_at ]`, `[ status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status ]`, `[ path, true_path, remote_ip, success, action_type ]`, `[ path, true_path, remote_ip, success, username ]`, `[ path, true_path, remote_ip, success, created_at ]`, `[ path, true_path, remote_ip, status, action_type ]`, `[ path, true_path, remote_ip, status, username ]`, `[ path, true_path, remote_ip, status, created_at ]`, `[ path, true_path, remote_ip, action_type, username ]`, `[ path, true_path, remote_ip, action_type, created_at ]`, `[ path, true_path, remote_ip, username, created_at ]`, `[ path, true_path, success, status, action_type ]`, `[ path, true_path, success, status, username ]`, `[ path, true_path, success, status, created_at ]`, `[ path, true_path, success, action_type, username ]`, `[ path, true_path, success, action_type, created_at ]`, `[ path, true_path, success, username, created_at ]`, `[ path, true_path, status, action_type, username ]`, `[ path, true_path, status, action_type, created_at ]`, `[ path, true_path, status, username, created_at ]`, `[ path, true_path, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type ]`, `[ path, remote_ip, success, status, username ]`, `[ path, remote_ip, success, status, created_at ]`, `[ path, remote_ip, success, action_type, username ]`, `[ path, remote_ip, success, action_type, created_at ]`, `[ path, remote_ip, success, username, created_at ]`, `[ path, remote_ip, status, action_type, username ]`, `[ path, remote_ip, status, action_type, created_at ]`, `[ path, remote_ip, status, username, created_at ]`, `[ path, remote_ip, action_type, username, created_at ]`, `[ path, success, status, action_type, username ]`, `[ path, success, status, action_type, created_at ]`, `[ path, success, status, username, created_at ]`, `[ path, success, action_type, username, created_at ]`, `[ path, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type ]`, `[ true_path, remote_ip, success, status, username ]`, `[ true_path, remote_ip, success, status, created_at ]`, `[ true_path, remote_ip, success, action_type, username ]`, `[ true_path, remote_ip, success, action_type, created_at ]`, `[ true_path, remote_ip, success, username, created_at ]`, `[ true_path, remote_ip, status, action_type, username ]`, `[ true_path, remote_ip, status, action_type, created_at ]`, `[ true_path, remote_ip, status, username, created_at ]`, `[ true_path, remote_ip, action_type, username, created_at ]`, `[ true_path, success, status, action_type, username ]`, `[ true_path, success, status, action_type, created_at ]`, `[ true_path, success, status, username, created_at ]`, `[ true_path, success, action_type, username, created_at ]`, `[ true_path, status, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type, username ]`, `[ remote_ip, success, status, action_type, created_at ]`, `[ remote_ip, success, status, username, created_at ]`, `[ remote_ip, success, action_type, username, created_at ]`, `[ remote_ip, status, action_type, username, created_at ]`, `[ success, status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status, action_type ]`, `[ path, true_path, remote_ip, success, status, username ]`, `[ path, true_path, remote_ip, success, status, created_at ]`, `[ path, true_path, remote_ip, success, action_type, username ]`, `[ path, true_path, remote_ip, success, action_type, created_at ]`, `[ path, true_path, remote_ip, success, username, created_at ]`, `[ path, true_path, remote_ip, status, action_type, username ]`, `[ path, true_path, remote_ip, status, action_type, created_at ]`, `[ path, true_path, remote_ip, status, username, created_at ]`, `[ path, true_path, remote_ip, action_type, username, created_at ]`, `[ path, true_path, success, status, action_type, username ]`, `[ path, true_path, success, status, action_type, created_at ]`, `[ path, true_path, success, status, username, created_at ]`, `[ path, true_path, success, action_type, username, created_at ]`, `[ path, true_path, status, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type, username ]`, `[ path, remote_ip, success, status, action_type, created_at ]`, `[ path, remote_ip, success, status, username, created_at ]`, `[ path, remote_ip, success, action_type, username, created_at ]`, `[ path, remote_ip, status, action_type, username, created_at ]`, `[ path, success, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type, username ]`, `[ true_path, remote_ip, success, status, action_type, created_at ]`, `[ true_path, remote_ip, success, status, username, created_at ]`, `[ true_path, remote_ip, success, action_type, username, created_at ]`, `[ true_path, remote_ip, status, action_type, username, created_at ]`, `[ true_path, success, status, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status, action_type, username ]`, `[ path, true_path, remote_ip, success, status, action_type, created_at ]`, `[ path, true_path, remote_ip, success, status, username, created_at ]`, `[ path, true_path, remote_ip, success, action_type, username, created_at ]`, `[ path, true_path, remote_ip, status, action_type, username, created_at ]`, `[ path, true_path, success, status, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type, username, created_at ]` or `[ path, true_path, remote_ip, success, status, action_type, username, created_at ]`.
|
|
109
109
|
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ path ]`, `[ true_path ]`, `[ remote_ip ]`, `[ success ]`, `[ status ]`, `[ action_type ]`, `[ username ]`, `[ created_at ]`, `[ path, true_path ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, status ]`, `[ path, action_type ]`, `[ path, username ]`, `[ path, created_at ]`, `[ true_path, remote_ip ]`, `[ true_path, success ]`, `[ true_path, status ]`, `[ true_path, action_type ]`, `[ true_path, username ]`, `[ true_path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, status ]`, `[ remote_ip, action_type ]`, `[ remote_ip, username ]`, `[ remote_ip, created_at ]`, `[ success, status ]`, `[ success, action_type ]`, `[ success, username ]`, `[ success, created_at ]`, `[ status, action_type ]`, `[ status, username ]`, `[ status, created_at ]`, `[ action_type, username ]`, `[ action_type, created_at ]`, `[ username, created_at ]`, `[ path, true_path, remote_ip ]`, `[ path, true_path, success ]`, `[ path, true_path, status ]`, `[ path, true_path, action_type ]`, `[ path, true_path, username ]`, `[ path, true_path, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, status ]`, `[ path, remote_ip, action_type ]`, `[ path, remote_ip, username ]`, `[ path, remote_ip, created_at ]`, `[ path, success, status ]`, `[ path, success, action_type ]`, `[ path, success, username ]`, `[ path, success, created_at ]`, `[ path, status, action_type ]`, `[ path, status, username ]`, `[ path, status, created_at ]`, `[ path, action_type, username ]`, `[ path, action_type, created_at ]`, `[ path, username, created_at ]`, `[ true_path, remote_ip, success ]`, `[ true_path, remote_ip, status ]`, `[ true_path, remote_ip, action_type ]`, `[ true_path, remote_ip, username ]`, `[ true_path, remote_ip, created_at ]`, `[ true_path, success, status ]`, `[ true_path, success, action_type ]`, `[ true_path, success, username ]`, `[ true_path, success, created_at ]`, `[ true_path, status, action_type ]`, `[ true_path, status, username ]`, `[ true_path, status, created_at ]`, `[ true_path, action_type, username ]`, `[ true_path, action_type, created_at ]`, `[ true_path, username, created_at ]`, `[ remote_ip, success, status ]`, `[ remote_ip, success, action_type ]`, `[ remote_ip, success, username ]`, `[ remote_ip, success, created_at ]`, `[ remote_ip, status, action_type ]`, `[ remote_ip, status, username ]`, `[ remote_ip, status, created_at ]`, `[ remote_ip, action_type, username ]`, `[ remote_ip, action_type, created_at ]`, `[ remote_ip, username, created_at ]`, `[ success, status, action_type ]`, `[ success, status, username ]`, `[ success, status, created_at ]`, `[ success, action_type, username ]`, `[ success, action_type, created_at ]`, `[ success, username, created_at ]`, `[ status, action_type, username ]`, `[ status, action_type, created_at ]`, `[ status, username, created_at ]`, `[ action_type, username, created_at ]`, `[ path, true_path, remote_ip, success ]`, `[ path, true_path, remote_ip, status ]`, `[ path, true_path, remote_ip, action_type ]`, `[ path, true_path, remote_ip, username ]`, `[ path, true_path, remote_ip, created_at ]`, `[ path, true_path, success, status ]`, `[ path, true_path, success, action_type ]`, `[ path, true_path, success, username ]`, `[ path, true_path, success, created_at ]`, `[ path, true_path, status, action_type ]`, `[ path, true_path, status, username ]`, `[ path, true_path, status, created_at ]`, `[ path, true_path, action_type, username ]`, `[ path, true_path, action_type, created_at ]`, `[ path, true_path, username, created_at ]`, `[ path, remote_ip, success, status ]`, `[ path, remote_ip, success, action_type ]`, `[ path, remote_ip, success, username ]`, `[ path, remote_ip, success, created_at ]`, `[ path, remote_ip, status, action_type ]`, `[ path, remote_ip, status, username ]`, `[ path, remote_ip, status, created_at ]`, `[ path, remote_ip, action_type, username ]`, `[ path, remote_ip, action_type, created_at ]`, `[ path, remote_ip, username, created_at ]`, `[ path, success, status, action_type ]`, `[ path, success, status, username ]`, `[ path, success, status, created_at ]`, `[ path, success, action_type, username ]`, `[ path, success, action_type, created_at ]`, `[ path, success, username, created_at ]`, `[ path, status, action_type, username ]`, `[ path, status, action_type, created_at ]`, `[ path, status, username, created_at ]`, `[ path, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status ]`, `[ true_path, remote_ip, success, action_type ]`, `[ true_path, remote_ip, success, username ]`, `[ true_path, remote_ip, success, created_at ]`, `[ true_path, remote_ip, status, action_type ]`, `[ true_path, remote_ip, status, username ]`, `[ true_path, remote_ip, status, created_at ]`, `[ true_path, remote_ip, action_type, username ]`, `[ true_path, remote_ip, action_type, created_at ]`, `[ true_path, remote_ip, username, created_at ]`, `[ true_path, success, status, action_type ]`, `[ true_path, success, status, username ]`, `[ true_path, success, status, created_at ]`, `[ true_path, success, action_type, username ]`, `[ true_path, success, action_type, created_at ]`, `[ true_path, success, username, created_at ]`, `[ true_path, status, action_type, username ]`, `[ true_path, status, action_type, created_at ]`, `[ true_path, status, username, created_at ]`, `[ true_path, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type ]`, `[ remote_ip, success, status, username ]`, `[ remote_ip, success, status, created_at ]`, `[ remote_ip, success, action_type, username ]`, `[ remote_ip, success, action_type, created_at ]`, `[ remote_ip, success, username, created_at ]`, `[ remote_ip, status, action_type, username ]`, `[ remote_ip, status, action_type, created_at ]`, `[ remote_ip, status, username, created_at ]`, `[ remote_ip, action_type, username, created_at ]`, `[ success, status, action_type, username ]`, `[ success, status, action_type, created_at ]`, `[ success, status, username, created_at ]`, `[ success, action_type, username, created_at ]`, `[ status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status ]`, `[ path, true_path, remote_ip, success, action_type ]`, `[ path, true_path, remote_ip, success, username ]`, `[ path, true_path, remote_ip, success, created_at ]`, `[ path, true_path, remote_ip, status, action_type ]`, `[ path, true_path, remote_ip, status, username ]`, `[ path, true_path, remote_ip, status, created_at ]`, `[ path, true_path, remote_ip, action_type, username ]`, `[ path, true_path, remote_ip, action_type, created_at ]`, `[ path, true_path, remote_ip, username, created_at ]`, `[ path, true_path, success, status, action_type ]`, `[ path, true_path, success, status, username ]`, `[ path, true_path, success, status, created_at ]`, `[ path, true_path, success, action_type, username ]`, `[ path, true_path, success, action_type, created_at ]`, `[ path, true_path, success, username, created_at ]`, `[ path, true_path, status, action_type, username ]`, `[ path, true_path, status, action_type, created_at ]`, `[ path, true_path, status, username, created_at ]`, `[ path, true_path, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type ]`, `[ path, remote_ip, success, status, username ]`, `[ path, remote_ip, success, status, created_at ]`, `[ path, remote_ip, success, action_type, username ]`, `[ path, remote_ip, success, action_type, created_at ]`, `[ path, remote_ip, success, username, created_at ]`, `[ path, remote_ip, status, action_type, username ]`, `[ path, remote_ip, status, action_type, created_at ]`, `[ path, remote_ip, status, username, created_at ]`, `[ path, remote_ip, action_type, username, created_at ]`, `[ path, success, status, action_type, username ]`, `[ path, success, status, action_type, created_at ]`, `[ path, success, status, username, created_at ]`, `[ path, success, action_type, username, created_at ]`, `[ path, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type ]`, `[ true_path, remote_ip, success, status, username ]`, `[ true_path, remote_ip, success, status, created_at ]`, `[ true_path, remote_ip, success, action_type, username ]`, `[ true_path, remote_ip, success, action_type, created_at ]`, `[ true_path, remote_ip, success, username, created_at ]`, `[ true_path, remote_ip, status, action_type, username ]`, `[ true_path, remote_ip, status, action_type, created_at ]`, `[ true_path, remote_ip, status, username, created_at ]`, `[ true_path, remote_ip, action_type, username, created_at ]`, `[ true_path, success, status, action_type, username ]`, `[ true_path, success, status, action_type, created_at ]`, `[ true_path, success, status, username, created_at ]`, `[ true_path, success, action_type, username, created_at ]`, `[ true_path, status, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type, username ]`, `[ remote_ip, success, status, action_type, created_at ]`, `[ remote_ip, success, status, username, created_at ]`, `[ remote_ip, success, action_type, username, created_at ]`, `[ remote_ip, status, action_type, username, created_at ]`, `[ success, status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status, action_type ]`, `[ path, true_path, remote_ip, success, status, username ]`, `[ path, true_path, remote_ip, success, status, created_at ]`, `[ path, true_path, remote_ip, success, action_type, username ]`, `[ path, true_path, remote_ip, success, action_type, created_at ]`, `[ path, true_path, remote_ip, success, username, created_at ]`, `[ path, true_path, remote_ip, status, action_type, username ]`, `[ path, true_path, remote_ip, status, action_type, created_at ]`, `[ path, true_path, remote_ip, status, username, created_at ]`, `[ path, true_path, remote_ip, action_type, username, created_at ]`, `[ path, true_path, success, status, action_type, username ]`, `[ path, true_path, success, status, action_type, created_at ]`, `[ path, true_path, success, status, username, created_at ]`, `[ path, true_path, success, action_type, username, created_at ]`, `[ path, true_path, status, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type, username ]`, `[ path, remote_ip, success, status, action_type, created_at ]`, `[ path, remote_ip, success, status, username, created_at ]`, `[ path, remote_ip, success, action_type, username, created_at ]`, `[ path, remote_ip, status, action_type, username, created_at ]`, `[ path, success, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type, username ]`, `[ true_path, remote_ip, success, status, action_type, created_at ]`, `[ true_path, remote_ip, success, status, username, created_at ]`, `[ true_path, remote_ip, success, action_type, username, created_at ]`, `[ true_path, remote_ip, status, action_type, username, created_at ]`, `[ true_path, success, status, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status, action_type, username ]`, `[ path, true_path, remote_ip, success, status, action_type, created_at ]`, `[ path, true_path, remote_ip, success, status, username, created_at ]`, `[ path, true_path, remote_ip, success, action_type, username, created_at ]`, `[ path, true_path, remote_ip, status, action_type, username, created_at ]`, `[ path, true_path, success, status, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type, username, created_at ]` or `[ path, true_path, remote_ip, success, status, action_type, username, created_at ]`.
|
|
110
110
|
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ path ]`, `[ true_path ]`, `[ remote_ip ]`, `[ success ]`, `[ status ]`, `[ action_type ]`, `[ username ]`, `[ created_at ]`, `[ path, true_path ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, status ]`, `[ path, action_type ]`, `[ path, username ]`, `[ path, created_at ]`, `[ true_path, remote_ip ]`, `[ true_path, success ]`, `[ true_path, status ]`, `[ true_path, action_type ]`, `[ true_path, username ]`, `[ true_path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, status ]`, `[ remote_ip, action_type ]`, `[ remote_ip, username ]`, `[ remote_ip, created_at ]`, `[ success, status ]`, `[ success, action_type ]`, `[ success, username ]`, `[ success, created_at ]`, `[ status, action_type ]`, `[ status, username ]`, `[ status, created_at ]`, `[ action_type, username ]`, `[ action_type, created_at ]`, `[ username, created_at ]`, `[ path, true_path, remote_ip ]`, `[ path, true_path, success ]`, `[ path, true_path, status ]`, `[ path, true_path, action_type ]`, `[ path, true_path, username ]`, `[ path, true_path, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, status ]`, `[ path, remote_ip, action_type ]`, `[ path, remote_ip, username ]`, `[ path, remote_ip, created_at ]`, `[ path, success, status ]`, `[ path, success, action_type ]`, `[ path, success, username ]`, `[ path, success, created_at ]`, `[ path, status, action_type ]`, `[ path, status, username ]`, `[ path, status, created_at ]`, `[ path, action_type, username ]`, `[ path, action_type, created_at ]`, `[ path, username, created_at ]`, `[ true_path, remote_ip, success ]`, `[ true_path, remote_ip, status ]`, `[ true_path, remote_ip, action_type ]`, `[ true_path, remote_ip, username ]`, `[ true_path, remote_ip, created_at ]`, `[ true_path, success, status ]`, `[ true_path, success, action_type ]`, `[ true_path, success, username ]`, `[ true_path, success, created_at ]`, `[ true_path, status, action_type ]`, `[ true_path, status, username ]`, `[ true_path, status, created_at ]`, `[ true_path, action_type, username ]`, `[ true_path, action_type, created_at ]`, `[ true_path, username, created_at ]`, `[ remote_ip, success, status ]`, `[ remote_ip, success, action_type ]`, `[ remote_ip, success, username ]`, `[ remote_ip, success, created_at ]`, `[ remote_ip, status, action_type ]`, `[ remote_ip, status, username ]`, `[ remote_ip, status, created_at ]`, `[ remote_ip, action_type, username ]`, `[ remote_ip, action_type, created_at ]`, `[ remote_ip, username, created_at ]`, `[ success, status, action_type ]`, `[ success, status, username ]`, `[ success, status, created_at ]`, `[ success, action_type, username ]`, `[ success, action_type, created_at ]`, `[ success, username, created_at ]`, `[ status, action_type, username ]`, `[ status, action_type, created_at ]`, `[ status, username, created_at ]`, `[ action_type, username, created_at ]`, `[ path, true_path, remote_ip, success ]`, `[ path, true_path, remote_ip, status ]`, `[ path, true_path, remote_ip, action_type ]`, `[ path, true_path, remote_ip, username ]`, `[ path, true_path, remote_ip, created_at ]`, `[ path, true_path, success, status ]`, `[ path, true_path, success, action_type ]`, `[ path, true_path, success, username ]`, `[ path, true_path, success, created_at ]`, `[ path, true_path, status, action_type ]`, `[ path, true_path, status, username ]`, `[ path, true_path, status, created_at ]`, `[ path, true_path, action_type, username ]`, `[ path, true_path, action_type, created_at ]`, `[ path, true_path, username, created_at ]`, `[ path, remote_ip, success, status ]`, `[ path, remote_ip, success, action_type ]`, `[ path, remote_ip, success, username ]`, `[ path, remote_ip, success, created_at ]`, `[ path, remote_ip, status, action_type ]`, `[ path, remote_ip, status, username ]`, `[ path, remote_ip, status, created_at ]`, `[ path, remote_ip, action_type, username ]`, `[ path, remote_ip, action_type, created_at ]`, `[ path, remote_ip, username, created_at ]`, `[ path, success, status, action_type ]`, `[ path, success, status, username ]`, `[ path, success, status, created_at ]`, `[ path, success, action_type, username ]`, `[ path, success, action_type, created_at ]`, `[ path, success, username, created_at ]`, `[ path, status, action_type, username ]`, `[ path, status, action_type, created_at ]`, `[ path, status, username, created_at ]`, `[ path, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status ]`, `[ true_path, remote_ip, success, action_type ]`, `[ true_path, remote_ip, success, username ]`, `[ true_path, remote_ip, success, created_at ]`, `[ true_path, remote_ip, status, action_type ]`, `[ true_path, remote_ip, status, username ]`, `[ true_path, remote_ip, status, created_at ]`, `[ true_path, remote_ip, action_type, username ]`, `[ true_path, remote_ip, action_type, created_at ]`, `[ true_path, remote_ip, username, created_at ]`, `[ true_path, success, status, action_type ]`, `[ true_path, success, status, username ]`, `[ true_path, success, status, created_at ]`, `[ true_path, success, action_type, username ]`, `[ true_path, success, action_type, created_at ]`, `[ true_path, success, username, created_at ]`, `[ true_path, status, action_type, username ]`, `[ true_path, status, action_type, created_at ]`, `[ true_path, status, username, created_at ]`, `[ true_path, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type ]`, `[ remote_ip, success, status, username ]`, `[ remote_ip, success, status, created_at ]`, `[ remote_ip, success, action_type, username ]`, `[ remote_ip, success, action_type, created_at ]`, `[ remote_ip, success, username, created_at ]`, `[ remote_ip, status, action_type, username ]`, `[ remote_ip, status, action_type, created_at ]`, `[ remote_ip, status, username, created_at ]`, `[ remote_ip, action_type, username, created_at ]`, `[ success, status, action_type, username ]`, `[ success, status, action_type, created_at ]`, `[ success, status, username, created_at ]`, `[ success, action_type, username, created_at ]`, `[ status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status ]`, `[ path, true_path, remote_ip, success, action_type ]`, `[ path, true_path, remote_ip, success, username ]`, `[ path, true_path, remote_ip, success, created_at ]`, `[ path, true_path, remote_ip, status, action_type ]`, `[ path, true_path, remote_ip, status, username ]`, `[ path, true_path, remote_ip, status, created_at ]`, `[ path, true_path, remote_ip, action_type, username ]`, `[ path, true_path, remote_ip, action_type, created_at ]`, `[ path, true_path, remote_ip, username, created_at ]`, `[ path, true_path, success, status, action_type ]`, `[ path, true_path, success, status, username ]`, `[ path, true_path, success, status, created_at ]`, `[ path, true_path, success, action_type, username ]`, `[ path, true_path, success, action_type, created_at ]`, `[ path, true_path, success, username, created_at ]`, `[ path, true_path, status, action_type, username ]`, `[ path, true_path, status, action_type, created_at ]`, `[ path, true_path, status, username, created_at ]`, `[ path, true_path, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type ]`, `[ path, remote_ip, success, status, username ]`, `[ path, remote_ip, success, status, created_at ]`, `[ path, remote_ip, success, action_type, username ]`, `[ path, remote_ip, success, action_type, created_at ]`, `[ path, remote_ip, success, username, created_at ]`, `[ path, remote_ip, status, action_type, username ]`, `[ path, remote_ip, status, action_type, created_at ]`, `[ path, remote_ip, status, username, created_at ]`, `[ path, remote_ip, action_type, username, created_at ]`, `[ path, success, status, action_type, username ]`, `[ path, success, status, action_type, created_at ]`, `[ path, success, status, username, created_at ]`, `[ path, success, action_type, username, created_at ]`, `[ path, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type ]`, `[ true_path, remote_ip, success, status, username ]`, `[ true_path, remote_ip, success, status, created_at ]`, `[ true_path, remote_ip, success, action_type, username ]`, `[ true_path, remote_ip, success, action_type, created_at ]`, `[ true_path, remote_ip, success, username, created_at ]`, `[ true_path, remote_ip, status, action_type, username ]`, `[ true_path, remote_ip, status, action_type, created_at ]`, `[ true_path, remote_ip, status, username, created_at ]`, `[ true_path, remote_ip, action_type, username, created_at ]`, `[ true_path, success, status, action_type, username ]`, `[ true_path, success, status, action_type, created_at ]`, `[ true_path, success, status, username, created_at ]`, `[ true_path, success, action_type, username, created_at ]`, `[ true_path, status, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type, username ]`, `[ remote_ip, success, status, action_type, created_at ]`, `[ remote_ip, success, status, username, created_at ]`, `[ remote_ip, success, action_type, username, created_at ]`, `[ remote_ip, status, action_type, username, created_at ]`, `[ success, status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status, action_type ]`, `[ path, true_path, remote_ip, success, status, username ]`, `[ path, true_path, remote_ip, success, status, created_at ]`, `[ path, true_path, remote_ip, success, action_type, username ]`, `[ path, true_path, remote_ip, success, action_type, created_at ]`, `[ path, true_path, remote_ip, success, username, created_at ]`, `[ path, true_path, remote_ip, status, action_type, username ]`, `[ path, true_path, remote_ip, status, action_type, created_at ]`, `[ path, true_path, remote_ip, status, username, created_at ]`, `[ path, true_path, remote_ip, action_type, username, created_at ]`, `[ path, true_path, success, status, action_type, username ]`, `[ path, true_path, success, status, action_type, created_at ]`, `[ path, true_path, success, status, username, created_at ]`, `[ path, true_path, success, action_type, username, created_at ]`, `[ path, true_path, status, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type, username ]`, `[ path, remote_ip, success, status, action_type, created_at ]`, `[ path, remote_ip, success, status, username, created_at ]`, `[ path, remote_ip, success, action_type, username, created_at ]`, `[ path, remote_ip, status, action_type, username, created_at ]`, `[ path, success, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type, username ]`, `[ true_path, remote_ip, success, status, action_type, created_at ]`, `[ true_path, remote_ip, success, status, username, created_at ]`, `[ true_path, remote_ip, success, action_type, username, created_at ]`, `[ true_path, remote_ip, status, action_type, username, created_at ]`, `[ true_path, success, status, action_type, username, created_at ]`, `[ remote_ip, success, status, action_type, username, created_at ]`, `[ path, true_path, remote_ip, success, status, action_type, username ]`, `[ path, true_path, remote_ip, success, status, action_type, created_at ]`, `[ path, true_path, remote_ip, success, status, username, created_at ]`, `[ path, true_path, remote_ip, success, action_type, username, created_at ]`, `[ path, true_path, remote_ip, status, action_type, username, created_at ]`, `[ path, true_path, success, status, action_type, username, created_at ]`, `[ path, remote_ip, success, status, action_type, username, created_at ]`, `[ true_path, remote_ip, success, status, action_type, username, created_at ]` or `[ path, true_path, remote_ip, success, status, action_type, username, created_at ]`.
|
|
111
|
+
#
|
|
112
|
+
# params:: Hash of API operation parameter values.
|
|
113
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
114
|
+
#
|
|
115
|
+
# Returns a Files::List of Files::WebDavActionLog objects.
|
|
111
116
|
def self.list(params = {}, options = {})
|
|
112
117
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
113
118
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
@@ -118,8 +123,8 @@ module Files
|
|
|
118
123
|
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
|
|
119
124
|
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
|
|
120
125
|
|
|
121
|
-
List.new(WebDavActionLog, params) do
|
|
122
|
-
Api.send_request("/web_dav_action_logs", :get,
|
|
126
|
+
List.new(WebDavActionLog, params) do |page_params, &check_page|
|
|
127
|
+
Api.send_request("/web_dav_action_logs", :get, page_params, options, &check_page)
|
|
123
128
|
end
|
|
124
129
|
end
|
|
125
130
|
|
|
@@ -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
|
|
|
@@ -166,6 +166,11 @@ module Files
|
|
|
166
166
|
# file_form_field - string - Send the file data as a named parameter in the request POST body
|
|
167
167
|
# action - string - action for test body
|
|
168
168
|
# use_dedicated_ips - boolean - Use dedicated IPs for sending the webhook?
|
|
169
|
+
#
|
|
170
|
+
# params:: Hash of API operation parameter values.
|
|
171
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
172
|
+
#
|
|
173
|
+
# Returns a Files::WebhookTest.
|
|
169
174
|
def self.create(params = {}, options = {})
|
|
170
175
|
raise InvalidParameterError.new("Bad parameter: url must be an String") if params[:url] and !params[:url].is_a?(String)
|
|
171
176
|
raise InvalidParameterError.new("Bad parameter: method must be an String") if params[:method] and !params[:method].is_a?(String)
|
|
@@ -177,7 +182,7 @@ module Files
|
|
|
177
182
|
raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String)
|
|
178
183
|
raise MissingParameterError.new("Parameter missing: url") unless params[:url]
|
|
179
184
|
|
|
180
|
-
response, options = Api.send_request("/webhook_tests", :post, params, options)
|
|
185
|
+
response, options = Api.send_request("/webhook_tests", :post, params, options) { |reply| reply.require_object("WebhookTest") }
|
|
181
186
|
WebhookTest.new(response.data, options)
|
|
182
187
|
end
|
|
183
188
|
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
|
|
|
@@ -72,6 +74,11 @@ module Files
|
|
|
72
74
|
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
|
|
73
75
|
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `name`.
|
|
74
76
|
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
|
|
77
|
+
#
|
|
78
|
+
# params:: Hash of API operation parameter values.
|
|
79
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
80
|
+
#
|
|
81
|
+
# Returns a Files::List of Files::Workspace objects.
|
|
75
82
|
def self.list(params = {}, options = {})
|
|
76
83
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
77
84
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
@@ -79,8 +86,8 @@ module Files
|
|
|
79
86
|
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
80
87
|
raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
|
|
81
88
|
|
|
82
|
-
List.new(Workspace, params) do
|
|
83
|
-
Api.send_request("/workspaces", :get,
|
|
89
|
+
List.new(Workspace, params) do |page_params, &check_page|
|
|
90
|
+
Api.send_request("/workspaces", :get, page_params, options, &check_page)
|
|
84
91
|
end
|
|
85
92
|
end
|
|
86
93
|
|
|
@@ -90,13 +97,18 @@ module Files
|
|
|
90
97
|
|
|
91
98
|
# Parameters:
|
|
92
99
|
# id (required) - int64 - Workspace ID.
|
|
100
|
+
#
|
|
101
|
+
# params:: Hash of API operation parameter values.
|
|
102
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
103
|
+
#
|
|
104
|
+
# Returns a Files::Workspace.
|
|
93
105
|
def self.find(id, params = {}, options = {})
|
|
94
106
|
params ||= {}
|
|
95
107
|
params[:id] = id
|
|
96
108
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
97
109
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
98
110
|
|
|
99
|
-
response, options = Api.send_request("/workspaces/#{params[:id]}", :get, params, options)
|
|
111
|
+
response, options = Api.send_request("/workspaces/#{params[:id]}", :get, params, options) { |reply| reply.require_object("Workspace") }
|
|
100
112
|
Workspace.new(response.data, options)
|
|
101
113
|
end
|
|
102
114
|
|
|
@@ -106,15 +118,25 @@ module Files
|
|
|
106
118
|
|
|
107
119
|
# Parameters:
|
|
108
120
|
# name - string - Workspace name
|
|
121
|
+
#
|
|
122
|
+
# params:: Hash of API operation parameter values.
|
|
123
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
124
|
+
#
|
|
125
|
+
# Returns a Files::Workspace.
|
|
109
126
|
def self.create(params = {}, options = {})
|
|
110
127
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
111
128
|
|
|
112
|
-
response, options = Api.send_request("/workspaces", :post, params, options)
|
|
129
|
+
response, options = Api.send_request("/workspaces", :post, params, options) { |reply| reply.require_object("Workspace") }
|
|
113
130
|
Workspace.new(response.data, options)
|
|
114
131
|
end
|
|
115
132
|
|
|
116
133
|
# Parameters:
|
|
117
134
|
# name - string - Workspace name
|
|
135
|
+
#
|
|
136
|
+
# params:: Hash of API operation parameter values.
|
|
137
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
138
|
+
#
|
|
139
|
+
# Returns a Files::Workspace.
|
|
118
140
|
def self.update(id, params = {}, options = {})
|
|
119
141
|
params ||= {}
|
|
120
142
|
params[:id] = id
|
|
@@ -122,10 +144,14 @@ module Files
|
|
|
122
144
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
123
145
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
124
146
|
|
|
125
|
-
response, options = Api.send_request("/workspaces/#{params[:id]}", :patch, params, options)
|
|
147
|
+
response, options = Api.send_request("/workspaces/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("Workspace") }
|
|
126
148
|
Workspace.new(response.data, options)
|
|
127
149
|
end
|
|
128
150
|
|
|
151
|
+
# params:: Hash of API operation parameter values.
|
|
152
|
+
# options:: Hash of optional request configuration passed to Files::Api.send_request.
|
|
153
|
+
#
|
|
154
|
+
# Returns nil.
|
|
129
155
|
def self.delete(id, params = {}, options = {})
|
|
130
156
|
params ||= {}
|
|
131
157
|
params[:id] = id
|
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
data/lib/files.com.rb
CHANGED
|
@@ -7,6 +7,7 @@ require "json"
|
|
|
7
7
|
require "logger"
|
|
8
8
|
require "openssl"
|
|
9
9
|
require "rbconfig"
|
|
10
|
+
require "rbconfig/sizeof"
|
|
10
11
|
require "securerandom"
|
|
11
12
|
require "set"
|
|
12
13
|
require "socket"
|
|
@@ -201,7 +202,8 @@ module Files
|
|
|
201
202
|
@read_timeout = 60
|
|
202
203
|
|
|
203
204
|
class << self
|
|
204
|
-
attr_accessor :api_key, :base_url, :default_headers, :initial_network_retry_delay, :language, :max_network_retry_delay, :
|
|
205
|
+
attr_accessor :api_key, :base_url, :default_headers, :initial_network_retry_delay, :language, :max_network_retry_delay, :proxy, :session_id, :workspace_id
|
|
206
|
+
attr_reader :open_timeout, :read_timeout
|
|
205
207
|
end
|
|
206
208
|
|
|
207
209
|
# map to the same values as the standard library's logger
|
|
@@ -259,6 +261,26 @@ module Files
|
|
|
259
261
|
@max_network_retries = val.to_i
|
|
260
262
|
end
|
|
261
263
|
|
|
264
|
+
# Net::HTTP hands each timeout to Ruby to wait on. CRuby converts it to the
|
|
265
|
+
# platform's time_t and raises RangeError for more seconds than that holds,
|
|
266
|
+
# partway through a request it may already have sent. JRuby takes any number.
|
|
267
|
+
MAX_TIMEOUT = RUBY_PLATFORM == "java" ? Float::INFINITY : (2**((8 * RbConfig::SIZEOF["time_t"]) - 1)) - 1
|
|
268
|
+
private_constant :MAX_TIMEOUT
|
|
269
|
+
|
|
270
|
+
def self.open_timeout=(seconds)
|
|
271
|
+
@open_timeout = checked_timeout("open_timeout", seconds)
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
def self.read_timeout=(seconds)
|
|
275
|
+
@read_timeout = checked_timeout("read_timeout", seconds)
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
private_class_method def self.checked_timeout(name, seconds)
|
|
279
|
+
return seconds if seconds.nil? || (seconds.is_a?(Numeric) && seconds.real? && seconds >= 0 && seconds <= MAX_TIMEOUT)
|
|
280
|
+
|
|
281
|
+
raise ArgumentError, "#{name} should be nil or a number of seconds from 0 to #{MAX_TIMEOUT}"
|
|
282
|
+
end
|
|
283
|
+
|
|
262
284
|
def self.session=(session)
|
|
263
285
|
session.save unless session.id
|
|
264
286
|
self.session_id = session.id
|
data/spec/language_spec.rb
CHANGED
|
@@ -9,20 +9,30 @@ RSpec.describe "Language setting" do
|
|
|
9
9
|
Files.language = old_language
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
describe "request headers" do
|
|
13
|
+
let(:client) { Files::ApiClient.new }
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
it "sends the configured language as the Accept-Language header" do
|
|
16
|
+
Files.language = "es"
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
headers = client.send(:request_headers, "api-key", nil, :get, nil)
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
expect(Files.language).to eq("es")
|
|
21
|
+
expect(headers["Accept-Language"]).to eq("es")
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "omits the Accept-Language header when unset" do
|
|
25
|
+
headers = client.send(:request_headers, "api-key", nil, :get, nil)
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
expect(headers).not_to have_key("Accept-Language")
|
|
28
|
+
end
|
|
29
|
+
end
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
describe "API errors", :with_test_folder do
|
|
32
|
+
it "gets API errors in the language it sets" do
|
|
33
|
+
Files.language = "es"
|
|
34
|
+
expect(Files.language).to eq("es")
|
|
35
|
+
expect { Files::File.find(test_folder.join("read.txt").to_s, {}, options) }.to raise_error(Files::NotFoundError, a_string_including("No se ha encontrado"))
|
|
36
|
+
end
|
|
27
37
|
end
|
|
28
38
|
end
|