├── .gitignore ├── .rspec ├── .rubocop.yml ├── CONTRIBUTORS ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── SECURITY.md ├── _VERSION ├── bin ├── files └── files-console ├── build.sh ├── docs ├── account_line_item.md ├── action.md ├── action_notification_export.md ├── action_notification_export_result.md ├── api_key.md ├── api_request_log.md ├── app.md ├── as2_incoming_message.md ├── as2_outgoing_message.md ├── as2_partner.md ├── as2_station.md ├── auto.md ├── automation.md ├── automation_log.md ├── automation_run.md ├── bandwidth_snapshot.md ├── behavior.md ├── bundle.md ├── bundle_action.md ├── bundle_download.md ├── bundle_notification.md ├── bundle_path.md ├── bundle_recipient.md ├── bundle_registration.md ├── clickwrap.md ├── dns_record.md ├── email_incoming_message.md ├── email_log.md ├── errors.md ├── exavault_api_request_log.md ├── external_event.md ├── file.md ├── file_action.md ├── file_comment.md ├── file_comment_reaction.md ├── file_migration.md ├── file_migration_log.md ├── file_upload_part.md ├── file_utils.md ├── folder.md ├── form_field.md ├── form_field_set.md ├── ftp_action_log.md ├── gpg_key.md ├── group.md ├── group_user.md ├── history.md ├── history_export.md ├── history_export_result.md ├── image.md ├── inbox_recipient.md ├── inbox_registration.md ├── inbox_upload.md ├── invoice.md ├── invoice_line_item.md ├── ip_address.md ├── lock.md ├── message.md ├── message_comment.md ├── message_comment_reaction.md ├── message_reaction.md ├── notification.md ├── outbound_connection_log.md ├── payment.md ├── payment_line_item.md ├── permission.md ├── preview.md ├── priority.md ├── project.md ├── public_hosting_request_log.md ├── public_ip_address.md ├── public_key.md ├── remote_bandwidth_snapshot.md ├── remote_server.md ├── remote_server_configuration_file.md ├── request.md ├── restore.md ├── session.md ├── settings_change.md ├── sftp_action_log.md ├── sftp_host_key.md ├── share_group.md ├── share_group_member.md ├── siem_http_destination.md ├── site.md ├── snapshot.md ├── sso_strategy.md ├── status.md ├── style.md ├── sync_log.md ├── usage_by_top_level_dir.md ├── usage_daily_snapshot.md ├── usage_snapshot.md ├── user.md ├── user_cipher_use.md ├── user_lifecycle_rule.md ├── user_request.md ├── user_sftp_client_use.md ├── web_dav_action_log.md └── webhook_test.md ├── files.com.gemspec ├── lib ├── files.com.rb └── files.com │ ├── api.rb │ ├── api_client.rb │ ├── errors.rb │ ├── list.rb │ ├── models │ ├── account_line_item.rb │ ├── action.rb │ ├── action_notification_export.rb │ ├── action_notification_export_result.rb │ ├── api_key.rb │ ├── api_request_log.rb │ ├── app.rb │ ├── as2_incoming_message.rb │ ├── as2_outgoing_message.rb │ ├── as2_partner.rb │ ├── as2_station.rb │ ├── auto.rb │ ├── automation.rb │ ├── automation_log.rb │ ├── automation_run.rb │ ├── bandwidth_snapshot.rb │ ├── behavior.rb │ ├── bundle.rb │ ├── bundle_action.rb │ ├── bundle_download.rb │ ├── bundle_notification.rb │ ├── bundle_path.rb │ ├── bundle_recipient.rb │ ├── bundle_registration.rb │ ├── clickwrap.rb │ ├── dir.rb │ ├── dns_record.rb │ ├── email_incoming_message.rb │ ├── email_log.rb │ ├── errors.rb │ ├── exavault_api_request_log.rb │ ├── external_event.rb │ ├── file.rb │ ├── file_action.rb │ ├── file_comment.rb │ ├── file_comment_reaction.rb │ ├── file_migration.rb │ ├── file_migration_log.rb │ ├── file_upload_part.rb │ ├── file_utils.rb │ ├── folder.rb │ ├── form_field.rb │ ├── form_field_set.rb │ ├── ftp_action_log.rb │ ├── gpg_key.rb │ ├── group.rb │ ├── group_user.rb │ ├── history.rb │ ├── history_export.rb │ ├── history_export_result.rb │ ├── image.rb │ ├── inbox_recipient.rb │ ├── inbox_registration.rb │ ├── inbox_upload.rb │ ├── invoice.rb │ ├── invoice_line_item.rb │ ├── ip_address.rb │ ├── lock.rb │ ├── message.rb │ ├── message_comment.rb │ ├── message_comment_reaction.rb │ ├── message_reaction.rb │ ├── notification.rb │ ├── outbound_connection_log.rb │ ├── payment.rb │ ├── payment_line_item.rb │ ├── permission.rb │ ├── preview.rb │ ├── priority.rb │ ├── project.rb │ ├── public_hosting_request_log.rb │ ├── public_ip_address.rb │ ├── public_key.rb │ ├── remote_bandwidth_snapshot.rb │ ├── remote_server.rb │ ├── remote_server_configuration_file.rb │ ├── request.rb │ ├── restore.rb │ ├── session.rb │ ├── settings_change.rb │ ├── sftp_action_log.rb │ ├── sftp_host_key.rb │ ├── share_group.rb │ ├── share_group_member.rb │ ├── siem_http_destination.rb │ ├── site.rb │ ├── snapshot.rb │ ├── sso_strategy.rb │ ├── status.rb │ ├── style.rb │ ├── sync_log.rb │ ├── usage_by_top_level_dir.rb │ ├── usage_daily_snapshot.rb │ ├── usage_snapshot.rb │ ├── user.rb │ ├── user_cipher_use.rb │ ├── user_lifecycle_rule.rb │ ├── user_request.rb │ ├── user_sftp_client_use.rb │ ├── web_dav_action_log.rb │ └── webhook_test.rb │ ├── path_util.rb │ ├── response.rb │ ├── sizable_io.rb │ ├── system_profiler.rb │ ├── uri.rb │ ├── util.rb │ └── version.rb ├── shared ├── header_test_data.json ├── normalization_for_comparison_test_data.json └── url_test_data.json ├── spec ├── language_spec.rb ├── lib │ └── api_client_spec.rb ├── list_spec.rb ├── models │ ├── file_spec.rb │ └── folder_spec.rb ├── path_util_spec.rb ├── spec_helper.rb └── uri_spec.rb ├── test.sh └── test └── test.rb /.gitignore: -------------------------------------------------------------------------------- 1 | setup.sh 2 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | TargetRubyVersion: 2.7 3 | NewCops: enable 4 | 5 | Gemspec/RequireMFA: 6 | Enabled: false 7 | 8 | Layout/ArgumentAlignment: 9 | Enabled: false 10 | 11 | Layout/CaseIndentation: 12 | EnforcedStyle: end 13 | 14 | Layout/HashAlignment: 15 | Enabled: false 16 | 17 | Layout/FirstArrayElementIndentation: 18 | Enabled: false 19 | 20 | Layout/LeadingCommentSpace: 21 | Enabled: false 22 | 23 | Layout/LineLength: 24 | Enabled: false 25 | 26 | Layout/MultilineMethodCallBraceLayout: 27 | EnforcedStyle: new_line 28 | 29 | Layout/RescueEnsureAlignment: 30 | Enabled: false 31 | 32 | Layout/SpaceInsideArrayLiteralBrackets: 33 | EnforcedStyle: space 34 | 35 | Lint/AmbiguousRegexpLiteral: 36 | Enabled: false 37 | 38 | Lint/AmbiguousOperator: 39 | Enabled: false 40 | 41 | Lint/AssignmentInCondition: 42 | Enabled: false 43 | 44 | Lint/FormatParameterMismatch: 45 | Enabled: false 46 | 47 | Lint/IneffectiveAccessModifier: 48 | Enabled: false 49 | 50 | Lint/UriEscapeUnescape: 51 | Enabled: false 52 | 53 | Metrics/AbcSize: 54 | Enabled: false 55 | 56 | Metrics/BlockLength: 57 | Enabled: false 58 | 59 | Metrics/ClassLength: 60 | Enabled: false 61 | 62 | Metrics/CyclomaticComplexity: 63 | Enabled: false 64 | 65 | Metrics/MethodLength: 66 | Enabled: false 67 | 68 | Metrics/ModuleLength: 69 | Enabled: false 70 | 71 | Metrics/ParameterLists: 72 | Enabled: false 73 | 74 | Metrics/PerceivedComplexity: 75 | Enabled: false 76 | 77 | Naming/HeredocDelimiterCase: 78 | EnforcedStyle: lowercase 79 | 80 | Naming/MethodParameterName: 81 | Enabled: false 82 | 83 | Naming/PredicateName: 84 | Enabled: false 85 | 86 | Naming/VariableNumber: 87 | Enabled: false 88 | 89 | Security/YAMLLoad: 90 | Enabled: false 91 | 92 | Style/AccessModifierDeclarations: 93 | Enabled: false 94 | 95 | Style/AccessorGrouping: 96 | Enabled: false 97 | 98 | Style/ArgumentsForwarding: 99 | Enabled: false 100 | 101 | Style/AndOr: 102 | Enabled: false 103 | 104 | Style/BlockDelimiters: 105 | Enabled: false 106 | 107 | Style/ClassAndModuleChildren: 108 | Enabled: false 109 | 110 | Style/ClassVars: 111 | Enabled: false 112 | 113 | Style/ConditionalAssignment: 114 | Enabled: false 115 | 116 | Style/Documentation: 117 | Enabled: false 118 | 119 | Style/DoubleNegation: 120 | Enabled: false 121 | 122 | Style/FormatString: 123 | Enabled: false 124 | 125 | Style/FormatStringToken: 126 | Enabled: false 127 | 128 | Style/FrozenStringLiteralComment: 129 | Enabled: false 130 | 131 | Style/GlobalVars: 132 | Enabled: false 133 | 134 | Style/GuardClause: 135 | Enabled: false 136 | 137 | Style/MultilineBlockChain: 138 | Enabled: false 139 | 140 | Style/NumericLiterals: 141 | MinDigits: 7 142 | 143 | Style/NumericPredicate: 144 | Enabled: false 145 | 146 | Style/ParallelAssignment: 147 | Enabled: false 148 | 149 | Style/PercentLiteralDelimiters: 150 | Enabled: false 151 | 152 | Style/PerlBackrefs: 153 | Enabled: false 154 | 155 | Style/RaiseArgs: 156 | Enabled: false 157 | 158 | Style/RegexpLiteral: 159 | AllowInnerSlashes: true 160 | 161 | Style/StringLiterals: 162 | Enabled: false 163 | 164 | Style/StringLiteralsInInterpolation: 165 | Enabled: false 166 | 167 | Style/SymbolArray: 168 | Enabled: false 169 | 170 | Style/TrailingCommaInArguments: 171 | Enabled: false 172 | 173 | Style/TrailingCommaInHashLiteral: 174 | Enabled: false 175 | 176 | Style/WordArray: 177 | Enabled: false 178 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Daniel Cowgill 2 | Dustin Zeisler 3 | Jesse Harris 4 | Kevin Bombino 5 | Kevin Killingsworth 6 | Martyn Garcia 7 | Rommel Santor 8 | Sam Harrison 9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | group :development, :test do 6 | gem 'memory_profiler' 7 | gem 'pry' 8 | gem 'pry-byebug' 9 | gem 'rake' 10 | gem 'rspec' 11 | gem 'rubocop' 12 | end 13 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | files.com (1.1.0) 5 | addressable (>= 2.8.0) 6 | concurrent-ruby (>= 1.1.3) 7 | faraday (>= 1.0.1) 8 | faraday-multipart (>= 1.0) 9 | faraday-net_http_persistent (>= 2.0) 10 | net-http-persistent (>= 4.0) 11 | 12 | GEM 13 | remote: https://rubygems.org/ 14 | specs: 15 | addressable (2.8.1) 16 | public_suffix (>= 2.0.2, < 6.0) 17 | ast (2.4.2) 18 | byebug (11.1.3) 19 | coderay (1.1.3) 20 | concurrent-ruby (1.1.10) 21 | connection_pool (2.2.5) 22 | diff-lcs (1.5.0) 23 | faraday (2.5.2) 24 | faraday-net_http (>= 2.0, < 3.1) 25 | ruby2_keywords (>= 0.0.4) 26 | faraday-multipart (1.0.4) 27 | multipart-post (~> 2) 28 | faraday-net_http (3.0.0) 29 | faraday-net_http_persistent (2.1.0) 30 | faraday (~> 2.5) 31 | net-http-persistent (~> 4.0) 32 | json (2.6.2) 33 | memory_profiler (1.0.0) 34 | method_source (1.0.0) 35 | multipart-post (2.2.3) 36 | net-http-persistent (4.0.1) 37 | connection_pool (~> 2.2) 38 | parallel (1.22.1) 39 | parser (3.1.2.1) 40 | ast (~> 2.4.1) 41 | pry (0.14.1) 42 | coderay (~> 1.1) 43 | method_source (~> 1.0) 44 | pry-byebug (3.10.1) 45 | byebug (~> 11.0) 46 | pry (>= 0.13, < 0.15) 47 | public_suffix (5.0.0) 48 | rainbow (3.1.1) 49 | rake (13.0.6) 50 | regexp_parser (2.5.0) 51 | rexml (3.2.5) 52 | rspec (3.11.0) 53 | rspec-core (~> 3.11.0) 54 | rspec-expectations (~> 3.11.0) 55 | rspec-mocks (~> 3.11.0) 56 | rspec-core (3.11.0) 57 | rspec-support (~> 3.11.0) 58 | rspec-expectations (3.11.0) 59 | diff-lcs (>= 1.2.0, < 2.0) 60 | rspec-support (~> 3.11.0) 61 | rspec-mocks (3.11.1) 62 | diff-lcs (>= 1.2.0, < 2.0) 63 | rspec-support (~> 3.11.0) 64 | rspec-support (3.11.0) 65 | rubocop (1.35.1) 66 | json (~> 2.3) 67 | parallel (~> 1.10) 68 | parser (>= 3.1.2.1) 69 | rainbow (>= 2.2.2, < 4.0) 70 | regexp_parser (>= 1.8, < 3.0) 71 | rexml (>= 3.2.5, < 4.0) 72 | rubocop-ast (>= 1.20.1, < 2.0) 73 | ruby-progressbar (~> 1.7) 74 | unicode-display_width (>= 1.4.0, < 3.0) 75 | rubocop-ast (1.21.0) 76 | parser (>= 3.1.1.0) 77 | ruby-progressbar (1.11.0) 78 | ruby2_keywords (0.0.5) 79 | unicode-display_width (2.2.0) 80 | 81 | PLATFORMS 82 | ruby 83 | 84 | DEPENDENCIES 85 | files.com! 86 | memory_profiler 87 | pry 88 | pry-byebug 89 | rake 90 | rspec 91 | rubocop 92 | 93 | BUNDLED WITH 94 | 2.4.21 95 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019- Action Verb, LLC (https://www.files.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | 3 | Dir.glob('lib/tasks/*.rake').each { |r| import r } 4 | 5 | begin 6 | require 'rspec/core/rake_task' 7 | 8 | RSpec::Core::RakeTask.new(:spec) 9 | task default: :spec 10 | rescue LoadError 11 | # no rspec available 12 | end 13 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Thank you for your interest in Files.com security. We recognize that your data is very personal and sensitive and we work hard to keep it protected. 4 | 5 | 6 | ## Supported Versions 7 | 8 | Only the latest version will be supported with security updates. 9 | 10 | 11 | ## Reporting a Vulnerability 12 | 13 | Here at Files.com, we celebrate security and we encourage independent security researchers to help us keep our products secure. 14 | 15 | We offer a Security Bug Bounty Program to create an incentive and reward structure so that researchers are able to devote resources to working on Files.com. 16 | 17 | We offer our Bug Bounty Program on HackerOne at https://hackerone.com/files 18 | 19 | We prefer to receive reports of vulnerabilities there. 20 | 21 | If you do not wish to use HackerOne, alternate submission instructions are available at: 22 | https://www.files.com/legal/security-bounty/ 23 | 24 | Thank you for helping keep the Files.com community secure! 25 | -------------------------------------------------------------------------------- /_VERSION: -------------------------------------------------------------------------------- 1 | 1.1.266 2 | -------------------------------------------------------------------------------- /bin/files: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # frozen_string_literal: true 4 | 5 | require "#{File.dirname(__FILE__)}/../lib/files.com" 6 | require "#{File.dirname(__FILE__)}/../lib/files.com/cli" 7 | 8 | Files::Cli.new.run 9 | -------------------------------------------------------------------------------- /bin/files-console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # frozen_string_literal: true 4 | 5 | require "irb" 6 | require "irb/completion" 7 | 8 | require "#{File.dirname(__FILE__)}/../lib/files.com" 9 | 10 | # Config IRB to enable --simple-prompt and auto indent 11 | IRB.conf[:PROMPT_MODE] = :SIMPLE 12 | IRB.conf[:AUTO_INDENT] = true 13 | 14 | puts "Loaded Files.com Console." 15 | 16 | IRB.start 17 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | bundle install && bundle exec rubocop --ignore-parent-exclusion && bundle exec rspec 4 | -------------------------------------------------------------------------------- /docs/account_line_item.md: -------------------------------------------------------------------------------- 1 | # AccountLineItem 2 | 3 | ## Example AccountLineItem Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "amount": 1.0, 16 | "created_at": "2000-01-01T01:00:00Z", 17 | "description": "Service from 2019-01-01 through 2019-12-31", 18 | "type": "invoice", 19 | "service_end_at": "2000-01-01T01:00:00Z", 20 | "service_start_at": "2000-01-01T01:00:00Z", 21 | "plan": "Premier", 22 | "site": "My site" 23 | } 24 | ], 25 | "method": "paypal", 26 | "payment_line_items": [ 27 | { 28 | "amount": 1.0, 29 | "created_at": "2000-01-01T01:00:00Z", 30 | "invoice_id": 1, 31 | "payment_id": 1 32 | } 33 | ], 34 | "payment_reversed_at": "2000-01-01T01:00:00Z", 35 | "payment_type": "example", 36 | "site_name": "My Site", 37 | "type": "invoice" 38 | } 39 | ``` 40 | 41 | * `id` (int64): Line item Id 42 | * `amount` (double): Line item amount 43 | * `balance` (double): Line item balance 44 | * `created_at` (date-time): Line item created at 45 | * `currency` (string): Line item currency 46 | * `download_uri` (string): Line item download uri 47 | * `invoice_line_items` (array(object)): Associated invoice line items 48 | * `method` (string): Line item payment method 49 | * `payment_line_items` (array(object)): Associated payment line items 50 | * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable 51 | * `payment_type` (string): Type of payment if applicable 52 | * `site_name` (string): Site name this line item is for 53 | * `type` (string): Type of line item, either payment or invoice 54 | -------------------------------------------------------------------------------- /docs/action.md: -------------------------------------------------------------------------------- 1 | # Action 2 | 3 | ## Example Action Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "", 9 | "when": "2000-01-01T01:00:00Z", 10 | "destination": "/to_path", 11 | "display": "Actual text of the action here.", 12 | "ip": "192.283.128.182", 13 | "source": "/from_path", 14 | "targets": null, 15 | "user_id": 1, 16 | "username": "user", 17 | "user_is_from_parent_site": true, 18 | "action": "create", 19 | "failure_type": "none", 20 | "interface": "web" 21 | } 22 | ``` 23 | 24 | * `id` (int64): Action ID 25 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 26 | * `when` (date-time): Action occurrence date/time 27 | * `destination` (string): The destination path for this action, if applicable 28 | * `display` (string): Friendly displayed output 29 | * `ip` (string): IP Address that performed this action 30 | * `source` (string): The source path for this action, if applicable 31 | * `targets` (object): Targets 32 | * `user_id` (int64): User ID 33 | * `username` (string): Username 34 | * `user_is_from_parent_site` (boolean): true if this change was performed by a user on a parent site. 35 | * `action` (string): Type of action 36 | * `failure_type` (string): Failure type. If action was a user login or session failure, why did it fail? 37 | * `interface` (string): Interface on which this action occurred. 38 | -------------------------------------------------------------------------------- /docs/action_notification_export.md: -------------------------------------------------------------------------------- 1 | # ActionNotificationExport 2 | 3 | ## Example ActionNotificationExport Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "export_version": "20201213.2", 9 | "start_at": "2000-01-01T01:00:00Z", 10 | "end_at": "2000-01-01T01:00:00Z", 11 | "status": "ready", 12 | "query_path": "MyFile.txt", 13 | "query_folder": "MyFolder", 14 | "query_message": "Connection Refused", 15 | "query_request_method": "GET", 16 | "query_request_url": "http://example.com/webhook", 17 | "query_status": "200", 18 | "query_success": true, 19 | "results_url": "https://files.com/action_notification_results.csv" 20 | } 21 | ``` 22 | 23 | * `id` (int64): History Export ID 24 | * `export_version` (string): Version of the underlying records for the export. 25 | * `start_at` (date-time): Start date/time of export range. 26 | * `end_at` (date-time): End date/time of export range. 27 | * `status` (string): Status of export. Valid values: `building`, `ready`, or `failed` 28 | * `query_path` (string): Return notifications that were triggered by actions on this specific path. 29 | * `query_folder` (string): Return notifications that were triggered by actions in this folder. 30 | * `query_message` (string): Error message associated with the request, if any. 31 | * `query_request_method` (string): The HTTP request method used by the webhook. 32 | * `query_request_url` (string): The target webhook URL. 33 | * `query_status` (string): The HTTP status returned from the server in response to the webhook request. 34 | * `query_success` (boolean): true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. 35 | * `results_url` (string): If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV. 36 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 37 | 38 | 39 | --- 40 | 41 | ## Show Action Notification Export 42 | 43 | ``` 44 | Files::ActionNotificationExport.find(id) 45 | ``` 46 | 47 | ### Parameters 48 | 49 | * `id` (int64): Required - Action Notification Export ID. 50 | 51 | 52 | --- 53 | 54 | ## Create Action Notification Export 55 | 56 | ``` 57 | Files::ActionNotificationExport.create( 58 | user_id: 1, 59 | start_at: "2000-01-01T01:00:00Z", 60 | end_at: "2000-01-01T01:00:00Z", 61 | query_message: "Connection Refused", 62 | query_request_method: "GET", 63 | query_request_url: "http://example.com/webhook", 64 | query_status: "200", 65 | query_success: true, 66 | query_path: "MyFile.txt", 67 | query_folder: "MyFolder" 68 | ) 69 | ``` 70 | 71 | ### Parameters 72 | 73 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 74 | * `start_at` (string): Start date/time of export range. 75 | * `end_at` (string): End date/time of export range. 76 | * `query_message` (string): Error message associated with the request, if any. 77 | * `query_request_method` (string): The HTTP request method used by the webhook. 78 | * `query_request_url` (string): The target webhook URL. 79 | * `query_status` (string): The HTTP status returned from the server in response to the webhook request. 80 | * `query_success` (boolean): true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. 81 | * `query_path` (string): Return notifications that were triggered by actions on this specific path. 82 | * `query_folder` (string): Return notifications that were triggered by actions in this folder. 83 | -------------------------------------------------------------------------------- /docs/action_notification_export_result.md: -------------------------------------------------------------------------------- 1 | # ActionNotificationExportResult 2 | 3 | ## Example ActionNotificationExportResult Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "created_at": 1, 9 | "status": 200, 10 | "message": "Success", 11 | "success": true, 12 | "request_headers": "{\"User-Agent\":\"Files.com Webhook\"}", 13 | "request_method": "GET", 14 | "request_url": "www.example.com/webhook_receiver", 15 | "path": "MyFolder/MyFile.txt", 16 | "folder": "MyFolder" 17 | } 18 | ``` 19 | 20 | * `id` (int64): Notification ID 21 | * `created_at` (int64): When the notification was sent. 22 | * `status` (int64): HTTP status code returned in the webhook response. 23 | * `message` (string): A message indicating the overall status of the webhook notification. 24 | * `success` (boolean): `true` if the webhook succeeded by receiving a 200 or 204 response. 25 | * `request_headers` (string): A JSON-encoded string with headers that were sent with the webhook. 26 | * `request_method` (string): The HTTP verb used to perform the webhook. 27 | * `request_url` (string): The webhook request URL. 28 | * `path` (string): The path to the actual file that triggered this notification. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 29 | * `folder` (string): The folder associated with the triggering action for this notification. 30 | 31 | 32 | --- 33 | 34 | ## List Action Notification Export Results 35 | 36 | ``` 37 | Files::ActionNotificationExportResult.list( 38 | user_id: 1, 39 | action_notification_export_id: 1 40 | ) 41 | ``` 42 | 43 | ### Parameters 44 | 45 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 46 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 47 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 48 | * `action_notification_export_id` (int64): Required - ID of the associated action notification export. 49 | -------------------------------------------------------------------------------- /docs/app.md: -------------------------------------------------------------------------------- 1 | # App 2 | 3 | ## Example App Object 4 | 5 | ``` 6 | { 7 | "app_type": "example", 8 | "documentation_links": { 9 | "Important Info": "http://files.test/learn-more" 10 | }, 11 | "extended_description": "example", 12 | "extended_description_for_marketing_site": "example", 13 | "external_homepage_url": "example", 14 | "featured": true, 15 | "folder_behavior_type": "example", 16 | "icon_url": "example", 17 | "logo_thumbnail_url": "example", 18 | "logo_url": "example", 19 | "marketing_intro": "example", 20 | "marketing_youtube_url": "example", 21 | "name": "example", 22 | "package_manager_install_command": "example", 23 | "remote_server_type": "example", 24 | "screenshot_list_urls": [ 25 | "example" 26 | ], 27 | "sdk_installation_instructions_link": "example", 28 | "short_description": "example", 29 | "sso_strategy_type": "example", 30 | "siem_type": "example", 31 | "tutorial_youtube_url": "example" 32 | } 33 | ``` 34 | 35 | * `app_type` (string): The type of the App 36 | * `documentation_links` (object): Collection of named links to documentation 37 | * `extended_description` (string): Long description for the in-App landing page 38 | * `extended_description_for_marketing_site` (string): Long form description of the App 39 | * `external_homepage_url` (string): Link to external homepage 40 | * `featured` (boolean): Is featured on the App listing? 41 | * `folder_behavior_type` (string): Associated Folder Behavior type, if any 42 | * `icon_url` (string): App icon 43 | * `logo_thumbnail_url` (string): Logo thumbnail for the App 44 | * `logo_url` (string): Full size logo for the App 45 | * `marketing_intro` (string): Marketing introdution of the App 46 | * `marketing_youtube_url` (string): Marketing video page 47 | * `name` (string): Name of the App 48 | * `package_manager_install_command` (string): Package manager install command 49 | * `remote_server_type` (string): Associated Remote Server type, if any 50 | * `screenshot_list_urls` (array(string)): Screenshots of the App 51 | * `sdk_installation_instructions_link` (string): Link to SDK installation instructions 52 | * `short_description` (string): Short description of the App 53 | * `sso_strategy_type` (string): Associated SSO Strategy type, if any 54 | * `siem_type` (string): Associated SIEM type, if any 55 | * `tutorial_youtube_url` (string): Tutorial video page 56 | 57 | 58 | --- 59 | 60 | ## List Apps 61 | 62 | ``` 63 | Files::App.list 64 | ``` 65 | 66 | ### Parameters 67 | 68 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 69 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 70 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name` and `app_type`. 71 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `name` and `app_type`. Valid field combinations are `[ name, app_type ]`. 72 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`. 73 | -------------------------------------------------------------------------------- /docs/auto.md: -------------------------------------------------------------------------------- 1 | # Auto 2 | 3 | ## Example Auto Object 4 | 5 | ``` 6 | { 7 | "dynamic": null 8 | } 9 | ``` 10 | 11 | * `dynamic` (object): 12 | -------------------------------------------------------------------------------- /docs/automation_run.md: -------------------------------------------------------------------------------- 1 | # AutomationRun 2 | 3 | ## Example AutomationRun Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "automation_id": 1, 9 | "completed_at": "2000-01-01T01:00:00Z", 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "retry_at": "2000-01-01T01:00:00Z", 12 | "retried_at": "2000-01-01T01:00:00Z", 13 | "retried_in_run_id": 1, 14 | "retry_of_run_id": 1, 15 | "runtime": 1.0, 16 | "status": "success", 17 | "successful_operations": 1, 18 | "failed_operations": 1, 19 | "status_messages_url": "https://www.example.com/log_file.txt" 20 | } 21 | ``` 22 | 23 | * `id` (int64): ID. 24 | * `automation_id` (int64): ID of the associated Automation. 25 | * `completed_at` (date-time): Automation run completion/failure date/time. 26 | * `created_at` (date-time): Automation run start date/time. 27 | * `retry_at` (date-time): If set, this automation will be retried at this date/time due to `failure` or `partial_failure`. 28 | * `retried_at` (date-time): If set, this Automation run was retried due to `failure` or `partial_failure`. 29 | * `retried_in_run_id` (int64): ID of the run that is or will be retrying this run. 30 | * `retry_of_run_id` (int64): ID of the original run that this run is retrying. 31 | * `runtime` (double): Automation run runtime. 32 | * `status` (string): The success status of the AutomationRun. One of `running`, `success`, `partial_failure`, or `failure`. 33 | * `successful_operations` (int64): Count of successful operations. 34 | * `failed_operations` (int64): Count of failed operations. 35 | * `status_messages_url` (string): Link to status messages log file. 36 | 37 | 38 | --- 39 | 40 | ## List Automation Runs 41 | 42 | ``` 43 | Files::AutomationRun.list( 44 | user_id: 1, 45 | automation_id: 1 46 | ) 47 | ``` 48 | 49 | ### Parameters 50 | 51 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 52 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 53 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 54 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation_id`, `created_at` or `status`. 55 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `automation_id`. Valid field combinations are `[ automation_id, status ]`. 56 | * `automation_id` (int64): Required - ID of the associated Automation. 57 | 58 | 59 | --- 60 | 61 | ## Show Automation Run 62 | 63 | ``` 64 | Files::AutomationRun.find(id) 65 | ``` 66 | 67 | ### Parameters 68 | 69 | * `id` (int64): Required - Automation Run ID. 70 | -------------------------------------------------------------------------------- /docs/bandwidth_snapshot.md: -------------------------------------------------------------------------------- 1 | # BandwidthSnapshot 2 | 3 | ## Example BandwidthSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "bytes_received": 1.0, 9 | "bytes_sent": 1.0, 10 | "sync_bytes_received": 1.0, 11 | "sync_bytes_sent": 1.0, 12 | "requests_get": 1.0, 13 | "requests_put": 1.0, 14 | "requests_other": 1.0, 15 | "logged_at": "2000-01-01T01:00:00Z" 16 | } 17 | ``` 18 | 19 | * `id` (int64): Site bandwidth ID 20 | * `bytes_received` (double): Site bandwidth report bytes received 21 | * `bytes_sent` (double): Site bandwidth report bytes sent 22 | * `sync_bytes_received` (double): Site sync bandwidth report bytes received 23 | * `sync_bytes_sent` (double): Site sync bandwidth report bytes sent 24 | * `requests_get` (double): Site bandwidth report get requests 25 | * `requests_put` (double): Site bandwidth report put requests 26 | * `requests_other` (double): Site bandwidth report other requests 27 | * `logged_at` (date-time): Time the site bandwidth report was logged 28 | 29 | 30 | --- 31 | 32 | ## List Bandwidth Snapshots 33 | 34 | ``` 35 | Files::BandwidthSnapshot.list 36 | ``` 37 | 38 | ### Parameters 39 | 40 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 41 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 43 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 44 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 45 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 46 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 47 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 48 | -------------------------------------------------------------------------------- /docs/bundle_action.md: -------------------------------------------------------------------------------- 1 | # BundleAction 2 | 3 | ## Example BundleAction Object 4 | 5 | ``` 6 | { 7 | "action": "create", 8 | "bundle_registration": { 9 | "code": "abc123", 10 | "name": "account", 11 | "company": "Action Verb", 12 | "email": "john.doe@files.com", 13 | "ip": "10.1.1.1", 14 | "inbox_code": "abc123", 15 | "clickwrap_body": "example", 16 | "form_field_set_id": 1, 17 | "form_field_data": { 18 | "key": "example value" 19 | }, 20 | "bundle_code": "example", 21 | "bundle_id": 1, 22 | "bundle_recipient_id": 1, 23 | "created_at": "2000-01-01T01:00:00Z" 24 | }, 25 | "created_at": "2000-01-01T01:00:00Z", 26 | "destination": "/to_path", 27 | "path": "", 28 | "source": "/from_path" 29 | } 30 | ``` 31 | 32 | * `action` (string): Type of action 33 | * `bundle_registration` (BundleRegistration): Object that contains bundle registration information 34 | * `created_at` (date-time): Action occurrence date/time 35 | * `destination` (string): The destination path for this bundle action, if applicable 36 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 37 | * `source` (string): The source path for this bundle action, if applicable 38 | 39 | 40 | --- 41 | 42 | ## List Bundle Actions 43 | 44 | ``` 45 | Files::BundleAction.list( 46 | user_id: 1 47 | ) 48 | ``` 49 | 50 | ### Parameters 51 | 52 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 53 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 54 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 55 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 56 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`. 57 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 58 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 59 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 60 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 61 | -------------------------------------------------------------------------------- /docs/bundle_download.md: -------------------------------------------------------------------------------- 1 | # BundleDownload 2 | 3 | ## Example BundleDownload Object 4 | 5 | ``` 6 | { 7 | "bundle_registration": { 8 | "code": "abc123", 9 | "name": "account", 10 | "company": "Action Verb", 11 | "email": "john.doe@files.com", 12 | "ip": "10.1.1.1", 13 | "inbox_code": "abc123", 14 | "clickwrap_body": "example", 15 | "form_field_set_id": 1, 16 | "form_field_data": { 17 | "key": "example value" 18 | }, 19 | "bundle_code": "example", 20 | "bundle_id": 1, 21 | "bundle_recipient_id": 1, 22 | "created_at": "2000-01-01T01:00:00Z" 23 | }, 24 | "download_method": "file", 25 | "path": "a/b/test.txt", 26 | "created_at": "2000-01-01T01:00:00Z" 27 | } 28 | ``` 29 | 30 | * `bundle_registration` (BundleRegistration): 31 | * `download_method` (string): Download method (file or full_zip) 32 | * `path` (string): Download path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 33 | * `created_at` (date-time): Download date/time 34 | 35 | 36 | --- 37 | 38 | ## List Bundle Downloads 39 | 40 | ``` 41 | Files::BundleDownload.list( 42 | bundle_id: 1, 43 | bundle_registration_id: 1 44 | ) 45 | ``` 46 | 47 | ### Parameters 48 | 49 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 50 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 51 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 52 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`. 53 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 54 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 55 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 56 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 57 | * `bundle_id` (int64): Bundle ID 58 | * `bundle_registration_id` (int64): BundleRegistration ID 59 | -------------------------------------------------------------------------------- /docs/bundle_path.md: -------------------------------------------------------------------------------- 1 | # BundlePath 2 | 3 | ## Example BundlePath Object 4 | 5 | ``` 6 | { 7 | "recursive": true, 8 | "path": "example" 9 | } 10 | ``` 11 | 12 | * `recursive` (boolean): Allow access to subfolders content? 13 | * `path` (string): The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 14 | -------------------------------------------------------------------------------- /docs/bundle_recipient.md: -------------------------------------------------------------------------------- 1 | # BundleRecipient 2 | 3 | ## Example BundleRecipient Object 4 | 5 | ``` 6 | { 7 | "company": "Acme Inc.", 8 | "name": "John Doe", 9 | "note": "Some note.", 10 | "recipient": "john.doe@example.com", 11 | "sent_at": "2000-01-01T01:00:00Z" 12 | } 13 | ``` 14 | 15 | * `company` (string): The recipient's company. 16 | * `name` (string): The recipient's name. 17 | * `note` (string): A note sent to the recipient with the bundle. 18 | * `recipient` (string): The recipient's email address. 19 | * `sent_at` (date-time): When the Bundle was shared with this recipient. 20 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 21 | * `bundle_id` (int64): Bundle to share. 22 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 23 | 24 | 25 | --- 26 | 27 | ## List Bundle Recipients 28 | 29 | ``` 30 | Files::BundleRecipient.list( 31 | user_id: 1, 32 | bundle_id: 1 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 39 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 40 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 42 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`. 43 | * `bundle_id` (int64): Required - List recipients for the bundle with this ID. 44 | 45 | 46 | --- 47 | 48 | ## Create Bundle Recipient 49 | 50 | ``` 51 | Files::BundleRecipient.create( 52 | user_id: 1, 53 | bundle_id: 1, 54 | recipient: "johndoe@gmail.com", 55 | name: "John Smith", 56 | company: "Acme Ltd", 57 | note: "Just a note.", 58 | share_after_create: false 59 | ) 60 | ``` 61 | 62 | ### Parameters 63 | 64 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 65 | * `bundle_id` (int64): Required - Bundle to share. 66 | * `recipient` (string): Required - Email addresses to share this bundle with. 67 | * `name` (string): Name of recipient. 68 | * `company` (string): Company of recipient. 69 | * `note` (string): Note to include in email. 70 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 71 | -------------------------------------------------------------------------------- /docs/bundle_registration.md: -------------------------------------------------------------------------------- 1 | # BundleRegistration 2 | 3 | ## Example BundleRegistration Object 4 | 5 | ``` 6 | { 7 | "code": "abc123", 8 | "name": "account", 9 | "company": "Action Verb", 10 | "email": "john.doe@files.com", 11 | "ip": "10.1.1.1", 12 | "inbox_code": "abc123", 13 | "clickwrap_body": "example", 14 | "form_field_set_id": 1, 15 | "form_field_data": { 16 | "key": "example value" 17 | }, 18 | "bundle_code": "example", 19 | "bundle_id": 1, 20 | "bundle_recipient_id": 1, 21 | "created_at": "2000-01-01T01:00:00Z" 22 | } 23 | ``` 24 | 25 | * `code` (string): Registration cookie code 26 | * `name` (string): Registrant name 27 | * `company` (string): Registrant company name 28 | * `email` (string): Registrant email address 29 | * `ip` (string): Registrant IP Address 30 | * `inbox_code` (string): InboxRegistration cookie code, if there is an associated InboxRegistration 31 | * `clickwrap_body` (string): Clickwrap text that was shown to the registrant 32 | * `form_field_set_id` (int64): Id of associated form field set 33 | * `form_field_data` (object): Data for form field set with form field ids as keys and user data as values 34 | * `bundle_code` (string): Bundle URL code 35 | * `bundle_id` (int64): Id of associated bundle 36 | * `bundle_recipient_id` (int64): Id of associated bundle recipient 37 | * `created_at` (date-time): Registration creation date/time 38 | 39 | 40 | --- 41 | 42 | ## List Bundle Registrations 43 | 44 | ``` 45 | Files::BundleRegistration.list( 46 | user_id: 1, 47 | bundle_id: 1 48 | ) 49 | ``` 50 | 51 | ### Parameters 52 | 53 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 54 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 55 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 56 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`. 57 | * `bundle_id` (int64): ID of the associated Bundle 58 | -------------------------------------------------------------------------------- /docs/dns_record.md: -------------------------------------------------------------------------------- 1 | # DnsRecord 2 | 3 | ## Example DnsRecord Object 4 | 5 | ``` 6 | { 7 | "id": "customdomain.com-CNAME-site.files.com", 8 | "domain": "my-custom-domain.com", 9 | "rrtype": "CNAME", 10 | "value": "mysite.files.com" 11 | } 12 | ``` 13 | 14 | * `id` (string): Unique label for DNS record; used by Zapier and other integrations. 15 | * `domain` (string): DNS record domain name 16 | * `rrtype` (string): DNS record type 17 | * `value` (string): DNS record value 18 | 19 | 20 | --- 21 | 22 | ## Show Site DNS Configuration 23 | 24 | ``` 25 | Files::DnsRecord.list 26 | ``` 27 | 28 | ### Parameters 29 | 30 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 31 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 32 | -------------------------------------------------------------------------------- /docs/email_incoming_message.md: -------------------------------------------------------------------------------- 1 | # EmailIncomingMessage 2 | 3 | ## Example EmailIncomingMessage Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "inbox_id": 1, 9 | "sender": "example", 10 | "sender_name": "example", 11 | "status": "success", 12 | "body": "example", 13 | "message": "example", 14 | "created_at": "2000-01-01T01:00:00Z", 15 | "inbox_title": "Inbox Title" 16 | } 17 | ``` 18 | 19 | * `id` (int64): Id of the Email Incoming Message 20 | * `inbox_id` (int64): Id of the Inbox associated with this message 21 | * `sender` (string): Sender of the email 22 | * `sender_name` (string): Sender name 23 | * `status` (string): Status of the message 24 | * `body` (string): Body of the email 25 | * `message` (string): Message describing the failure 26 | * `created_at` (date-time): Message creation date/time 27 | * `inbox_title` (string): Title of the Inbox associated with this message 28 | 29 | 30 | --- 31 | 32 | ## List Email Incoming Messages 33 | 34 | ``` 35 | Files::EmailIncomingMessage.list 36 | ``` 37 | 38 | ### Parameters 39 | 40 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 41 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `sender`, `status` or `inbox_id`. 43 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `inbox_id`, `sender` or `status`. Valid field combinations are `[ inbox_id, created_at ]`, `[ sender, created_at ]`, `[ status, created_at ]`, `[ inbox_id, status ]`, `[ status, sender ]`, `[ inbox_id, status, created_at ]`, `[ status, sender, created_at ]`, `[ inbox_id, status, sender ]` or `[ inbox_id, status, sender, created_at ]`. 44 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 45 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 46 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `sender`. 47 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 48 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 49 | -------------------------------------------------------------------------------- /docs/email_log.md: -------------------------------------------------------------------------------- 1 | # EmailLog 2 | 3 | ## Example EmailLog Object 4 | 5 | ``` 6 | { 7 | "timestamp": "2000-01-01T01:00:00Z", 8 | "message": "example", 9 | "status": "example", 10 | "subject": "example", 11 | "to": "example", 12 | "cc": "example", 13 | "delivery_method": "example", 14 | "smtp_hostname": "example", 15 | "smtp_ip": "example" 16 | } 17 | ``` 18 | 19 | * `timestamp` (date-time): Start Time of Action 20 | * `message` (string): Log Message 21 | * `status` (string): Status of E-Mail delivery 22 | * `subject` (string): Subject line of E-Mail 23 | * `to` (string): To field of E-Mail 24 | * `cc` (string): CC field of E-Mail 25 | * `delivery_method` (string): How was the email delivered? `customer_smtp` or `files.com` 26 | * `smtp_hostname` (string): Customer SMTP Hostname used. 27 | * `smtp_ip` (string): Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP). 28 | 29 | 30 | --- 31 | 32 | ## List Email Logs 33 | 34 | ``` 35 | Files::EmailLog.list 36 | ``` 37 | 38 | ### Parameters 39 | 40 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 41 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `start_date`, `end_date` or `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 43 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 44 | -------------------------------------------------------------------------------- /docs/errors.md: -------------------------------------------------------------------------------- 1 | # Errors 2 | 3 | ## Example Errors Object 4 | 5 | ``` 6 | { 7 | "fields": [ 8 | 9 | ], 10 | "messages": [ 11 | 12 | ] 13 | } 14 | ``` 15 | 16 | * `fields` (array(string)): A list of fields where errors occur 17 | * `messages` (array(string)): A list of error messages 18 | -------------------------------------------------------------------------------- /docs/file_action.md: -------------------------------------------------------------------------------- 1 | # FileAction 2 | 3 | ## Example FileAction Object 4 | 5 | ``` 6 | { 7 | "status": "pending", 8 | "file_migration_id": 1 9 | } 10 | ``` 11 | 12 | * `status` (string): Status of file operation. 13 | * `file_migration_id` (int64): If status is pending, this is the id of the File Migration to check for status updates. 14 | -------------------------------------------------------------------------------- /docs/file_comment.md: -------------------------------------------------------------------------------- 1 | # FileComment 2 | 3 | ## Example FileComment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "body": "What a great file!", 9 | "reactions": [ 10 | { 11 | "id": 1, 12 | "emoji": "👍" 13 | } 14 | ] 15 | } 16 | ``` 17 | 18 | * `id` (int64): File Comment ID 19 | * `body` (string): Comment body. 20 | * `reactions` (array(object)): Reactions to this comment. 21 | * `path` (string): File path. 22 | 23 | 24 | --- 25 | 26 | ## List File Comments by Path 27 | 28 | ``` 29 | Files::FileComment.list_for(path) 30 | ``` 31 | 32 | ### Parameters 33 | 34 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 35 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 36 | * `path` (string): Required - Path to operate on. 37 | 38 | 39 | --- 40 | 41 | ## Create File Comment 42 | 43 | ``` 44 | Files::FileComment.create( 45 | body: "body", 46 | path: "path" 47 | ) 48 | ``` 49 | 50 | ### Parameters 51 | 52 | * `body` (string): Required - Comment body. 53 | * `path` (string): Required - File path. 54 | 55 | 56 | --- 57 | 58 | ## Update File Comment 59 | 60 | ``` 61 | Files::FileComment.update(id, 62 | body: "body" 63 | ) 64 | ``` 65 | 66 | ### Parameters 67 | 68 | * `id` (int64): Required - File Comment ID. 69 | * `body` (string): Required - Comment body. 70 | 71 | 72 | --- 73 | 74 | ## Delete File Comment 75 | 76 | ``` 77 | Files::FileComment.delete(id) 78 | ``` 79 | 80 | ### Parameters 81 | 82 | * `id` (int64): Required - File Comment ID. 83 | 84 | 85 | --- 86 | 87 | ## Update File Comment 88 | 89 | ``` 90 | file_comment = Files::FileComment.list.first 91 | 92 | file_comment.update( 93 | body: "body" 94 | ) 95 | ``` 96 | 97 | ### Parameters 98 | 99 | * `id` (int64): Required - File Comment ID. 100 | * `body` (string): Required - Comment body. 101 | 102 | 103 | --- 104 | 105 | ## Delete File Comment 106 | 107 | ``` 108 | file_comment = Files::FileComment.list.first 109 | 110 | file_comment.delete 111 | ``` 112 | 113 | ### Parameters 114 | 115 | * `id` (int64): Required - File Comment ID. 116 | -------------------------------------------------------------------------------- /docs/file_comment_reaction.md: -------------------------------------------------------------------------------- 1 | # FileCommentReaction 2 | 3 | ## Example FileCommentReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Reaction ID 13 | * `emoji` (string): Emoji used in the reaction. 14 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 15 | * `file_comment_id` (int64): ID of file comment to attach reaction to. 16 | 17 | 18 | --- 19 | 20 | ## Create File Comment Reaction 21 | 22 | ``` 23 | Files::FileCommentReaction.create( 24 | user_id: 1, 25 | file_comment_id: 1, 26 | emoji: "emoji" 27 | ) 28 | ``` 29 | 30 | ### Parameters 31 | 32 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 33 | * `file_comment_id` (int64): Required - ID of file comment to attach reaction to. 34 | * `emoji` (string): Required - Emoji to react with. 35 | 36 | 37 | --- 38 | 39 | ## Delete File Comment Reaction 40 | 41 | ``` 42 | Files::FileCommentReaction.delete(id) 43 | ``` 44 | 45 | ### Parameters 46 | 47 | * `id` (int64): Required - File Comment Reaction ID. 48 | 49 | 50 | --- 51 | 52 | ## Delete File Comment Reaction 53 | 54 | ``` 55 | file_comment_reaction = Files::FileCommentReaction.new 56 | 57 | file_comment_reaction.delete 58 | ``` 59 | 60 | ### Parameters 61 | 62 | * `id` (int64): Required - File Comment Reaction ID. 63 | -------------------------------------------------------------------------------- /docs/file_migration.md: -------------------------------------------------------------------------------- 1 | # FileMigration 2 | 3 | ## Example FileMigration Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "MyFolder", 9 | "dest_path": "MyFolder", 10 | "files_moved": 1, 11 | "files_total": 1, 12 | "operation": "move", 13 | "region": "USA", 14 | "status": "complete", 15 | "log_url": "https://www.example.com/log_file" 16 | } 17 | ``` 18 | 19 | * `id` (int64): File migration ID 20 | * `path` (string): Source path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 21 | * `dest_path` (string): Destination path 22 | * `files_moved` (int64): Number of files processed 23 | * `files_total` (int64): 24 | * `operation` (string): The type of operation 25 | * `region` (string): Region 26 | * `status` (string): Status 27 | * `log_url` (string): Link to download the log file for this migration. 28 | 29 | 30 | --- 31 | 32 | ## Show File Migration 33 | 34 | ``` 35 | Files::FileMigration.find(id) 36 | ``` 37 | 38 | ### Parameters 39 | 40 | * `id` (int64): Required - File Migration ID. 41 | -------------------------------------------------------------------------------- /docs/file_upload_part.md: -------------------------------------------------------------------------------- 1 | # FileUploadPart 2 | 3 | ## Example FileUploadPart Object 4 | 5 | ``` 6 | { 7 | "send": { 8 | "key": "example value" 9 | }, 10 | "action": "multipart", 11 | "ask_about_overwrites": true, 12 | "available_parts": 1, 13 | "expires": "example", 14 | "headers": { 15 | "key": "example value" 16 | }, 17 | "http_method": "PUT", 18 | "next_partsize": 1, 19 | "parallel_parts": true, 20 | "retry_parts": true, 21 | "parameters": { 22 | "key": "example value" 23 | }, 24 | "part_number": 1, 25 | "partsize": 1, 26 | "path": "", 27 | "ref": "upload-1", 28 | "upload_uri": "example" 29 | } 30 | ``` 31 | 32 | * `send` (object): Content-Type and File to send 33 | * `action` (string): Type of upload 34 | * `ask_about_overwrites` (boolean): If `true`, this file exists and you may wish to ask the user for overwrite confirmation 35 | * `available_parts` (int64): Number of parts in the upload 36 | * `expires` (string): Date/time of when this Upload part expires and the URL cannot be used any more 37 | * `headers` (object): Additional upload headers to provide as part of the upload 38 | * `http_method` (string): HTTP Method to use for uploading the part, usually `PUT` 39 | * `next_partsize` (int64): Size in bytes for this part 40 | * `parallel_parts` (boolean): If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order. 41 | * `retry_parts` (boolean): If `true`, parts may be retried. If `false`, a part cannot be retried and the upload should be restarted. 42 | * `parameters` (object): Additional HTTP parameters to send with the upload 43 | * `part_number` (int64): Number of this upload part 44 | * `partsize` (int64): Size in bytes for the next upload part 45 | * `path` (string): New file path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 46 | * `ref` (string): Reference name for this upload part 47 | * `upload_uri` (string): URI to upload this part to 48 | -------------------------------------------------------------------------------- /docs/file_utils.md: -------------------------------------------------------------------------------- 1 | # FileUtils 2 | 3 | The Files::FileUtils object emulates a Ruby FileUtils object and can be used in 4 | may places where a Ruby FileUtils object can be used. 5 | -------------------------------------------------------------------------------- /docs/form_field.md: -------------------------------------------------------------------------------- 1 | # FormField 2 | 3 | ## Example FormField Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "label": "Sample Label", 9 | "required": true, 10 | "help_text": "Help Text", 11 | "field_type": "text", 12 | "options_for_select": [ 13 | "red", 14 | "green", 15 | "blue" 16 | ], 17 | "default_option": "red", 18 | "form_field_set_id": 1 19 | } 20 | ``` 21 | 22 | * `id` (int64): Form field id 23 | * `label` (string): Label to be displayed 24 | * `required` (boolean): Is this a required field? 25 | * `help_text` (string): Help text to be displayed 26 | * `field_type` (string): Type of Field 27 | * `options_for_select` (array(string)): Options to display for radio and dropdown 28 | * `default_option` (string): Default option for radio and dropdown 29 | * `form_field_set_id` (int64): Form field set id 30 | -------------------------------------------------------------------------------- /docs/group_user.md: -------------------------------------------------------------------------------- 1 | # GroupUser 2 | 3 | ## Example GroupUser Object 4 | 5 | ``` 6 | { 7 | "group_name": "My Group", 8 | "group_id": 1, 9 | "user_id": 1, 10 | "admin": true, 11 | "usernames": "user" 12 | } 13 | ``` 14 | 15 | * `group_name` (string): Group name 16 | * `group_id` (int64): Group ID 17 | * `user_id` (int64): User ID 18 | * `admin` (boolean): Is this user an administrator of this group? 19 | * `usernames` (string): Comma-delimited list of usernames who belong to this group (separated by commas). 20 | * `id` (int64): Group User ID. 21 | 22 | 23 | --- 24 | 25 | ## List Group Users 26 | 27 | ``` 28 | Files::GroupUser.list( 29 | user_id: 1, 30 | group_id: 1 31 | ) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | * `user_id` (int64): User ID. If provided, will return group_users of this user. 37 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 38 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 39 | * `group_id` (int64): Group ID. If provided, will return group_users of this group. 40 | 41 | 42 | --- 43 | 44 | ## Create Group User 45 | 46 | ``` 47 | Files::GroupUser.create( 48 | group_id: 1, 49 | user_id: 1, 50 | admin: false 51 | ) 52 | ``` 53 | 54 | ### Parameters 55 | 56 | * `group_id` (int64): Required - Group ID to add user to. 57 | * `user_id` (int64): Required - User ID to add to group. 58 | * `admin` (boolean): Is the user a group administrator? 59 | 60 | 61 | --- 62 | 63 | ## Update Group User 64 | 65 | ``` 66 | Files::GroupUser.update(id, 67 | group_id: 1, 68 | user_id: 1, 69 | admin: false 70 | ) 71 | ``` 72 | 73 | ### Parameters 74 | 75 | * `id` (int64): Required - Group User ID. 76 | * `group_id` (int64): Required - Group ID to add user to. 77 | * `user_id` (int64): Required - User ID to add to group. 78 | * `admin` (boolean): Is the user a group administrator? 79 | 80 | 81 | --- 82 | 83 | ## Delete Group User 84 | 85 | ``` 86 | Files::GroupUser.delete(id, 87 | group_id: 1, 88 | user_id: 1 89 | ) 90 | ``` 91 | 92 | ### Parameters 93 | 94 | * `id` (int64): Required - Group User ID. 95 | * `group_id` (int64): Required - Group ID from which to remove user. 96 | * `user_id` (int64): Required - User ID to remove from group. 97 | 98 | 99 | --- 100 | 101 | ## Update Group User 102 | 103 | ``` 104 | group_user = Files::GroupUser.list.first 105 | 106 | group_user.update( 107 | group_id: 1, 108 | user_id: 1, 109 | admin: false 110 | ) 111 | ``` 112 | 113 | ### Parameters 114 | 115 | * `id` (int64): Required - Group User ID. 116 | * `group_id` (int64): Required - Group ID to add user to. 117 | * `user_id` (int64): Required - User ID to add to group. 118 | * `admin` (boolean): Is the user a group administrator? 119 | 120 | 121 | --- 122 | 123 | ## Delete Group User 124 | 125 | ``` 126 | group_user = Files::GroupUser.list.first 127 | 128 | group_user.delete( 129 | group_id: 1, 130 | user_id: 1 131 | ) 132 | ``` 133 | 134 | ### Parameters 135 | 136 | * `id` (int64): Required - Group User ID. 137 | * `group_id` (int64): Required - Group ID from which to remove user. 138 | * `user_id` (int64): Required - User ID to remove from group. 139 | -------------------------------------------------------------------------------- /docs/image.md: -------------------------------------------------------------------------------- 1 | # Image 2 | 3 | ## Example Image Object 4 | 5 | ``` 6 | { 7 | "name": "My logo", 8 | "uri": "https://mysite.files.com/.../my_image.png" 9 | } 10 | ``` 11 | 12 | * `name` (string): Image name 13 | * `uri` (string): Image URI 14 | -------------------------------------------------------------------------------- /docs/inbox_recipient.md: -------------------------------------------------------------------------------- 1 | # InboxRecipient 2 | 3 | ## Example InboxRecipient Object 4 | 5 | ``` 6 | { 7 | "company": "Acme Inc.", 8 | "name": "John Doe", 9 | "note": "Some note.", 10 | "recipient": "john.doe@example.com", 11 | "sent_at": "2000-01-01T01:00:00Z" 12 | } 13 | ``` 14 | 15 | * `company` (string): The recipient's company. 16 | * `name` (string): The recipient's name. 17 | * `note` (string): A note sent to the recipient with the inbox. 18 | * `recipient` (string): The recipient's email address. 19 | * `sent_at` (date-time): When the Inbox was shared with this recipient. 20 | * `inbox_id` (int64): Inbox to share. 21 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 22 | 23 | 24 | --- 25 | 26 | ## List Inbox Recipients 27 | 28 | ``` 29 | Files::InboxRecipient.list( 30 | inbox_id: 1 31 | ) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 37 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 38 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 39 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`. 40 | * `inbox_id` (int64): Required - List recipients for the inbox with this ID. 41 | 42 | 43 | --- 44 | 45 | ## Create Inbox Recipient 46 | 47 | ``` 48 | Files::InboxRecipient.create( 49 | inbox_id: 1, 50 | recipient: "johndoe@gmail.com", 51 | name: "John Smith", 52 | company: "Acme Ltd", 53 | note: "Just a note.", 54 | share_after_create: false 55 | ) 56 | ``` 57 | 58 | ### Parameters 59 | 60 | * `inbox_id` (int64): Required - Inbox to share. 61 | * `recipient` (string): Required - Email address to share this inbox with. 62 | * `name` (string): Name of recipient. 63 | * `company` (string): Company of recipient. 64 | * `note` (string): Note to include in email. 65 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 66 | -------------------------------------------------------------------------------- /docs/inbox_registration.md: -------------------------------------------------------------------------------- 1 | # InboxRegistration 2 | 3 | ## Example InboxRegistration Object 4 | 5 | ``` 6 | { 7 | "code": "abc123", 8 | "name": "account", 9 | "company": "Action Verb", 10 | "email": "john.doe@files.com", 11 | "ip": "10.1.1.1", 12 | "clickwrap_body": "example", 13 | "form_field_set_id": 1, 14 | "form_field_data": { 15 | "key": "example value" 16 | }, 17 | "inbox_id": 1, 18 | "inbox_recipient_id": 1, 19 | "inbox_title": "example", 20 | "created_at": "2000-01-01T01:00:00Z" 21 | } 22 | ``` 23 | 24 | * `code` (string): Registration cookie code 25 | * `name` (string): Registrant name 26 | * `company` (string): Registrant company name 27 | * `email` (string): Registrant email address 28 | * `ip` (string): Registrant IP Address 29 | * `clickwrap_body` (string): Clickwrap text that was shown to the registrant 30 | * `form_field_set_id` (int64): Id of associated form field set 31 | * `form_field_data` (object): Data for form field set with form field ids as keys and user data as values 32 | * `inbox_id` (int64): Id of associated inbox 33 | * `inbox_recipient_id` (int64): Id of associated inbox recipient 34 | * `inbox_title` (string): Title of associated inbox 35 | * `created_at` (date-time): Registration creation date/time 36 | 37 | 38 | --- 39 | 40 | ## List Inbox Registrations 41 | 42 | ``` 43 | Files::InboxRegistration.list( 44 | folder_behavior_id: 1 45 | ) 46 | ``` 47 | 48 | ### Parameters 49 | 50 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 51 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 52 | * `folder_behavior_id` (int64): ID of the associated Inbox. 53 | -------------------------------------------------------------------------------- /docs/inbox_upload.md: -------------------------------------------------------------------------------- 1 | # InboxUpload 2 | 3 | ## Example InboxUpload Object 4 | 5 | ``` 6 | { 7 | "inbox_registration": { 8 | "code": "abc123", 9 | "name": "account", 10 | "company": "Action Verb", 11 | "email": "john.doe@files.com", 12 | "ip": "10.1.1.1", 13 | "clickwrap_body": "example", 14 | "form_field_set_id": 1, 15 | "form_field_data": { 16 | "key": "example value" 17 | }, 18 | "inbox_id": 1, 19 | "inbox_recipient_id": 1, 20 | "inbox_title": "example", 21 | "created_at": "2000-01-01T01:00:00Z" 22 | }, 23 | "path": "a/b/test.txt", 24 | "created_at": "2000-01-01T01:00:00Z" 25 | } 26 | ``` 27 | 28 | * `inbox_registration` (InboxRegistration): 29 | * `path` (string): Upload path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 30 | * `created_at` (date-time): Upload date/time 31 | 32 | 33 | --- 34 | 35 | ## List Inbox Uploads 36 | 37 | ``` 38 | Files::InboxUpload.list 39 | ``` 40 | 41 | ### Parameters 42 | 43 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 44 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 45 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 46 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `folder_behavior_id` or `inbox_registration_id`. Valid field combinations are `[ folder_behavior_id, created_at ]`, `[ inbox_registration_id, created_at ]`, `[ folder_behavior_id, inbox_registration_id ]` or `[ folder_behavior_id, inbox_registration_id, created_at ]`. 47 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 48 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 49 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 50 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 51 | -------------------------------------------------------------------------------- /docs/invoice.md: -------------------------------------------------------------------------------- 1 | # Invoice 2 | 3 | ## Example Invoice Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "amount": 1.0, 16 | "created_at": "2000-01-01T01:00:00Z", 17 | "description": "Service from 2019-01-01 through 2019-12-31", 18 | "type": "invoice", 19 | "service_end_at": "2000-01-01T01:00:00Z", 20 | "service_start_at": "2000-01-01T01:00:00Z", 21 | "plan": "Premier", 22 | "site": "My site" 23 | } 24 | ], 25 | "method": "paypal", 26 | "payment_line_items": [ 27 | { 28 | "amount": 1.0, 29 | "created_at": "2000-01-01T01:00:00Z", 30 | "invoice_id": 1, 31 | "payment_id": 1 32 | } 33 | ], 34 | "payment_reversed_at": "2000-01-01T01:00:00Z", 35 | "payment_type": "example", 36 | "site_name": "My Site", 37 | "type": "invoice" 38 | } 39 | ``` 40 | 41 | * `id` (int64): Line item Id 42 | * `amount` (double): Line item amount 43 | * `balance` (double): Line item balance 44 | * `created_at` (date-time): Line item created at 45 | * `currency` (string): Line item currency 46 | * `download_uri` (string): Line item download uri 47 | * `invoice_line_items` (array(object)): Associated invoice line items 48 | * `method` (string): Line item payment method 49 | * `payment_line_items` (array(object)): Associated payment line items 50 | * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable 51 | * `payment_type` (string): Type of payment if applicable 52 | * `site_name` (string): Site name this line item is for 53 | * `type` (string): Type of line item, either payment or invoice 54 | 55 | 56 | --- 57 | 58 | ## List Invoices 59 | 60 | ``` 61 | Files::Invoice.list 62 | ``` 63 | 64 | ### Parameters 65 | 66 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 67 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 68 | 69 | 70 | --- 71 | 72 | ## Show Invoice 73 | 74 | ``` 75 | Files::Invoice.find(id) 76 | ``` 77 | 78 | ### Parameters 79 | 80 | * `id` (int64): Required - Invoice ID. 81 | -------------------------------------------------------------------------------- /docs/invoice_line_item.md: -------------------------------------------------------------------------------- 1 | # InvoiceLineItem 2 | 3 | ## Example InvoiceLineItem Object 4 | 5 | ``` 6 | { 7 | "amount": 1.0, 8 | "created_at": "2000-01-01T01:00:00Z", 9 | "description": "Service from 2019-01-01 through 2019-12-31", 10 | "type": "invoice", 11 | "service_end_at": "2000-01-01T01:00:00Z", 12 | "service_start_at": "2000-01-01T01:00:00Z", 13 | "plan": "Premier", 14 | "site": "My site" 15 | } 16 | ``` 17 | 18 | * `amount` (double): Invoice line item amount 19 | * `created_at` (date-time): Invoice line item created at date/time 20 | * `description` (string): Invoice line item description 21 | * `type` (string): Invoice line item type 22 | * `service_end_at` (date-time): Invoice line item service end date/time 23 | * `service_start_at` (date-time): Invoice line item service start date/time 24 | * `plan` (string): Plan name 25 | * `site` (string): Site name 26 | -------------------------------------------------------------------------------- /docs/ip_address.md: -------------------------------------------------------------------------------- 1 | # IpAddress 2 | 3 | ## Example IpAddress Object 4 | 5 | ``` 6 | { 7 | "id": "Site", 8 | "associated_with": "Site", 9 | "group_id": 1, 10 | "ip_addresses": [ 11 | "127.0.0.1" 12 | ] 13 | } 14 | ``` 15 | 16 | * `id` (string): Unique label for list; used by Zapier and other integrations. 17 | * `associated_with` (string): The object that this public IP address list is associated with. 18 | * `group_id` (int64): Group ID 19 | * `ip_addresses` (array(string)): A list of IP addresses. 20 | 21 | 22 | --- 23 | 24 | ## List IP Addresses associated with the current site 25 | 26 | ``` 27 | Files::IpAddress.list 28 | ``` 29 | 30 | ### Parameters 31 | 32 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 33 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | 35 | 36 | --- 37 | 38 | ## List all possible public SmartFile IP addresses 39 | 40 | ``` 41 | Files::IpAddress.get_smartfile_reserved 42 | ``` 43 | 44 | ### Parameters 45 | 46 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 47 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 48 | 49 | 50 | --- 51 | 52 | ## List all possible public ExaVault IP addresses 53 | 54 | ``` 55 | Files::IpAddress.get_exavault_reserved 56 | ``` 57 | 58 | ### Parameters 59 | 60 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 61 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 62 | 63 | 64 | --- 65 | 66 | ## List all possible public IP addresses 67 | 68 | ``` 69 | Files::IpAddress.get_reserved 70 | ``` 71 | 72 | ### Parameters 73 | 74 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 75 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 76 | -------------------------------------------------------------------------------- /docs/lock.md: -------------------------------------------------------------------------------- 1 | # Lock 2 | 3 | ## Example Lock Object 4 | 5 | ``` 6 | { 7 | "path": "locked_file", 8 | "timeout": 1, 9 | "depth": "infinity", 10 | "recursive": true, 11 | "owner": "user", 12 | "scope": "shared", 13 | "exclusive": true, 14 | "token": "17c54824e9931a4688ca032d03f6663c", 15 | "type": "write", 16 | "allow_access_by_any_user": true, 17 | "user_id": 1, 18 | "username": "" 19 | } 20 | ``` 21 | 22 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 23 | * `timeout` (int64): Lock timeout in seconds 24 | * `depth` (string): 25 | * `recursive` (boolean): Does lock apply to subfolders? 26 | * `owner` (string): Owner of the lock. This can be any arbitrary string. 27 | * `scope` (string): 28 | * `exclusive` (boolean): Is lock exclusive? 29 | * `token` (string): Lock token. Use to release lock. 30 | * `type` (string): 31 | * `allow_access_by_any_user` (boolean): Can lock be modified by users other than its creator? 32 | * `user_id` (int64): Lock creator user ID 33 | * `username` (string): Lock creator username 34 | 35 | 36 | --- 37 | 38 | ## List Locks by Path 39 | 40 | ``` 41 | Files::Lock.list_for(path, 42 | include_children: false 43 | ) 44 | ``` 45 | 46 | ### Parameters 47 | 48 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 49 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 50 | * `path` (string): Required - Path to operate on. 51 | * `include_children` (boolean): Include locks from children objects? 52 | 53 | 54 | --- 55 | 56 | ## Create Lock 57 | 58 | ``` 59 | Files::Lock.create(path, 60 | allow_access_by_any_user: false, 61 | exclusive: false, 62 | recursive: true, 63 | timeout: 1 64 | ) 65 | ``` 66 | 67 | ### Parameters 68 | 69 | * `path` (string): Required - Path 70 | * `allow_access_by_any_user` (boolean): Can lock be modified by users other than its creator? 71 | * `exclusive` (boolean): Is lock exclusive? 72 | * `recursive` (boolean): Does lock apply to subfolders? 73 | * `timeout` (int64): Lock timeout in seconds 74 | 75 | 76 | --- 77 | 78 | ## Delete Lock 79 | 80 | ``` 81 | Files::Lock.delete(path, 82 | token: "token" 83 | ) 84 | ``` 85 | 86 | ### Parameters 87 | 88 | * `path` (string): Required - Path 89 | * `token` (string): Required - Lock token 90 | 91 | 92 | --- 93 | 94 | ## Delete Lock 95 | 96 | ``` 97 | lock = Files::Lock.list.first 98 | 99 | lock.delete( 100 | token: "token" 101 | ) 102 | ``` 103 | 104 | ### Parameters 105 | 106 | * `path` (string): Required - Path 107 | * `token` (string): Required - Lock token 108 | -------------------------------------------------------------------------------- /docs/message_comment.md: -------------------------------------------------------------------------------- 1 | # MessageComment 2 | 3 | ## Example MessageComment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "body": "What a great idea, thank you!", 9 | "reactions": [ 10 | { 11 | "id": 1, 12 | "emoji": "👍" 13 | } 14 | ] 15 | } 16 | ``` 17 | 18 | * `id` (int64): Message Comment ID 19 | * `body` (string): Comment body. 20 | * `reactions` (array(object)): Reactions to this comment. 21 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 22 | 23 | 24 | --- 25 | 26 | ## List Message Comments 27 | 28 | ``` 29 | Files::MessageComment.list( 30 | user_id: 1, 31 | message_id: 1 32 | ) 33 | ``` 34 | 35 | ### Parameters 36 | 37 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 38 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 41 | * `message_id` (int64): Required - Message comment to return comments for. 42 | 43 | 44 | --- 45 | 46 | ## Show Message Comment 47 | 48 | ``` 49 | Files::MessageComment.find(id) 50 | ``` 51 | 52 | ### Parameters 53 | 54 | * `id` (int64): Required - Message Comment ID. 55 | 56 | 57 | --- 58 | 59 | ## Create Message Comment 60 | 61 | ``` 62 | Files::MessageComment.create( 63 | user_id: 1, 64 | body: "body" 65 | ) 66 | ``` 67 | 68 | ### Parameters 69 | 70 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 71 | * `body` (string): Required - Comment body. 72 | 73 | 74 | --- 75 | 76 | ## Update Message Comment 77 | 78 | ``` 79 | Files::MessageComment.update(id, 80 | body: "body" 81 | ) 82 | ``` 83 | 84 | ### Parameters 85 | 86 | * `id` (int64): Required - Message Comment ID. 87 | * `body` (string): Required - Comment body. 88 | 89 | 90 | --- 91 | 92 | ## Delete Message Comment 93 | 94 | ``` 95 | Files::MessageComment.delete(id) 96 | ``` 97 | 98 | ### Parameters 99 | 100 | * `id` (int64): Required - Message Comment ID. 101 | 102 | 103 | --- 104 | 105 | ## Update Message Comment 106 | 107 | ``` 108 | message_comment = Files::MessageComment.find(id) 109 | 110 | message_comment.update( 111 | body: "body" 112 | ) 113 | ``` 114 | 115 | ### Parameters 116 | 117 | * `id` (int64): Required - Message Comment ID. 118 | * `body` (string): Required - Comment body. 119 | 120 | 121 | --- 122 | 123 | ## Delete Message Comment 124 | 125 | ``` 126 | message_comment = Files::MessageComment.find(id) 127 | 128 | message_comment.delete 129 | ``` 130 | 131 | ### Parameters 132 | 133 | * `id` (int64): Required - Message Comment ID. 134 | -------------------------------------------------------------------------------- /docs/message_comment_reaction.md: -------------------------------------------------------------------------------- 1 | # MessageCommentReaction 2 | 3 | ## Example MessageCommentReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Reaction ID 13 | * `emoji` (string): Emoji used in the reaction. 14 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 15 | 16 | 17 | --- 18 | 19 | ## List Message Comment Reactions 20 | 21 | ``` 22 | Files::MessageCommentReaction.list( 23 | user_id: 1, 24 | message_comment_id: 1 25 | ) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 31 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 32 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 33 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 34 | * `message_comment_id` (int64): Required - Message comment to return reactions for. 35 | 36 | 37 | --- 38 | 39 | ## Show Message Comment Reaction 40 | 41 | ``` 42 | Files::MessageCommentReaction.find(id) 43 | ``` 44 | 45 | ### Parameters 46 | 47 | * `id` (int64): Required - Message Comment Reaction ID. 48 | 49 | 50 | --- 51 | 52 | ## Create Message Comment Reaction 53 | 54 | ``` 55 | Files::MessageCommentReaction.create( 56 | user_id: 1, 57 | emoji: "emoji" 58 | ) 59 | ``` 60 | 61 | ### Parameters 62 | 63 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 64 | * `emoji` (string): Required - Emoji to react with. 65 | 66 | 67 | --- 68 | 69 | ## Delete Message Comment Reaction 70 | 71 | ``` 72 | Files::MessageCommentReaction.delete(id) 73 | ``` 74 | 75 | ### Parameters 76 | 77 | * `id` (int64): Required - Message Comment Reaction ID. 78 | 79 | 80 | --- 81 | 82 | ## Delete Message Comment Reaction 83 | 84 | ``` 85 | message_comment_reaction = Files::MessageCommentReaction.find(id) 86 | 87 | message_comment_reaction.delete 88 | ``` 89 | 90 | ### Parameters 91 | 92 | * `id` (int64): Required - Message Comment Reaction ID. 93 | -------------------------------------------------------------------------------- /docs/message_reaction.md: -------------------------------------------------------------------------------- 1 | # MessageReaction 2 | 3 | ## Example MessageReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Reaction ID 13 | * `emoji` (string): Emoji used in the reaction. 14 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 15 | 16 | 17 | --- 18 | 19 | ## List Message Reactions 20 | 21 | ``` 22 | Files::MessageReaction.list( 23 | user_id: 1, 24 | message_id: 1 25 | ) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 31 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 32 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 33 | * `message_id` (int64): Required - Message to return reactions for. 34 | 35 | 36 | --- 37 | 38 | ## Show Message Reaction 39 | 40 | ``` 41 | Files::MessageReaction.find(id) 42 | ``` 43 | 44 | ### Parameters 45 | 46 | * `id` (int64): Required - Message Reaction ID. 47 | 48 | 49 | --- 50 | 51 | ## Create Message Reaction 52 | 53 | ``` 54 | Files::MessageReaction.create( 55 | user_id: 1, 56 | emoji: "emoji" 57 | ) 58 | ``` 59 | 60 | ### Parameters 61 | 62 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 63 | * `emoji` (string): Required - Emoji to react with. 64 | 65 | 66 | --- 67 | 68 | ## Delete Message Reaction 69 | 70 | ``` 71 | Files::MessageReaction.delete(id) 72 | ``` 73 | 74 | ### Parameters 75 | 76 | * `id` (int64): Required - Message Reaction ID. 77 | 78 | 79 | --- 80 | 81 | ## Delete Message Reaction 82 | 83 | ``` 84 | message_reaction = Files::MessageReaction.find(id) 85 | 86 | message_reaction.delete 87 | ``` 88 | 89 | ### Parameters 90 | 91 | * `id` (int64): Required - Message Reaction ID. 92 | -------------------------------------------------------------------------------- /docs/payment.md: -------------------------------------------------------------------------------- 1 | # Payment 2 | 3 | ## Example Payment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "amount": 1.0, 16 | "created_at": "2000-01-01T01:00:00Z", 17 | "description": "Service from 2019-01-01 through 2019-12-31", 18 | "type": "invoice", 19 | "service_end_at": "2000-01-01T01:00:00Z", 20 | "service_start_at": "2000-01-01T01:00:00Z", 21 | "plan": "Premier", 22 | "site": "My site" 23 | } 24 | ], 25 | "method": "paypal", 26 | "payment_line_items": [ 27 | { 28 | "amount": 1.0, 29 | "created_at": "2000-01-01T01:00:00Z", 30 | "invoice_id": 1, 31 | "payment_id": 1 32 | } 33 | ], 34 | "payment_reversed_at": "2000-01-01T01:00:00Z", 35 | "payment_type": "example", 36 | "site_name": "My Site", 37 | "type": "invoice" 38 | } 39 | ``` 40 | 41 | * `id` (int64): Line item Id 42 | * `amount` (double): Line item amount 43 | * `balance` (double): Line item balance 44 | * `created_at` (date-time): Line item created at 45 | * `currency` (string): Line item currency 46 | * `download_uri` (string): Line item download uri 47 | * `invoice_line_items` (array(object)): Associated invoice line items 48 | * `method` (string): Line item payment method 49 | * `payment_line_items` (array(object)): Associated payment line items 50 | * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable 51 | * `payment_type` (string): Type of payment if applicable 52 | * `site_name` (string): Site name this line item is for 53 | * `type` (string): Type of line item, either payment or invoice 54 | 55 | 56 | --- 57 | 58 | ## List Payments 59 | 60 | ``` 61 | Files::Payment.list 62 | ``` 63 | 64 | ### Parameters 65 | 66 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 67 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 68 | 69 | 70 | --- 71 | 72 | ## Show Payment 73 | 74 | ``` 75 | Files::Payment.find(id) 76 | ``` 77 | 78 | ### Parameters 79 | 80 | * `id` (int64): Required - Payment ID. 81 | -------------------------------------------------------------------------------- /docs/payment_line_item.md: -------------------------------------------------------------------------------- 1 | # PaymentLineItem 2 | 3 | ## Example PaymentLineItem Object 4 | 5 | ``` 6 | { 7 | "amount": 1.0, 8 | "created_at": "2000-01-01T01:00:00Z", 9 | "invoice_id": 1, 10 | "payment_id": 1 11 | } 12 | ``` 13 | 14 | * `amount` (double): Payment line item amount 15 | * `created_at` (date-time): Payment line item created at date/time 16 | * `invoice_id` (int64): Invoice ID 17 | * `payment_id` (int64): Payment ID 18 | -------------------------------------------------------------------------------- /docs/preview.md: -------------------------------------------------------------------------------- 1 | # Preview 2 | 3 | ## Example Preview Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "status": "complete", 9 | "download_uri": "https://mysite.files.com/...", 10 | "type": "image", 11 | "size": "large" 12 | } 13 | ``` 14 | 15 | * `id` (int64): Preview ID 16 | * `status` (string): Preview status. Can be invalid, not_generated, generating, complete, or file_too_large 17 | * `download_uri` (string): Link to download preview 18 | * `type` (string): Preview type. Can be image, pdf, pdf_native, video, or audio 19 | * `size` (string): Preview size 20 | -------------------------------------------------------------------------------- /docs/priority.md: -------------------------------------------------------------------------------- 1 | # Priority 2 | 3 | ## Example Priority Object 4 | 5 | ``` 6 | { 7 | "path": "foo/bar", 8 | "color": "pink" 9 | } 10 | ``` 11 | 12 | * `path` (string): The path corresponding to the priority color. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 13 | * `color` (string): The priority color 14 | 15 | 16 | --- 17 | 18 | ## List Priorities 19 | 20 | ``` 21 | Files::Priority.list(path) 22 | ``` 23 | 24 | ### Parameters 25 | 26 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 27 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 28 | * `path` (string): Required - The path to query for priorities 29 | -------------------------------------------------------------------------------- /docs/project.md: -------------------------------------------------------------------------------- 1 | # Project 2 | 3 | ## Example Project Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "global_access": "none" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Project ID 13 | * `global_access` (string): Global access settings 14 | 15 | 16 | --- 17 | 18 | ## List Projects 19 | 20 | ``` 21 | Files::Project.list 22 | ``` 23 | 24 | ### Parameters 25 | 26 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 27 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 28 | 29 | 30 | --- 31 | 32 | ## Show Project 33 | 34 | ``` 35 | Files::Project.find(id) 36 | ``` 37 | 38 | ### Parameters 39 | 40 | * `id` (int64): Required - Project ID. 41 | 42 | 43 | --- 44 | 45 | ## Create Project 46 | 47 | ``` 48 | Files::Project.create( 49 | global_access: "global_access" 50 | ) 51 | ``` 52 | 53 | ### Parameters 54 | 55 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 56 | 57 | 58 | --- 59 | 60 | ## Update Project 61 | 62 | ``` 63 | Files::Project.update(id, 64 | global_access: "global_access" 65 | ) 66 | ``` 67 | 68 | ### Parameters 69 | 70 | * `id` (int64): Required - Project ID. 71 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 72 | 73 | 74 | --- 75 | 76 | ## Delete Project 77 | 78 | ``` 79 | Files::Project.delete(id) 80 | ``` 81 | 82 | ### Parameters 83 | 84 | * `id` (int64): Required - Project ID. 85 | 86 | 87 | --- 88 | 89 | ## Update Project 90 | 91 | ``` 92 | project = Files::Project.find(id) 93 | 94 | project.update( 95 | global_access: "global_access" 96 | ) 97 | ``` 98 | 99 | ### Parameters 100 | 101 | * `id` (int64): Required - Project ID. 102 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 103 | 104 | 105 | --- 106 | 107 | ## Delete Project 108 | 109 | ``` 110 | project = Files::Project.find(id) 111 | 112 | project.delete 113 | ``` 114 | 115 | ### Parameters 116 | 117 | * `id` (int64): Required - Project ID. 118 | -------------------------------------------------------------------------------- /docs/public_hosting_request_log.md: -------------------------------------------------------------------------------- 1 | # PublicHostingRequestLog 2 | 3 | ## Example PublicHostingRequestLog Object 4 | 5 | ``` 6 | { 7 | "timestamp": "2000-01-01T01:00:00Z", 8 | "remote_ip": "example", 9 | "server_ip": "example", 10 | "hostname": "example", 11 | "path": "example", 12 | "responseCode": 1, 13 | "success": true, 14 | "duration_ms": 1 15 | } 16 | ``` 17 | 18 | * `timestamp` (date-time): Start Time of Action 19 | * `remote_ip` (string): IP Address of Public Hosting Client 20 | * `server_ip` (string): IP Address of Public Hosting Server 21 | * `hostname` (string): HTTP Request Hostname 22 | * `path` (string): HTTP Request Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 23 | * `responseCode` (int64): HTTP Response Code 24 | * `success` (boolean): Whether SFTP Action was successful. 25 | * `duration_ms` (int64): Duration (in milliseconds) 26 | 27 | 28 | --- 29 | 30 | ## List Public Hosting Request Logs 31 | 32 | ``` 33 | Files::PublicHostingRequestLog.list 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `start_date`, `end_date`, `path`, `remote_ip` or `success`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ start_date, end_date ]`, `[ start_date, path ]`, `[ start_date, remote_ip ]`, `[ start_date, success ]`, `[ end_date, path ]`, `[ end_date, remote_ip ]`, `[ end_date, success ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ remote_ip, success ]`, `[ start_date, end_date, path ]`, `[ start_date, end_date, remote_ip ]`, `[ start_date, end_date, success ]`, `[ start_date, path, remote_ip ]`, `[ start_date, path, success ]`, `[ start_date, remote_ip, success ]`, `[ end_date, path, remote_ip ]`, `[ end_date, path, success ]`, `[ end_date, remote_ip, success ]`, `[ path, remote_ip, success ]`, `[ start_date, end_date, path, remote_ip ]`, `[ start_date, end_date, path, success ]`, `[ start_date, end_date, remote_ip, success ]`, `[ start_date, path, remote_ip, success ]` or `[ end_date, path, remote_ip, success ]`. 41 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ start_date, end_date ]`, `[ start_date, path ]`, `[ start_date, remote_ip ]`, `[ start_date, success ]`, `[ end_date, path ]`, `[ end_date, remote_ip ]`, `[ end_date, success ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ remote_ip, success ]`, `[ start_date, end_date, path ]`, `[ start_date, end_date, remote_ip ]`, `[ start_date, end_date, success ]`, `[ start_date, path, remote_ip ]`, `[ start_date, path, success ]`, `[ start_date, remote_ip, success ]`, `[ end_date, path, remote_ip ]`, `[ end_date, path, success ]`, `[ end_date, remote_ip, success ]`, `[ path, remote_ip, success ]`, `[ start_date, end_date, path, remote_ip ]`, `[ start_date, end_date, path, success ]`, `[ start_date, end_date, remote_ip, success ]`, `[ start_date, path, remote_ip, success ]` or `[ end_date, path, remote_ip, success ]`. 42 | -------------------------------------------------------------------------------- /docs/public_ip_address.md: -------------------------------------------------------------------------------- 1 | # PublicIpAddress 2 | 3 | ## Example PublicIpAddress Object 4 | 5 | ``` 6 | { 7 | "ip_address": "1.1.1.1", 8 | "server_name": "server-1", 9 | "ftp_enabled": true, 10 | "sftp_enabled": true 11 | } 12 | ``` 13 | 14 | * `ip_address` (string): The public IP address. 15 | * `server_name` (string): The name of the frontend server. 16 | * `ftp_enabled` (boolean): 17 | * `sftp_enabled` (boolean): 18 | -------------------------------------------------------------------------------- /docs/remote_bandwidth_snapshot.md: -------------------------------------------------------------------------------- 1 | # RemoteBandwidthSnapshot 2 | 3 | ## Example RemoteBandwidthSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "sync_bytes_received": 1.0, 9 | "sync_bytes_sent": 1.0, 10 | "logged_at": "2000-01-01T01:00:00Z", 11 | "remote_server_id": 1 12 | } 13 | ``` 14 | 15 | * `id` (int64): Site bandwidth ID 16 | * `sync_bytes_received` (double): Site sync bandwidth report bytes received 17 | * `sync_bytes_sent` (double): Site sync bandwidth report bytes sent 18 | * `logged_at` (date-time): Time the site bandwidth report was logged 19 | * `remote_server_id` (int64): ID of related Remote Server 20 | 21 | 22 | --- 23 | 24 | ## List Remote Bandwidth Snapshots 25 | 26 | ``` 27 | Files::RemoteBandwidthSnapshot.list 28 | ``` 29 | 30 | ### Parameters 31 | 32 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 33 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 35 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 36 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 37 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 38 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 39 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 40 | -------------------------------------------------------------------------------- /docs/remote_server_configuration_file.md: -------------------------------------------------------------------------------- 1 | # RemoteServerConfigurationFile 2 | 3 | ## Example RemoteServerConfigurationFile Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "permission_set": "example", 9 | "private_key": "example", 10 | "subdomain": "example", 11 | "root": "C:\\Users\\", 12 | "follow_links": true, 13 | "prefer_protocol": "example", 14 | "dns": "example", 15 | "proxy_all_outbound": true, 16 | "endpoint_override": "example", 17 | "log_file": "example", 18 | "log_level": "example", 19 | "log_rotate_num": 1, 20 | "log_rotate_size": 1, 21 | "override_max_concurrent_jobs": 1, 22 | "graceful_shutdown_timeout": 1, 23 | "transfer_rate_limit": "example", 24 | "api_token": "example", 25 | "port": 1, 26 | "hostname": "example", 27 | "public_key": "example", 28 | "status": "example", 29 | "server_host_key": "example", 30 | "config_version": "example" 31 | } 32 | ``` 33 | 34 | * `id` (int64): The remote server ID of the agent 35 | * `permission_set` (string): The permission set for the agent ['read_write', 'read_only', 'write_only'] 36 | * `private_key` (string): The private key for the agent 37 | * `subdomain` (string): Files.com subdomain site name 38 | * `root` (string): The root directory for the agent 39 | * `follow_links` (boolean): Follow symlinks when traversing directories 40 | * `prefer_protocol` (string): Preferred network protocol ['udp', 'tcp'] (default udp) 41 | * `dns` (string): DNS lookup method ['auto','doh','system'] (default auto) 42 | * `proxy_all_outbound` (boolean): Proxy all outbound traffic through files.com proxy server 43 | * `endpoint_override` (string): Custom site endpoint URL 44 | * `log_file` (string): Log file name and location 45 | * `log_level` (string): Log level for the agent logs ['debug', 'info', 'warn', 'error', 'fatal'] (default info) 46 | * `log_rotate_num` (int64): Log route for agent logs. (default 5) 47 | * `log_rotate_size` (int64): Log route size in MB for agent logs. (default 20) 48 | * `override_max_concurrent_jobs` (int64): Maximum number of concurrent jobs (default 500) 49 | * `graceful_shutdown_timeout` (int64): Graceful shutdown timeout in seconds (default 15) 50 | * `transfer_rate_limit` (string): File transfer (upload/download) rate limit 51 | `-`, with the given periods: 52 | * 'S': second 53 | * 'M': minute 54 | * 'H': hour 55 | * 'D': day 56 | Examples: 57 | * 5 requests/second: '5-S' 58 | * 10 requests/minute: '10-M' 59 | * 1000 requests/hour: '1000-H' 60 | * 2000 requests/day: '2000-D' 61 | * `api_token` (string): Files Agent API Token 62 | * `port` (int64): Incoming port for files agent connections 63 | * `hostname` (string): 64 | * `public_key` (string): public key 65 | * `status` (string): either running or shutdown 66 | * `server_host_key` (string): 67 | * `config_version` (string): agent config version 68 | -------------------------------------------------------------------------------- /docs/session.md: -------------------------------------------------------------------------------- 1 | # Session 2 | 3 | ## Example Session Object 4 | 5 | ``` 6 | { 7 | "id": "60525f92e859c4c3d74cb02fd176b1525901b525", 8 | "language": "en", 9 | "read_only": true, 10 | "sftp_insecure_ciphers": true 11 | } 12 | ``` 13 | 14 | * `id` (string): Session ID 15 | * `language` (string): Session language 16 | * `read_only` (boolean): Is this session read only? 17 | * `sftp_insecure_ciphers` (boolean): Are insecure SFTP ciphers allowed for this user? (If this is set to true, the site administrator has signaled that it is ok to use less secure SSH ciphers for this user.) 18 | * `username` (string): Username to sign in as 19 | * `password` (string): Password for sign in 20 | * `otp` (string): If this user has a 2FA device, provide its OTP or code here. 21 | * `partial_session_id` (string): Identifier for a partially-completed login 22 | 23 | 24 | --- 25 | 26 | ## Create user session (log in) 27 | 28 | ``` 29 | Files::Session.create( 30 | username: "username", 31 | password: "password", 32 | otp: "123456" 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `username` (string): Username to sign in as 39 | * `password` (string): Password for sign in 40 | * `otp` (string): If this user has a 2FA device, provide its OTP or code here. 41 | * `partial_session_id` (string): Identifier for a partially-completed login 42 | 43 | 44 | --- 45 | 46 | ## Delete user session (log out) 47 | 48 | ``` 49 | Files::Session.delete 50 | ``` 51 | -------------------------------------------------------------------------------- /docs/settings_change.md: -------------------------------------------------------------------------------- 1 | # SettingsChange 2 | 3 | ## Example SettingsChange Object 4 | 5 | ``` 6 | { 7 | "api_key_id": 1, 8 | "changes": [ 9 | "example" 10 | ], 11 | "created_at": "2000-01-01T01:00:00Z", 12 | "user_id": 1, 13 | "user_is_files_support": true, 14 | "user_is_from_parent_site": true, 15 | "username": "some_user" 16 | } 17 | ``` 18 | 19 | * `api_key_id` (int64): The API key id responsible for this change. 20 | * `changes` (array(string)): Markdown-formatted change messages. 21 | * `created_at` (date-time): The time this change was made. 22 | * `user_id` (int64): The user id responsible for this change. 23 | * `user_is_files_support` (boolean): true if this change was performed by Files.com support. 24 | * `user_is_from_parent_site` (boolean): true if this change was performed by a user on a parent site. 25 | * `username` (string): The username of the user responsible for this change. 26 | 27 | 28 | --- 29 | 30 | ## List Settings Changes 31 | 32 | ``` 33 | Files::SettingsChange.list 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `api_key_id` or `user_id`. 41 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`. 42 | -------------------------------------------------------------------------------- /docs/sftp_host_key.md: -------------------------------------------------------------------------------- 1 | # SftpHostKey 2 | 3 | ## Example SftpHostKey Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "My Key", 9 | "fingerprint_md5": "12:7e:f8:61:78:a4:b2:c2:ee:12:51:92:25:a7:42:cc", 10 | "fingerprint_sha256": "SHA256:5ANRkDpXWA+PgOquzZAG9RtQ1Bt8KXYAH2hecr7LQk8" 11 | } 12 | ``` 13 | 14 | * `id` (int64): SFTP Host Key ID 15 | * `name` (string): The friendly name of this SFTP Host Key. 16 | * `fingerprint_md5` (string): MD5 Fingerprint of the public key 17 | * `fingerprint_sha256` (string): SHA256 Fingerprint of the public key 18 | * `private_key` (string): The private key data. 19 | 20 | 21 | --- 22 | 23 | ## List SFTP Host Keys 24 | 25 | ``` 26 | Files::SftpHostKey.list 27 | ``` 28 | 29 | ### Parameters 30 | 31 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 32 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 33 | 34 | 35 | --- 36 | 37 | ## Show SFTP Host Key 38 | 39 | ``` 40 | Files::SftpHostKey.find(id) 41 | ``` 42 | 43 | ### Parameters 44 | 45 | * `id` (int64): Required - Sftp Host Key ID. 46 | 47 | 48 | --- 49 | 50 | ## Create SFTP Host Key 51 | 52 | ``` 53 | Files::SftpHostKey.create( 54 | name: "My Key" 55 | ) 56 | ``` 57 | 58 | ### Parameters 59 | 60 | * `name` (string): The friendly name of this SFTP Host Key. 61 | * `private_key` (string): The private key data. 62 | 63 | 64 | --- 65 | 66 | ## Update SFTP Host Key 67 | 68 | ``` 69 | Files::SftpHostKey.update(id, 70 | name: "My Key" 71 | ) 72 | ``` 73 | 74 | ### Parameters 75 | 76 | * `id` (int64): Required - Sftp Host Key ID. 77 | * `name` (string): The friendly name of this SFTP Host Key. 78 | * `private_key` (string): The private key data. 79 | 80 | 81 | --- 82 | 83 | ## Delete SFTP Host Key 84 | 85 | ``` 86 | Files::SftpHostKey.delete(id) 87 | ``` 88 | 89 | ### Parameters 90 | 91 | * `id` (int64): Required - Sftp Host Key ID. 92 | 93 | 94 | --- 95 | 96 | ## Update SFTP Host Key 97 | 98 | ``` 99 | sftp_host_key = Files::SftpHostKey.find(id) 100 | 101 | sftp_host_key.update( 102 | name: "My Key" 103 | ) 104 | ``` 105 | 106 | ### Parameters 107 | 108 | * `id` (int64): Required - Sftp Host Key ID. 109 | * `name` (string): The friendly name of this SFTP Host Key. 110 | * `private_key` (string): The private key data. 111 | 112 | 113 | --- 114 | 115 | ## Delete SFTP Host Key 116 | 117 | ``` 118 | sftp_host_key = Files::SftpHostKey.find(id) 119 | 120 | sftp_host_key.delete 121 | ``` 122 | 123 | ### Parameters 124 | 125 | * `id` (int64): Required - Sftp Host Key ID. 126 | -------------------------------------------------------------------------------- /docs/share_group.md: -------------------------------------------------------------------------------- 1 | # ShareGroup 2 | 3 | ## Example ShareGroup Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "Test group 1", 9 | "notes": "This group is defined for testing purposes", 10 | "user_id": 1, 11 | "members": [ 12 | { 13 | "name": "John Doe", 14 | "company": "Acme Ltd", 15 | "email": "johndoe@gmail.com" 16 | } 17 | ] 18 | } 19 | ``` 20 | 21 | * `id` (int64): Share Group ID 22 | * `name` (string): Name of the share group 23 | * `notes` (string): Additional notes of the share group 24 | * `user_id` (int64): Owner User ID 25 | * `members` (array(object)): A list of share group members 26 | 27 | 28 | --- 29 | 30 | ## List Share Groups 31 | 32 | ``` 33 | Files::ShareGroup.list( 34 | user_id: 1 35 | ) 36 | ``` 37 | 38 | ### Parameters 39 | 40 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 41 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 42 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 43 | 44 | 45 | --- 46 | 47 | ## Show Share Group 48 | 49 | ``` 50 | Files::ShareGroup.find(id) 51 | ``` 52 | 53 | ### Parameters 54 | 55 | * `id` (int64): Required - Share Group ID. 56 | 57 | 58 | --- 59 | 60 | ## Create Share Group 61 | 62 | ``` 63 | Files::ShareGroup.create( 64 | user_id: 1, 65 | notes: "This group is defined for testing purposes", 66 | name: "Test group 1", 67 | members: [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}] 68 | ) 69 | ``` 70 | 71 | ### Parameters 72 | 73 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 74 | * `notes` (string): Additional notes of the share group 75 | * `name` (string): Required - Name of the share group 76 | * `members` (array(object)): Required - A list of share group members. 77 | 78 | 79 | --- 80 | 81 | ## Update Share Group 82 | 83 | ``` 84 | Files::ShareGroup.update(id, 85 | notes: "This group is defined for testing purposes", 86 | name: "Test group 1", 87 | members: [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}] 88 | ) 89 | ``` 90 | 91 | ### Parameters 92 | 93 | * `id` (int64): Required - Share Group ID. 94 | * `notes` (string): Additional notes of the share group 95 | * `name` (string): Name of the share group 96 | * `members` (array(object)): A list of share group members. 97 | 98 | 99 | --- 100 | 101 | ## Delete Share Group 102 | 103 | ``` 104 | Files::ShareGroup.delete(id) 105 | ``` 106 | 107 | ### Parameters 108 | 109 | * `id` (int64): Required - Share Group ID. 110 | 111 | 112 | --- 113 | 114 | ## Update Share Group 115 | 116 | ``` 117 | share_group = Files::ShareGroup.find(id) 118 | 119 | share_group.update( 120 | notes: "This group is defined for testing purposes", 121 | name: "Test group 1", 122 | members: [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}] 123 | ) 124 | ``` 125 | 126 | ### Parameters 127 | 128 | * `id` (int64): Required - Share Group ID. 129 | * `notes` (string): Additional notes of the share group 130 | * `name` (string): Name of the share group 131 | * `members` (array(object)): A list of share group members. 132 | 133 | 134 | --- 135 | 136 | ## Delete Share Group 137 | 138 | ``` 139 | share_group = Files::ShareGroup.find(id) 140 | 141 | share_group.delete 142 | ``` 143 | 144 | ### Parameters 145 | 146 | * `id` (int64): Required - Share Group ID. 147 | -------------------------------------------------------------------------------- /docs/share_group_member.md: -------------------------------------------------------------------------------- 1 | # ShareGroupMember 2 | 3 | ## Example ShareGroupMember Object 4 | 5 | ``` 6 | { 7 | "name": "John Doe", 8 | "company": "Acme Ltd", 9 | "email": "johndoe@gmail.com" 10 | } 11 | ``` 12 | 13 | * `name` (string): Name of the share group member 14 | * `company` (string): Company of the share group member 15 | * `email` (string): Email of the share group member 16 | -------------------------------------------------------------------------------- /docs/snapshot.md: -------------------------------------------------------------------------------- 1 | # Snapshot 2 | 3 | ## Example Snapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "expires_at": "2000-01-01T01:00:00Z", 9 | "finalized_at": "2000-01-01T01:00:00Z", 10 | "name": "My Snapshot", 11 | "user_id": 1, 12 | "bundle_id": 1 13 | } 14 | ``` 15 | 16 | * `id` (int64): The snapshot's unique ID. 17 | * `expires_at` (date-time): When the snapshot expires. 18 | * `finalized_at` (date-time): When the snapshot was finalized. 19 | * `name` (string): A name for the snapshot. 20 | * `user_id` (int64): The user that created this snapshot, if applicable. 21 | * `bundle_id` (int64): The bundle using this snapshot, if applicable. 22 | * `paths` (array(string)): An array of paths to add to the snapshot. 23 | 24 | 25 | --- 26 | 27 | ## List Snapshots 28 | 29 | ``` 30 | Files::Snapshot.list 31 | ``` 32 | 33 | ### Parameters 34 | 35 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 36 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 37 | 38 | 39 | --- 40 | 41 | ## Show Snapshot 42 | 43 | ``` 44 | Files::Snapshot.find(id) 45 | ``` 46 | 47 | ### Parameters 48 | 49 | * `id` (int64): Required - Snapshot ID. 50 | 51 | 52 | --- 53 | 54 | ## Create Snapshot 55 | 56 | ``` 57 | Files::Snapshot.create( 58 | expires_at: "2000-01-01T01:00:00Z", 59 | name: "My Snapshot" 60 | ) 61 | ``` 62 | 63 | ### Parameters 64 | 65 | * `expires_at` (string): When the snapshot expires. 66 | * `name` (string): A name for the snapshot. 67 | * `paths` (array(string)): An array of paths to add to the snapshot. 68 | 69 | 70 | --- 71 | 72 | ## Finalize Snapshot 73 | 74 | ``` 75 | Files::Snapshot.finalize(id) 76 | ``` 77 | 78 | ### Parameters 79 | 80 | * `id` (int64): Required - Snapshot ID. 81 | 82 | 83 | --- 84 | 85 | ## Update Snapshot 86 | 87 | ``` 88 | Files::Snapshot.update(id, 89 | expires_at: "2000-01-01T01:00:00Z", 90 | name: "My Snapshot" 91 | ) 92 | ``` 93 | 94 | ### Parameters 95 | 96 | * `id` (int64): Required - Snapshot ID. 97 | * `expires_at` (string): When the snapshot expires. 98 | * `name` (string): A name for the snapshot. 99 | * `paths` (array(string)): An array of paths to add to the snapshot. 100 | 101 | 102 | --- 103 | 104 | ## Delete Snapshot 105 | 106 | ``` 107 | Files::Snapshot.delete(id) 108 | ``` 109 | 110 | ### Parameters 111 | 112 | * `id` (int64): Required - Snapshot ID. 113 | 114 | 115 | --- 116 | 117 | ## Finalize Snapshot 118 | 119 | ``` 120 | snapshot = Files::Snapshot.find(id) 121 | 122 | snapshot.finalize 123 | ``` 124 | 125 | ### Parameters 126 | 127 | * `id` (int64): Required - Snapshot ID. 128 | 129 | 130 | --- 131 | 132 | ## Update Snapshot 133 | 134 | ``` 135 | snapshot = Files::Snapshot.find(id) 136 | 137 | snapshot.update( 138 | expires_at: "2000-01-01T01:00:00Z", 139 | name: "My Snapshot" 140 | ) 141 | ``` 142 | 143 | ### Parameters 144 | 145 | * `id` (int64): Required - Snapshot ID. 146 | * `expires_at` (string): When the snapshot expires. 147 | * `name` (string): A name for the snapshot. 148 | * `paths` (array(string)): An array of paths to add to the snapshot. 149 | 150 | 151 | --- 152 | 153 | ## Delete Snapshot 154 | 155 | ``` 156 | snapshot = Files::Snapshot.find(id) 157 | 158 | snapshot.delete 159 | ``` 160 | 161 | ### Parameters 162 | 163 | * `id` (int64): Required - Snapshot ID. 164 | -------------------------------------------------------------------------------- /docs/status.md: -------------------------------------------------------------------------------- 1 | # Status 2 | 3 | ## Example Status Object 4 | 5 | ``` 6 | { 7 | "code": 200, 8 | "message": "example", 9 | "status": "", 10 | "data": "example", 11 | "errors": [ 12 | { 13 | "fields": [ 14 | 15 | ], 16 | "messages": [ 17 | 18 | ] 19 | } 20 | ], 21 | "clickwrap_id": 1, 22 | "clickwrap_body": "example" 23 | } 24 | ``` 25 | 26 | * `code` (int64): Status HTTP code 27 | * `message` (string): Error message 28 | * `status` (string): Status message 29 | * `data` (Auto): Additional data 30 | * `errors` (array(object)): A list of api errors 31 | * `clickwrap_id` (int64): Required Clickwrap id 32 | * `clickwrap_body` (string): Required Clickwrap body 33 | -------------------------------------------------------------------------------- /docs/style.md: -------------------------------------------------------------------------------- 1 | # Style 2 | 3 | ## Example Style Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "example", 9 | "logo": "https://mysite.files.com/...", 10 | "thumbnail": { 11 | "name": "My logo", 12 | "uri": "https://mysite.files.com/.../my_image.png" 13 | } 14 | } 15 | ``` 16 | 17 | * `id` (int64): Style ID 18 | * `path` (string): Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 19 | * `logo` (Image): Logo 20 | * `thumbnail` (Image): Logo thumbnail 21 | * `file` (file): Logo for custom branding. 22 | 23 | 24 | --- 25 | 26 | ## Show Style 27 | 28 | ``` 29 | Files::Style.find(path) 30 | ``` 31 | 32 | ### Parameters 33 | 34 | * `path` (string): Required - Style path. 35 | 36 | 37 | --- 38 | 39 | ## Update Style 40 | 41 | ``` 42 | Files::Style.update(path, 43 | file: "file" 44 | ) 45 | ``` 46 | 47 | ### Parameters 48 | 49 | * `path` (string): Required - Style path. 50 | * `file` (file): Required - Logo for custom branding. 51 | 52 | 53 | --- 54 | 55 | ## Delete Style 56 | 57 | ``` 58 | Files::Style.delete(path) 59 | ``` 60 | 61 | ### Parameters 62 | 63 | * `path` (string): Required - Style path. 64 | 65 | 66 | --- 67 | 68 | ## Update Style 69 | 70 | ``` 71 | style = Files::Style.find(path) 72 | 73 | style.update( 74 | file: "file" 75 | ) 76 | ``` 77 | 78 | ### Parameters 79 | 80 | * `path` (string): Required - Style path. 81 | * `file` (file): Required - Logo for custom branding. 82 | 83 | 84 | --- 85 | 86 | ## Delete Style 87 | 88 | ``` 89 | style = Files::Style.find(path) 90 | 91 | style.delete 92 | ``` 93 | 94 | ### Parameters 95 | 96 | * `path` (string): Required - Style path. 97 | -------------------------------------------------------------------------------- /docs/usage_by_top_level_dir.md: -------------------------------------------------------------------------------- 1 | # UsageByTopLevelDir 2 | 3 | ## Example UsageByTopLevelDir Object 4 | 5 | ``` 6 | { 7 | "dir": "", 8 | "size": 1, 9 | "count": 1 10 | } 11 | ``` 12 | 13 | * `dir` (string): Directory name 14 | * `size` (int64): Usage 15 | * `count` (int64): File count 16 | -------------------------------------------------------------------------------- /docs/usage_daily_snapshot.md: -------------------------------------------------------------------------------- 1 | # UsageDailySnapshot 2 | 3 | ## Example UsageDailySnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "date": "2000-01-01T01:00:00Z", 9 | "api_usage_available": true, 10 | "read_api_usage": 1, 11 | "write_api_usage": 1, 12 | "user_count": 1, 13 | "current_storage": 1.0, 14 | "deleted_files_storage": 1.0, 15 | "deleted_files_counted_in_minimum": 1.0, 16 | "root_storage": 1.0, 17 | "usage_by_top_level_dir": [ 18 | { 19 | "dir": "dir", 20 | "size": 100, 21 | "count": 10 22 | } 23 | ] 24 | } 25 | ``` 26 | 27 | * `id` (int64): ID of the usage record 28 | * `date` (date): The date of this usage record 29 | * `api_usage_available` (boolean): True if the API usage fields `read_api_usage` and `write_api_usage` can be relied upon. If this is false, we suggest hiding that value from any UI. 30 | * `read_api_usage` (int64): Read API Calls used on this day. Note: only updated for days before the current day. 31 | * `write_api_usage` (int64): Write API Calls used on this day. Note: only updated for days before the current day. 32 | * `user_count` (int64): Number of billable users as of this day. 33 | * `current_storage` (double): GB of Files Native Storage used on this day. 34 | * `deleted_files_storage` (double): GB of Files Native Storage used on this day for files that have been deleted and are stored as backups. 35 | * `deleted_files_counted_in_minimum` (double): GB of Files Native Storage used on this day for files that have been permanently deleted but were uploaded less than 30 days ago, and are still billable. 36 | * `root_storage` (double): GB of Files Native Storage used for the root folder. Included here because this value will not be part of `usage_by_top_level_dir` 37 | * `usage_by_top_level_dir` (array(object)): Usage broken down by each top-level folder 38 | 39 | 40 | --- 41 | 42 | ## List Usage Daily Snapshots 43 | 44 | ``` 45 | Files::UsageDailySnapshot.list 46 | ``` 47 | 48 | ### Parameters 49 | 50 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 51 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 52 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `date`. 53 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`. 54 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `date`. 55 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `date`. 56 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `date`. 57 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `date`. 58 | -------------------------------------------------------------------------------- /docs/usage_snapshot.md: -------------------------------------------------------------------------------- 1 | # UsageSnapshot 2 | 3 | ## Example UsageSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "start_at": "2000-01-01T01:00:00Z", 9 | "end_at": "2000-01-01T01:00:00Z", 10 | "high_water_user_count": 1, 11 | "current_storage": 1.0, 12 | "high_water_storage": 1.0, 13 | "root_storage": 1.0, 14 | "deleted_files_counted_in_minimum": 1.0, 15 | "deleted_files_storage": 1.0, 16 | "total_billable_usage": 1.0, 17 | "total_billable_transfer_usage": 1.0, 18 | "bytes_sent": 1.0, 19 | "sync_bytes_received": 1.0, 20 | "sync_bytes_sent": 1.0, 21 | "usage_by_top_level_dir": [ 22 | { 23 | "dir": "dir", 24 | "size": 100, 25 | "count": 10 26 | } 27 | ] 28 | } 29 | ``` 30 | 31 | * `id` (int64): Usage snapshot ID 32 | * `start_at` (date-time): Usage snapshot start date/time 33 | * `end_at` (date-time): Usage snapshot end date/time 34 | * `high_water_user_count` (int64): Highest user count number in time period 35 | * `current_storage` (double): Current total Storage Usage GB as of end date (not necessarily high water mark, which is used for billing) 36 | * `high_water_storage` (double): Highest Storage Usage GB recorded in time period (used for billing) 37 | * `root_storage` (double): Storage Usage for root folder as of end date (not necessarily high water mark, which is used for billing) 38 | * `deleted_files_counted_in_minimum` (double): Storage Usage for files that are deleted but uploaded within last 30 days as of end date (not necessarily high water mark, which is used for billing) 39 | * `deleted_files_storage` (double): Storage Usage for files that are deleted but retained as backups as of end date (not necessarily high water mark, which is used for billing) 40 | * `total_billable_usage` (double): Storage + Transfer Usage - Total Billable amount 41 | * `total_billable_transfer_usage` (double): Transfer usage for period - Total Billable amount 42 | * `bytes_sent` (double): Transfer Usage for period - Outbound GB from Files Native Storage 43 | * `sync_bytes_received` (double): Transfer Usage for period - Inbound GB to Remote Servers (Sync/Mount) 44 | * `sync_bytes_sent` (double): Transfer Usage for period - Outbound GB from Remote Servers (Sync/Mount) 45 | * `usage_by_top_level_dir` (array(object)): Storage Usage - map of root folders to their usage as of end date (not necessarily high water mark, which is used for billing) 46 | 47 | 48 | --- 49 | 50 | ## List Usage Snapshots 51 | 52 | ``` 53 | Files::UsageSnapshot.list 54 | ``` 55 | 56 | ### Parameters 57 | 58 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 59 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 60 | -------------------------------------------------------------------------------- /docs/user_cipher_use.md: -------------------------------------------------------------------------------- 1 | # UserCipherUse 2 | 3 | ## Example UserCipherUse Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "protocol_cipher": "TLSv1.2; ECDHE-RSA-AES256-GCM-SHA384", 9 | "created_at": "2000-01-01T01:00:00Z", 10 | "insecure": true, 11 | "interface": "restapi", 12 | "updated_at": "2000-01-01T01:00:00Z", 13 | "user_id": 1 14 | } 15 | ``` 16 | 17 | * `id` (int64): UserCipherUse ID 18 | * `protocol_cipher` (string): The protocol and cipher employed 19 | * `created_at` (date-time): The earliest recorded use of this combination of interface and protocol and cipher (for this user) 20 | * `insecure` (boolean): Is this cipher considered insecure? 21 | * `interface` (string): The interface accessed 22 | * `updated_at` (date-time): The most recent use of this combination of interface and protocol and cipher (for this user) 23 | * `user_id` (int64): ID of the user who performed this access 24 | 25 | 26 | --- 27 | 28 | ## List User Cipher Uses 29 | 30 | ``` 31 | Files::UserCipherUse.list( 32 | user_id: 1 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `user_id` (int64): User ID. If provided, will return uses for this user. 39 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 40 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | -------------------------------------------------------------------------------- /docs/user_request.md: -------------------------------------------------------------------------------- 1 | # UserRequest 2 | 3 | ## Example UserRequest Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "John Doe", 9 | "email": "john.doe@files.com", 10 | "details": "Changed Departments", 11 | "company": "Acme Inc." 12 | } 13 | ``` 14 | 15 | * `id` (int64): ID 16 | * `name` (string): User's full name 17 | * `email` (email): User email address 18 | * `details` (string): Details of the user's request 19 | * `company` (string): User's company name 20 | 21 | 22 | --- 23 | 24 | ## List User Requests 25 | 26 | ``` 27 | Files::UserRequest.list 28 | ``` 29 | 30 | ### Parameters 31 | 32 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 33 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | 35 | 36 | --- 37 | 38 | ## Show User Request 39 | 40 | ``` 41 | Files::UserRequest.find(id) 42 | ``` 43 | 44 | ### Parameters 45 | 46 | * `id` (int64): Required - User Request ID. 47 | 48 | 49 | --- 50 | 51 | ## Create User Request 52 | 53 | ``` 54 | Files::UserRequest.create( 55 | name: "name", 56 | email: "email", 57 | details: "details", 58 | company: "Acme Inc." 59 | ) 60 | ``` 61 | 62 | ### Parameters 63 | 64 | * `name` (string): Required - Name of user requested 65 | * `email` (string): Required - Email of user requested 66 | * `details` (string): Required - Details of the user request 67 | * `company` (string): Company of the user requested 68 | 69 | 70 | --- 71 | 72 | ## Delete User Request 73 | 74 | ``` 75 | Files::UserRequest.delete(id) 76 | ``` 77 | 78 | ### Parameters 79 | 80 | * `id` (int64): Required - User Request ID. 81 | 82 | 83 | --- 84 | 85 | ## Delete User Request 86 | 87 | ``` 88 | user_request = Files::UserRequest.find(id) 89 | 90 | user_request.delete 91 | ``` 92 | 93 | ### Parameters 94 | 95 | * `id` (int64): Required - User Request ID. 96 | -------------------------------------------------------------------------------- /docs/user_sftp_client_use.md: -------------------------------------------------------------------------------- 1 | # UserSftpClientUse 2 | 3 | ## Example UserSftpClientUse Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "sftp_client": "example", 9 | "created_at": "2000-01-01T01:00:00Z", 10 | "updated_at": "2000-01-01T01:00:00Z", 11 | "user_id": 1 12 | } 13 | ``` 14 | 15 | * `id` (int64): UserSftpClientUse ID 16 | * `sftp_client` (string): The SFTP client used 17 | * `created_at` (date-time): The earliest recorded use of this SFTP client (for this user) 18 | * `updated_at` (date-time): The most recent use of this SFTP client (for this user) 19 | * `user_id` (int64): ID of the user who performed this access 20 | 21 | 22 | --- 23 | 24 | ## List User SFTP Client Uses 25 | 26 | ``` 27 | Files::UserSftpClientUse.list( 28 | user_id: 1 29 | ) 30 | ``` 31 | 32 | ### Parameters 33 | 34 | * `user_id` (int64): User ID. If provided, will return uses for this user. 35 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 36 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 37 | -------------------------------------------------------------------------------- /docs/webhook_test.md: -------------------------------------------------------------------------------- 1 | # WebhookTest 2 | 3 | ## Example WebhookTest Object 4 | 5 | ``` 6 | { 7 | "code": 200, 8 | "message": "", 9 | "status": "", 10 | "data": "example", 11 | "success": true 12 | } 13 | ``` 14 | 15 | * `code` (int64): Status HTTP code 16 | * `message` (string): Error message 17 | * `status` (string): Status message 18 | * `data` (Auto): Additional data 19 | * `success` (boolean): The success status of the webhook test 20 | * `url` (string): URL for testing the webhook. 21 | * `method` (string): HTTP method(GET or POST). 22 | * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data). 23 | * `headers` (object): Additional request headers. 24 | * `body` (object): Additional body parameters. 25 | * `raw_body` (string): raw body text 26 | * `file_as_body` (boolean): Send the file data as the request body? 27 | * `file_form_field` (string): Send the file data as a named parameter in the request POST body 28 | * `action` (string): action for test body 29 | * `use_dedicated_ips` (boolean): Use dedicated IPs for sending the webhook? 30 | 31 | 32 | --- 33 | 34 | ## Create Webhook Test 35 | 36 | ``` 37 | Files::WebhookTest.create( 38 | url: "https://www.site.com/...", 39 | method: "GET", 40 | encoding: "RAW", 41 | headers: {"x-test-header":"testvalue"}, 42 | body: {"test-param":"testvalue"}, 43 | raw_body: "test body", 44 | file_as_body: false, 45 | file_form_field: "upload_file_data", 46 | use_dedicated_ips: false 47 | ) 48 | ``` 49 | 50 | ### Parameters 51 | 52 | * `url` (string): Required - URL for testing the webhook. 53 | * `method` (string): HTTP method(GET or POST). 54 | * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data). 55 | * `headers` (object): Additional request headers. 56 | * `body` (object): Additional body parameters. 57 | * `raw_body` (string): raw body text 58 | * `file_as_body` (boolean): Send the file data as the request body? 59 | * `file_form_field` (string): Send the file data as a named parameter in the request POST body 60 | * `action` (string): action for test body 61 | * `use_dedicated_ips` (boolean): Use dedicated IPs for sending the webhook? 62 | -------------------------------------------------------------------------------- /files.com.gemspec: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.push File.expand_path('lib', __dir__) 2 | 3 | Gem::Specification.new do |s| 4 | s.name = "files.com" 5 | s.version = File.read(File.expand_path('_VERSION', __dir__)) 6 | s.platform = Gem::Platform::RUBY 7 | s.authors = [ "files.com" ] 8 | s.email = [ "support@files.com" ] 9 | s.homepage = "https://www.files.com" 10 | s.summary = "Files.com Ruby client." 11 | s.description = "The Files.com Ruby client." 12 | s.license = "MIT" 13 | s.required_ruby_version = ">= 2.7" 14 | s.add_dependency 'addressable', ">= 2.8.0" 15 | s.add_dependency 'concurrent-ruby', ">= 1.1.3" 16 | s.add_dependency 'faraday', ">= 1.0.1" 17 | s.add_dependency 'faraday-multipart', ">= 1.0" 18 | s.add_dependency 'faraday-net_http_persistent', '>= 2.0' 19 | s.add_dependency 'net-http-persistent', ">= 4.0" 20 | 21 | s.files = `find *`.split("\n").uniq.sort.reject(&:empty?) 22 | s.executables = [ "files", "files-console" ] 23 | s.require_paths = [ "lib" ] 24 | end 25 | -------------------------------------------------------------------------------- /lib/files.com/api.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Api 5 | def self.send_request(path, verb, params, options) 6 | warn_on_options_in_params(params) 7 | 8 | options[:client] ||= ApiClient.active_client 9 | 10 | headers = options.clone 11 | api_key = headers.delete(:api_key) 12 | client = headers.delete(:client) 13 | session_id = headers.delete(:session_id) 14 | if session = headers.delete(:session) 15 | session.save unless session.id 16 | session_id = session.id 17 | end 18 | 19 | resp, options[:api_key], options[:session_id] = client.execute_request( 20 | verb, path, api_key: api_key, headers: headers, params: params, session_id: session_id 21 | ) 22 | 23 | # Hash#select returns an array before 1.9 24 | options_to_persist = {} 25 | options.each do |k, v| 26 | options_to_persist[k] = v if Util::OPTS.include?(k) 27 | end 28 | 29 | [ resp, options_to_persist ] 30 | end 31 | 32 | def self.warn_on_options_in_params(params) 33 | Util::OPTS.each do |opt| 34 | warn("WARNING: #{opt} should be in the options hash, not the params hash. You may need to create a second hash that goes after params.)") if params.key?(opt) 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/files.com/list.rb: -------------------------------------------------------------------------------- 1 | module Files 2 | class List 3 | include Enumerable 4 | 5 | def initialize(resource_wrapper, params, current_response = nil, current_options = nil, &request_page) 6 | @resource_wrapper = resource_wrapper 7 | @params = params 8 | @current_response = current_response 9 | @current_options = current_options 10 | @request_page = request_page 11 | params[:per_page] ||= 1_000 12 | end 13 | 14 | # Iterates through each resource in all pages, making additional fetches to 15 | # the API as necessary. 16 | # 17 | # Note that this method will make as many API calls as necessary to fetch 18 | # all resources. For more granular control, please see +each+ and 19 | # +next_page+. 20 | def auto_paging_each(&block) 21 | return enum_for(:auto_paging_each).lazy unless block_given? 22 | 23 | loop do 24 | page = next_page 25 | break unless page.valid_response? 26 | 27 | page.set_cursor 28 | 29 | page.wrap_data do |data| 30 | block.call(data) 31 | end 32 | 33 | break if page.on_last_page? 34 | end 35 | end 36 | 37 | # Iterates through each resource in the current page. 38 | # 39 | # Note that this method makes no effort to fetch a new page when it gets to 40 | # the end of the current page's resources. See also +auto_paging_each+. 41 | def each(&block) 42 | page = current_page 43 | return [] unless page.valid_response? 44 | 45 | page.set_cursor 46 | page.wrap_data { |data| block.call data } 47 | end 48 | 49 | # Fetches the next page of resources (if there is one). 50 | # 51 | # This method will try to respect the per_page set. If none 52 | # was given, the default per_page will be used. 53 | def next_page 54 | self.class.new(resource_wrapper, params, *request_page.call, &request_page) 55 | end 56 | 57 | protected 58 | 59 | attr_reader :resource_wrapper, 60 | :params, 61 | :request_page 62 | 63 | def current_page 64 | @current_page ||= if @current_response and @current_options 65 | self 66 | else 67 | next_page 68 | end 69 | end 70 | 71 | def data 72 | @current_response.data 73 | end 74 | 75 | def wrap_data 76 | data.map do |object| 77 | yield resource_wrapper.new(object, @current_options) 78 | end 79 | end 80 | 81 | def set_cursor 82 | params[:cursor] = @current_options[:client].cursor 83 | end 84 | 85 | def cursor 86 | params[:cursor] 87 | end 88 | 89 | def valid_response? 90 | @current_response.http_status == 200 91 | end 92 | 93 | def on_last_page? 94 | !cursor or (data.count < params[:per_page]) 95 | end 96 | end 97 | end 98 | -------------------------------------------------------------------------------- /lib/files.com/models/account_line_item.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class AccountLineItem 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Line item Id 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # double - Line item amount 18 | def amount 19 | @attributes[:amount] 20 | end 21 | 22 | # double - Line item balance 23 | def balance 24 | @attributes[:balance] 25 | end 26 | 27 | # date-time - Line item created at 28 | def created_at 29 | @attributes[:created_at] 30 | end 31 | 32 | # string - Line item currency 33 | def currency 34 | @attributes[:currency] 35 | end 36 | 37 | # string - Line item download uri 38 | def download_uri 39 | @attributes[:download_uri] 40 | end 41 | 42 | # array(object) - Associated invoice line items 43 | def invoice_line_items 44 | @attributes[:invoice_line_items] 45 | end 46 | 47 | # string - Line item payment method 48 | def method 49 | @attributes[:method] 50 | end 51 | 52 | # array(object) - Associated payment line items 53 | def payment_line_items 54 | @attributes[:payment_line_items] 55 | end 56 | 57 | # date-time - Date/time payment was reversed if applicable 58 | def payment_reversed_at 59 | @attributes[:payment_reversed_at] 60 | end 61 | 62 | # string - Type of payment if applicable 63 | def payment_type 64 | @attributes[:payment_type] 65 | end 66 | 67 | # string - Site name this line item is for 68 | def site_name 69 | @attributes[:site_name] 70 | end 71 | 72 | # string - Type of line item, either payment or invoice 73 | def type 74 | @attributes[:type] 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /lib/files.com/models/action.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Action 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Action ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 18 | def path 19 | @attributes[:path] 20 | end 21 | 22 | # date-time - Action occurrence date/time 23 | def when 24 | @attributes[:when] 25 | end 26 | 27 | # string - The destination path for this action, if applicable 28 | def destination 29 | @attributes[:destination] 30 | end 31 | 32 | # string - Friendly displayed output 33 | def display 34 | @attributes[:display] 35 | end 36 | 37 | # string - IP Address that performed this action 38 | def ip 39 | @attributes[:ip] 40 | end 41 | 42 | # string - The source path for this action, if applicable 43 | def source 44 | @attributes[:source] 45 | end 46 | 47 | # object - Targets 48 | def targets 49 | @attributes[:targets] 50 | end 51 | 52 | # int64 - User ID 53 | def user_id 54 | @attributes[:user_id] 55 | end 56 | 57 | # string - Username 58 | def username 59 | @attributes[:username] 60 | end 61 | 62 | # boolean - true if this change was performed by a user on a parent site. 63 | def user_is_from_parent_site 64 | @attributes[:user_is_from_parent_site] 65 | end 66 | 67 | # string - Type of action 68 | def action 69 | @attributes[:action] 70 | end 71 | 72 | # string - Failure type. If action was a user login or session failure, why did it fail? 73 | def failure_type 74 | @attributes[:failure_type] 75 | end 76 | 77 | # string - Interface on which this action occurred. 78 | def interface 79 | @attributes[:interface] 80 | end 81 | end 82 | end 83 | -------------------------------------------------------------------------------- /lib/files.com/models/action_notification_export_result.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class ActionNotificationExportResult 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Notification ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # int64 - When the notification was sent. 18 | def created_at 19 | @attributes[:created_at] 20 | end 21 | 22 | # int64 - HTTP status code returned in the webhook response. 23 | def status 24 | @attributes[:status] 25 | end 26 | 27 | # string - A message indicating the overall status of the webhook notification. 28 | def message 29 | @attributes[:message] 30 | end 31 | 32 | # boolean - `true` if the webhook succeeded by receiving a 200 or 204 response. 33 | def success 34 | @attributes[:success] 35 | end 36 | 37 | # string - A JSON-encoded string with headers that were sent with the webhook. 38 | def request_headers 39 | @attributes[:request_headers] 40 | end 41 | 42 | # string - The HTTP verb used to perform the webhook. 43 | def request_method 44 | @attributes[:request_method] 45 | end 46 | 47 | # string - The webhook request URL. 48 | def request_url 49 | @attributes[:request_url] 50 | end 51 | 52 | # string - The path to the actual file that triggered this notification. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 53 | def path 54 | @attributes[:path] 55 | end 56 | 57 | # string - The folder associated with the triggering action for this notification. 58 | def folder 59 | @attributes[:folder] 60 | end 61 | 62 | # Parameters: 63 | # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. 64 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 65 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 66 | # action_notification_export_id (required) - int64 - ID of the associated action notification export. 67 | def self.list(params = {}, options = {}) 68 | raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer) 69 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 70 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 71 | raise InvalidParameterError.new("Bad parameter: action_notification_export_id must be an Integer") if params[:action_notification_export_id] and !params[:action_notification_export_id].is_a?(Integer) 72 | raise MissingParameterError.new("Parameter missing: action_notification_export_id") unless params[:action_notification_export_id] 73 | 74 | List.new(ActionNotificationExportResult, params) do 75 | Api.send_request("/action_notification_export_results", :get, params, options) 76 | end 77 | end 78 | 79 | def self.all(params = {}, options = {}) 80 | list(params, options) 81 | end 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /lib/files.com/models/auto.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Auto 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # object 13 | def dynamic 14 | @attributes[:dynamic] 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/files.com/models/bundle_path.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class BundlePath 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # boolean - Allow access to subfolders content? 13 | def recursive 14 | @attributes[:recursive] 15 | end 16 | 17 | # string - The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 18 | def path 19 | @attributes[:path] 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/files.com/models/dir.rb: -------------------------------------------------------------------------------- 1 | module Files 2 | Dir = Folder 3 | end 4 | -------------------------------------------------------------------------------- /lib/files.com/models/dns_record.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class DnsRecord 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - Unique label for DNS record; used by Zapier and other integrations. 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - DNS record domain name 18 | def domain 19 | @attributes[:domain] 20 | end 21 | 22 | # string - DNS record type 23 | def rrtype 24 | @attributes[:rrtype] 25 | end 26 | 27 | # string - DNS record value 28 | def value 29 | @attributes[:value] 30 | end 31 | 32 | # Parameters: 33 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 34 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 35 | def self.list(params = {}, options = {}) 36 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 37 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 38 | 39 | List.new(DnsRecord, params) do 40 | Api.send_request("/dns_records", :get, params, options) 41 | end 42 | end 43 | 44 | def self.all(params = {}, options = {}) 45 | list(params, options) 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /lib/files.com/models/email_log.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class EmailLog 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # date-time - Start Time of Action 13 | def timestamp 14 | @attributes[:timestamp] 15 | end 16 | 17 | # string - Log Message 18 | def message 19 | @attributes[:message] 20 | end 21 | 22 | # string - Status of E-Mail delivery 23 | def status 24 | @attributes[:status] 25 | end 26 | 27 | # string - Subject line of E-Mail 28 | def subject 29 | @attributes[:subject] 30 | end 31 | 32 | # string - To field of E-Mail 33 | def to 34 | @attributes[:to] 35 | end 36 | 37 | # string - CC field of E-Mail 38 | def cc 39 | @attributes[:cc] 40 | end 41 | 42 | # string - How was the email delivered? `customer_smtp` or `files.com` 43 | def delivery_method 44 | @attributes[:delivery_method] 45 | end 46 | 47 | # string - Customer SMTP Hostname used. 48 | def smtp_hostname 49 | @attributes[:smtp_hostname] 50 | end 51 | 52 | # string - Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP). 53 | def smtp_ip 54 | @attributes[:smtp_ip] 55 | end 56 | 57 | # Parameters: 58 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 59 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 60 | # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `start_date`, `end_date` or `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 61 | # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 62 | def self.list(params = {}, options = {}) 63 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 64 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 65 | raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) 66 | raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash) 67 | 68 | List.new(EmailLog, params) do 69 | Api.send_request("/email_logs", :get, params, options) 70 | end 71 | end 72 | 73 | def self.all(params = {}, options = {}) 74 | list(params, options) 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /lib/files.com/models/errors.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Errors 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # array(string) - A list of fields where errors occur 13 | def fields 14 | @attributes[:fields] 15 | end 16 | 17 | # array(string) - A list of error messages 18 | def messages 19 | @attributes[:messages] 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/files.com/models/file_action.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class FileAction 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - Status of file operation. 13 | def status 14 | @attributes[:status] 15 | end 16 | 17 | # int64 - If status is pending, this is the id of the File Migration to check for status updates. 18 | def file_migration_id 19 | @attributes[:file_migration_id] 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/files.com/models/file_migration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class FileMigration 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - File migration ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - Source path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 18 | def path 19 | @attributes[:path] 20 | end 21 | 22 | # string - Destination path 23 | def dest_path 24 | @attributes[:dest_path] 25 | end 26 | 27 | # int64 - Number of files processed 28 | def files_moved 29 | @attributes[:files_moved] 30 | end 31 | 32 | # int64 33 | def files_total 34 | @attributes[:files_total] 35 | end 36 | 37 | # string - The type of operation 38 | def operation 39 | @attributes[:operation] 40 | end 41 | 42 | # string - Region 43 | def region 44 | @attributes[:region] 45 | end 46 | 47 | # string - Status 48 | def status 49 | @attributes[:status] 50 | end 51 | 52 | # string - Link to download the log file for this migration. 53 | def log_url 54 | @attributes[:log_url] 55 | end 56 | 57 | # Parameters: 58 | # id (required) - int64 - File Migration ID. 59 | def self.find(id, params = {}, options = {}) 60 | params ||= {} 61 | params[:id] = id 62 | raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) 63 | raise MissingParameterError.new("Parameter missing: id") unless params[:id] 64 | 65 | response, options = Api.send_request("/file_migrations/#{params[:id]}", :get, params, options) 66 | FileMigration.new(response.data, options) 67 | end 68 | 69 | def self.get(id, params = {}, options = {}) 70 | find(id, params, options) 71 | end 72 | end 73 | end 74 | -------------------------------------------------------------------------------- /lib/files.com/models/file_upload_part.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class FileUploadPart 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # object - Content-Type and File to send 13 | def send 14 | @attributes[:send] 15 | end 16 | 17 | # string - Type of upload 18 | def action 19 | @attributes[:action] 20 | end 21 | 22 | # boolean - If `true`, this file exists and you may wish to ask the user for overwrite confirmation 23 | def ask_about_overwrites 24 | @attributes[:ask_about_overwrites] 25 | end 26 | 27 | # int64 - Number of parts in the upload 28 | def available_parts 29 | @attributes[:available_parts] 30 | end 31 | 32 | # string - Date/time of when this Upload part expires and the URL cannot be used any more 33 | def expires 34 | @attributes[:expires] 35 | end 36 | 37 | # object - Additional upload headers to provide as part of the upload 38 | def headers 39 | @attributes[:headers] 40 | end 41 | 42 | # string - HTTP Method to use for uploading the part, usually `PUT` 43 | def http_method 44 | @attributes[:http_method] 45 | end 46 | 47 | # int64 - Size in bytes for this part 48 | def next_partsize 49 | @attributes[:next_partsize] 50 | end 51 | 52 | # boolean - If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order. 53 | def parallel_parts 54 | @attributes[:parallel_parts] 55 | end 56 | 57 | # boolean - If `true`, parts may be retried. If `false`, a part cannot be retried and the upload should be restarted. 58 | def retry_parts 59 | @attributes[:retry_parts] 60 | end 61 | 62 | # object - Additional HTTP parameters to send with the upload 63 | def parameters 64 | @attributes[:parameters] 65 | end 66 | 67 | # int64 - Number of this upload part 68 | def part_number 69 | @attributes[:part_number] 70 | end 71 | 72 | # int64 - Size in bytes for the next upload part 73 | def partsize 74 | @attributes[:partsize] 75 | end 76 | 77 | # string - New file path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 78 | def path 79 | @attributes[:path] 80 | end 81 | 82 | # string - Reference name for this upload part 83 | def ref 84 | @attributes[:ref] 85 | end 86 | 87 | # string - URI to upload this part to 88 | def upload_uri 89 | @attributes[:upload_uri] 90 | end 91 | end 92 | end 93 | -------------------------------------------------------------------------------- /lib/files.com/models/file_utils.rb: -------------------------------------------------------------------------------- 1 | module Files 2 | class FileUtils 3 | def self.cd(_dir, _options) 4 | raise NotImplementedError 5 | end 6 | 7 | def self.chmod(_mode, _list, _options = {}) 8 | raise NotImplementedError 9 | end 10 | 11 | def self.chmod_R(_mode, _list, _options = {}) # rubocop:disable Naming/MethodName 12 | raise NotImplementedError 13 | end 14 | 15 | def self.chown(_user, _group, _list, _options = {}) 16 | raise NotImplementedError 17 | end 18 | 19 | def self.chown_R(_user, _group, _list, _options = {}) # rubocop:disable Naming/MethodName 20 | raise NotImplementedError 21 | end 22 | 23 | def self.cp(src, dest, options = {}) 24 | src = [ src ] if src.is_a? String 25 | src.each do |path| 26 | return false if File.directory?(path, options) 27 | end 28 | cp_r(src, dest, options) 29 | end 30 | 31 | def self.cp_r(src, dest, options = {}) 32 | src = [ src ] if src.is_a? String 33 | src.each do |path| 34 | FileAction.copy(path, { destination: dest }, options) 35 | end 36 | end 37 | 38 | def self.install(src, dest, options = {}) 39 | cp_r(src, dest, options) 40 | end 41 | 42 | def self.ln(_target, _link, _options = {}) 43 | raise NotImplementedError 44 | end 45 | 46 | def self.ln_s(_targets, _dir, _options = {}) 47 | raise NotImplementedError 48 | end 49 | 50 | def self.ln_sf(_target, _link, _options = {}) 51 | raise NotImplementedError 52 | end 53 | 54 | def self.mkdir(list, params = {}, options = {}) 55 | list = [ list ] if list.is_a? String 56 | list.each do |path| 57 | Folder.mkdir(path, params, options) unless File.exist?(path, options) # rubocop:disable Lint/NonAtomicFileOperation 58 | end 59 | end 60 | 61 | def self.mkdir_p(list, options = {}) 62 | list = [ list ] if list.is_a? String 63 | 64 | to_create = list.map do |fname| 65 | split = fname.split("/") 66 | accum = "" 67 | split.map do |piece| 68 | accum = [ accum, piece ].join("/") 69 | end 70 | end.flatten 71 | 72 | mkdir(to_create, options) 73 | end 74 | 75 | def self.mv(list, dir, options = {}) 76 | list = [ list ] if list.is_a? String 77 | list.each do |path| 78 | FileAction.move(path, { destination: dir }, options) 79 | end 80 | end 81 | 82 | def self.pwd 83 | raise NotImplementedError 84 | end 85 | 86 | def self.rm(list, options = {}) 87 | list = [ list ] if list.is_a? String 88 | list.each do |fname| 89 | raise Errno::EPERM.new(fname) if File.directory?(fname, options) 90 | end 91 | 92 | list.each do |fname| # rubocop:disable Style/CombinableLoops 93 | File.delete(fname, {}, options) 94 | end 95 | end 96 | 97 | def self.rm_r(list, options = {}) 98 | list = [ list ] if list.is_a? String 99 | list.each do |path| 100 | File.delete(path, { recursive: true }, options) 101 | end 102 | end 103 | 104 | def self.rm_rf(list, options = {}) 105 | rm_r(list, options) 106 | end 107 | 108 | def self.rmdir(list, options = {}) 109 | list = [ list ] if list.is_a? String 110 | list.each do |path| 111 | File.delete(path, {}, options) if File.directory?(path, options) 112 | end 113 | end 114 | 115 | def self.touch(_list, _options = {}) 116 | raise NotImplementedError 117 | end 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /lib/files.com/models/form_field.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class FormField 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Form field id 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - Label to be displayed 18 | def label 19 | @attributes[:label] 20 | end 21 | 22 | # boolean - Is this a required field? 23 | def required 24 | @attributes[:required] 25 | end 26 | 27 | # string - Help text to be displayed 28 | def help_text 29 | @attributes[:help_text] 30 | end 31 | 32 | # string - Type of Field 33 | def field_type 34 | @attributes[:field_type] 35 | end 36 | 37 | # array(string) - Options to display for radio and dropdown 38 | def options_for_select 39 | @attributes[:options_for_select] 40 | end 41 | 42 | # string - Default option for radio and dropdown 43 | def default_option 44 | @attributes[:default_option] 45 | end 46 | 47 | # int64 - Form field set id 48 | def form_field_set_id 49 | @attributes[:form_field_set_id] 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/files.com/models/image.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Image 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - Image name 13 | def name 14 | @attributes[:name] 15 | end 16 | 17 | # string - Image URI 18 | def uri 19 | @attributes[:uri] 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/files.com/models/inbox_registration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class InboxRegistration 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - Registration cookie code 13 | def code 14 | @attributes[:code] 15 | end 16 | 17 | # string - Registrant name 18 | def name 19 | @attributes[:name] 20 | end 21 | 22 | # string - Registrant company name 23 | def company 24 | @attributes[:company] 25 | end 26 | 27 | # string - Registrant email address 28 | def email 29 | @attributes[:email] 30 | end 31 | 32 | # string - Registrant IP Address 33 | def ip 34 | @attributes[:ip] 35 | end 36 | 37 | # string - Clickwrap text that was shown to the registrant 38 | def clickwrap_body 39 | @attributes[:clickwrap_body] 40 | end 41 | 42 | # int64 - Id of associated form field set 43 | def form_field_set_id 44 | @attributes[:form_field_set_id] 45 | end 46 | 47 | # object - Data for form field set with form field ids as keys and user data as values 48 | def form_field_data 49 | @attributes[:form_field_data] 50 | end 51 | 52 | # int64 - Id of associated inbox 53 | def inbox_id 54 | @attributes[:inbox_id] 55 | end 56 | 57 | # int64 - Id of associated inbox recipient 58 | def inbox_recipient_id 59 | @attributes[:inbox_recipient_id] 60 | end 61 | 62 | # string - Title of associated inbox 63 | def inbox_title 64 | @attributes[:inbox_title] 65 | end 66 | 67 | # date-time - Registration creation date/time 68 | def created_at 69 | @attributes[:created_at] 70 | end 71 | 72 | # Parameters: 73 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 74 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 75 | # folder_behavior_id - int64 - ID of the associated Inbox. 76 | def self.list(params = {}, options = {}) 77 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 78 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 79 | raise InvalidParameterError.new("Bad parameter: folder_behavior_id must be an Integer") if params[:folder_behavior_id] and !params[:folder_behavior_id].is_a?(Integer) 80 | 81 | List.new(InboxRegistration, params) do 82 | Api.send_request("/inbox_registrations", :get, params, options) 83 | end 84 | end 85 | 86 | def self.all(params = {}, options = {}) 87 | list(params, options) 88 | end 89 | end 90 | end 91 | -------------------------------------------------------------------------------- /lib/files.com/models/inbox_upload.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class InboxUpload 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # InboxRegistration 13 | def inbox_registration 14 | @attributes[:inbox_registration] 15 | end 16 | 17 | # string - Upload path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 18 | def path 19 | @attributes[:path] 20 | end 21 | 22 | # date-time - Upload date/time 23 | def created_at 24 | @attributes[:created_at] 25 | end 26 | 27 | # Parameters: 28 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 29 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 30 | # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 31 | # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `folder_behavior_id` or `inbox_registration_id`. Valid field combinations are `[ folder_behavior_id, created_at ]`, `[ inbox_registration_id, created_at ]`, `[ folder_behavior_id, inbox_registration_id ]` or `[ folder_behavior_id, inbox_registration_id, created_at ]`. 32 | # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 33 | # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 34 | # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 35 | # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 36 | def self.list(params = {}, options = {}) 37 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 38 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 39 | raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) 40 | raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) 41 | raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash) 42 | raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash) 43 | raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash) 44 | raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash) 45 | 46 | List.new(InboxUpload, params) do 47 | Api.send_request("/inbox_uploads", :get, params, options) 48 | end 49 | end 50 | 51 | def self.all(params = {}, options = {}) 52 | list(params, options) 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /lib/files.com/models/invoice.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Invoice 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Line item Id 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # double - Line item amount 18 | def amount 19 | @attributes[:amount] 20 | end 21 | 22 | # double - Line item balance 23 | def balance 24 | @attributes[:balance] 25 | end 26 | 27 | # date-time - Line item created at 28 | def created_at 29 | @attributes[:created_at] 30 | end 31 | 32 | # string - Line item currency 33 | def currency 34 | @attributes[:currency] 35 | end 36 | 37 | # string - Line item download uri 38 | def download_uri 39 | @attributes[:download_uri] 40 | end 41 | 42 | # array(object) - Associated invoice line items 43 | def invoice_line_items 44 | @attributes[:invoice_line_items] 45 | end 46 | 47 | # string - Line item payment method 48 | def method 49 | @attributes[:method] 50 | end 51 | 52 | # array(object) - Associated payment line items 53 | def payment_line_items 54 | @attributes[:payment_line_items] 55 | end 56 | 57 | # date-time - Date/time payment was reversed if applicable 58 | def payment_reversed_at 59 | @attributes[:payment_reversed_at] 60 | end 61 | 62 | # string - Type of payment if applicable 63 | def payment_type 64 | @attributes[:payment_type] 65 | end 66 | 67 | # string - Site name this line item is for 68 | def site_name 69 | @attributes[:site_name] 70 | end 71 | 72 | # string - Type of line item, either payment or invoice 73 | def type 74 | @attributes[:type] 75 | end 76 | 77 | # Parameters: 78 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 79 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 80 | def self.list(params = {}, options = {}) 81 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 82 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 83 | 84 | List.new(AccountLineItem, params) do 85 | Api.send_request("/invoices", :get, params, options) 86 | end 87 | end 88 | 89 | def self.all(params = {}, options = {}) 90 | list(params, options) 91 | end 92 | 93 | # Parameters: 94 | # id (required) - int64 - Invoice ID. 95 | def self.find(id, params = {}, options = {}) 96 | params ||= {} 97 | params[:id] = id 98 | raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) 99 | raise MissingParameterError.new("Parameter missing: id") unless params[:id] 100 | 101 | response, options = Api.send_request("/invoices/#{params[:id]}", :get, params, options) 102 | AccountLineItem.new(response.data, options) 103 | end 104 | 105 | def self.get(id, params = {}, options = {}) 106 | find(id, params, options) 107 | end 108 | end 109 | end 110 | -------------------------------------------------------------------------------- /lib/files.com/models/invoice_line_item.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class InvoiceLineItem 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # double - Invoice line item amount 13 | def amount 14 | @attributes[:amount] 15 | end 16 | 17 | # date-time - Invoice line item created at date/time 18 | def created_at 19 | @attributes[:created_at] 20 | end 21 | 22 | # string - Invoice line item description 23 | def description 24 | @attributes[:description] 25 | end 26 | 27 | # string - Invoice line item type 28 | def type 29 | @attributes[:type] 30 | end 31 | 32 | # date-time - Invoice line item service end date/time 33 | def service_end_at 34 | @attributes[:service_end_at] 35 | end 36 | 37 | # date-time - Invoice line item service start date/time 38 | def service_start_at 39 | @attributes[:service_start_at] 40 | end 41 | 42 | # string - Plan name 43 | def plan 44 | @attributes[:plan] 45 | end 46 | 47 | # string - Site name 48 | def site 49 | @attributes[:site] 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/files.com/models/payment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Payment 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Line item Id 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # double - Line item amount 18 | def amount 19 | @attributes[:amount] 20 | end 21 | 22 | # double - Line item balance 23 | def balance 24 | @attributes[:balance] 25 | end 26 | 27 | # date-time - Line item created at 28 | def created_at 29 | @attributes[:created_at] 30 | end 31 | 32 | # string - Line item currency 33 | def currency 34 | @attributes[:currency] 35 | end 36 | 37 | # string - Line item download uri 38 | def download_uri 39 | @attributes[:download_uri] 40 | end 41 | 42 | # array(object) - Associated invoice line items 43 | def invoice_line_items 44 | @attributes[:invoice_line_items] 45 | end 46 | 47 | # string - Line item payment method 48 | def method 49 | @attributes[:method] 50 | end 51 | 52 | # array(object) - Associated payment line items 53 | def payment_line_items 54 | @attributes[:payment_line_items] 55 | end 56 | 57 | # date-time - Date/time payment was reversed if applicable 58 | def payment_reversed_at 59 | @attributes[:payment_reversed_at] 60 | end 61 | 62 | # string - Type of payment if applicable 63 | def payment_type 64 | @attributes[:payment_type] 65 | end 66 | 67 | # string - Site name this line item is for 68 | def site_name 69 | @attributes[:site_name] 70 | end 71 | 72 | # string - Type of line item, either payment or invoice 73 | def type 74 | @attributes[:type] 75 | end 76 | 77 | # Parameters: 78 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 79 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 80 | def self.list(params = {}, options = {}) 81 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 82 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 83 | 84 | List.new(AccountLineItem, params) do 85 | Api.send_request("/payments", :get, params, options) 86 | end 87 | end 88 | 89 | def self.all(params = {}, options = {}) 90 | list(params, options) 91 | end 92 | 93 | # Parameters: 94 | # id (required) - int64 - Payment ID. 95 | def self.find(id, params = {}, options = {}) 96 | params ||= {} 97 | params[:id] = id 98 | raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) 99 | raise MissingParameterError.new("Parameter missing: id") unless params[:id] 100 | 101 | response, options = Api.send_request("/payments/#{params[:id]}", :get, params, options) 102 | AccountLineItem.new(response.data, options) 103 | end 104 | 105 | def self.get(id, params = {}, options = {}) 106 | find(id, params, options) 107 | end 108 | end 109 | end 110 | -------------------------------------------------------------------------------- /lib/files.com/models/payment_line_item.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class PaymentLineItem 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # double - Payment line item amount 13 | def amount 14 | @attributes[:amount] 15 | end 16 | 17 | # date-time - Payment line item created at date/time 18 | def created_at 19 | @attributes[:created_at] 20 | end 21 | 22 | # int64 - Invoice ID 23 | def invoice_id 24 | @attributes[:invoice_id] 25 | end 26 | 27 | # int64 - Payment ID 28 | def payment_id 29 | @attributes[:payment_id] 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/files.com/models/preview.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Preview 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Preview ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - Preview status. Can be invalid, not_generated, generating, complete, or file_too_large 18 | def status 19 | @attributes[:status] 20 | end 21 | 22 | # string - Link to download preview 23 | def download_uri 24 | @attributes[:download_uri] 25 | end 26 | 27 | # string - Preview type. Can be image, pdf, pdf_native, video, or audio 28 | def type 29 | @attributes[:type] 30 | end 31 | 32 | # string - Preview size 33 | def size 34 | @attributes[:size] 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/files.com/models/priority.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Priority 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - The path corresponding to the priority color. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 13 | def path 14 | @attributes[:path] 15 | end 16 | 17 | # string - The priority color 18 | def color 19 | @attributes[:color] 20 | end 21 | 22 | # Parameters: 23 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 24 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 25 | # path (required) - string - The path to query for priorities 26 | def self.list(path, params = {}, options = {}) 27 | params ||= {} 28 | params[:path] = path 29 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 30 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 31 | raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String) 32 | raise MissingParameterError.new("Parameter missing: path") unless params[:path] 33 | 34 | List.new(Priority, params) do 35 | Api.send_request("/priorities", :get, params, options) 36 | end 37 | end 38 | 39 | def self.all(path, params = {}, options = {}) 40 | list(path, params, options) 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/files.com/models/public_ip_address.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class PublicIpAddress 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - The public IP address. 13 | def ip_address 14 | @attributes[:ip_address] 15 | end 16 | 17 | # string - The name of the frontend server. 18 | def server_name 19 | @attributes[:server_name] 20 | end 21 | 22 | # boolean 23 | def ftp_enabled 24 | @attributes[:ftp_enabled] 25 | end 26 | 27 | # boolean 28 | def sftp_enabled 29 | @attributes[:sftp_enabled] 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/files.com/models/remote_bandwidth_snapshot.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class RemoteBandwidthSnapshot 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Site bandwidth ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # double - Site sync bandwidth report bytes received 18 | def sync_bytes_received 19 | @attributes[:sync_bytes_received] 20 | end 21 | 22 | # double - Site sync bandwidth report bytes sent 23 | def sync_bytes_sent 24 | @attributes[:sync_bytes_sent] 25 | end 26 | 27 | # date-time - Time the site bandwidth report was logged 28 | def logged_at 29 | @attributes[:logged_at] 30 | end 31 | 32 | # int64 - ID of related Remote Server 33 | def remote_server_id 34 | @attributes[:remote_server_id] 35 | end 36 | 37 | # Parameters: 38 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 41 | # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 42 | # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 43 | # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 44 | # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 45 | # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 46 | def self.list(params = {}, options = {}) 47 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 48 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 49 | raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) 50 | raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) 51 | raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash) 52 | raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash) 53 | raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash) 54 | raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash) 55 | 56 | List.new(RemoteBandwidthSnapshot, params) do 57 | Api.send_request("/remote_bandwidth_snapshots", :get, params, options) 58 | end 59 | end 60 | 61 | def self.all(params = {}, options = {}) 62 | list(params, options) 63 | end 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /lib/files.com/models/settings_change.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class SettingsChange 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - The API key id responsible for this change. 13 | def api_key_id 14 | @attributes[:api_key_id] 15 | end 16 | 17 | # array(string) - Markdown-formatted change messages. 18 | def changes 19 | @attributes[:changes] 20 | end 21 | 22 | # date-time - The time this change was made. 23 | def created_at 24 | @attributes[:created_at] 25 | end 26 | 27 | # int64 - The user id responsible for this change. 28 | def user_id 29 | @attributes[:user_id] 30 | end 31 | 32 | # boolean - true if this change was performed by Files.com support. 33 | def user_is_files_support 34 | @attributes[:user_is_files_support] 35 | end 36 | 37 | # boolean - true if this change was performed by a user on a parent site. 38 | def user_is_from_parent_site 39 | @attributes[:user_is_from_parent_site] 40 | end 41 | 42 | # string - The username of the user responsible for this change. 43 | def username 44 | @attributes[:username] 45 | end 46 | 47 | # Parameters: 48 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 49 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 50 | # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `api_key_id` or `user_id`. 51 | # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`. 52 | def self.list(params = {}, options = {}) 53 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 54 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 55 | raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) 56 | raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) 57 | 58 | List.new(SettingsChange, params) do 59 | Api.send_request("/settings_changes", :get, params, options) 60 | end 61 | end 62 | 63 | def self.all(params = {}, options = {}) 64 | list(params, options) 65 | end 66 | end 67 | end 68 | -------------------------------------------------------------------------------- /lib/files.com/models/share_group_member.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class ShareGroupMember 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - Name of the share group member 13 | def name 14 | @attributes[:name] 15 | end 16 | 17 | # string - Company of the share group member 18 | def company 19 | @attributes[:company] 20 | end 21 | 22 | # string - Email of the share group member 23 | def email 24 | @attributes[:email] 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/files.com/models/status.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Status 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - Status HTTP code 13 | def code 14 | @attributes[:code] 15 | end 16 | 17 | # string - Error message 18 | def message 19 | @attributes[:message] 20 | end 21 | 22 | # string - Status message 23 | def status 24 | @attributes[:status] 25 | end 26 | 27 | # Auto - Additional data 28 | def data 29 | @attributes[:data] 30 | end 31 | 32 | # array(object) - A list of api errors 33 | def errors 34 | @attributes[:errors] 35 | end 36 | 37 | # int64 - Required Clickwrap id 38 | def clickwrap_id 39 | @attributes[:clickwrap_id] 40 | end 41 | 42 | # string - Required Clickwrap body 43 | def clickwrap_body 44 | @attributes[:clickwrap_body] 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /lib/files.com/models/usage_by_top_level_dir.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class UsageByTopLevelDir 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # string - Directory name 13 | def dir 14 | @attributes[:dir] 15 | end 16 | 17 | # int64 - Usage 18 | def size 19 | @attributes[:size] 20 | end 21 | 22 | # int64 - File count 23 | def count 24 | @attributes[:count] 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/files.com/models/user_cipher_use.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class UserCipherUse 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - UserCipherUse ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - The protocol and cipher employed 18 | def protocol_cipher 19 | @attributes[:protocol_cipher] 20 | end 21 | 22 | # date-time - The earliest recorded use of this combination of interface and protocol and cipher (for this user) 23 | def created_at 24 | @attributes[:created_at] 25 | end 26 | 27 | # boolean - Is this cipher considered insecure? 28 | def insecure 29 | @attributes[:insecure] 30 | end 31 | 32 | # string - The interface accessed 33 | def interface 34 | @attributes[:interface] 35 | end 36 | 37 | # date-time - The most recent use of this combination of interface and protocol and cipher (for this user) 38 | def updated_at 39 | @attributes[:updated_at] 40 | end 41 | 42 | # int64 - ID of the user who performed this access 43 | def user_id 44 | @attributes[:user_id] 45 | end 46 | 47 | # Parameters: 48 | # user_id - int64 - User ID. If provided, will return uses for this user. 49 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 50 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 51 | def self.list(params = {}, options = {}) 52 | raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer) 53 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 54 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 55 | 56 | List.new(UserCipherUse, params) do 57 | Api.send_request("/user_cipher_uses", :get, params, options) 58 | end 59 | end 60 | 61 | def self.all(params = {}, options = {}) 62 | list(params, options) 63 | end 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /lib/files.com/models/user_sftp_client_use.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class UserSftpClientUse 5 | attr_reader :options, :attributes 6 | 7 | def initialize(attributes = {}, options = {}) 8 | @attributes = attributes || {} 9 | @options = options || {} 10 | end 11 | 12 | # int64 - UserSftpClientUse ID 13 | def id 14 | @attributes[:id] 15 | end 16 | 17 | # string - The SFTP client used 18 | def sftp_client 19 | @attributes[:sftp_client] 20 | end 21 | 22 | # date-time - The earliest recorded use of this SFTP client (for this user) 23 | def created_at 24 | @attributes[:created_at] 25 | end 26 | 27 | # date-time - The most recent use of this SFTP client (for this user) 28 | def updated_at 29 | @attributes[:updated_at] 30 | end 31 | 32 | # int64 - ID of the user who performed this access 33 | def user_id 34 | @attributes[:user_id] 35 | end 36 | 37 | # Parameters: 38 | # user_id - int64 - User ID. If provided, will return uses for this user. 39 | # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 40 | # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | def self.list(params = {}, options = {}) 42 | raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer) 43 | raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) 44 | raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) 45 | 46 | List.new(UserSftpClientUse, params) do 47 | Api.send_request("/user_sftp_client_uses", :get, params, options) 48 | end 49 | end 50 | 51 | def self.all(params = {}, options = {}) 52 | list(params, options) 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /lib/files.com/path_util.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | module PathUtil 5 | TRANSLIT_MAP = "ÀA,ÁA,ÂA,ÃA,ÄA,ÅA,ÆAE,ÇC,ÈE,ÉE,ÊE,ËE,ÌI,ÍI,ÎI,ÏI,ÐD,ÑN,ÒO,ÓO,ÔO,ÕO,ÖO,ØO,ÙU,ÚU,ÛU,ÜU,ÝY,ßss,àa,áa,âa,ãa,äa,åa,æae,çc,èe,ée,êe,ëe,ìi,íi,îi,ïi,ðd,ñn,òo,óo,ôo,õo,öo,øo,ùu,úu,ûu,üu,ýy,ÿy,ĀA,āa,ĂA,ăa,ĄA,ąa,ĆC,ćc,ĈC,ĉc,ĊC,ċc,ČC,čc,ĎD,ďd,ĐD,đd,ĒE,ēe,ĔE,ĕe,ĖE,ėe,ĘE,ęe,ĚE,ěe,ĜG,ĝg,ĞG,ğg,ĠG,ġg,ĢG,ģg,ĤH,ĥh,ĦH,ħh,ĨI,ĩi,ĪI,īi,ĬI,ĭi,ĮI,įi,İI,IJIJ,ijij,ĴJ,ĵj,ĶK,ķk,ĹL,ĺl,ĻL,ļl,ĽL,ľl,ŁL,łl,ŃN,ńn,ŅN,ņn,ŇN,ňn,ʼn'n,ŌO,ōo,ŎO,ŏo,ŐO,őo,ŒOE,œoe,ŔR,ŕr,ŖR,ŗr,ŘR,řr,ŚS,śs,ŜS,ŝs,ŞS,şs,ŠS,šs,ŢT,ţt,ŤT,ťt,ŨU,ũu,ŪU,ūu,ŬU,ŭu,ŮU,ůu,ŰU,űu,ŲU,ųu,ŴW,ŵw,ŶY,ŷy,ŸY,ŹZ,źz,ŻZ,żz,ŽZ,žz".split(",").to_h { |val| [ val[0], val[1..2] ] }.freeze 6 | 7 | def self.normalize_for_comparison(*args) 8 | unicode_normalize_and_transliterate(normalize(*args).to_s).downcase.rstrip 9 | end 10 | 11 | def self.same?(a, b) 12 | normalize_for_comparison(a) == normalize_for_comparison(b) 13 | end 14 | 15 | def self.cleanpath(path) 16 | new_path = Pathname.new(path).cleanpath.to_s 17 | 18 | return "" if [ ".", ".." ].include? new_path 19 | return new_path[1..] if new_path.index('/') == 0 20 | 21 | new_path 22 | end 23 | 24 | private_class_method def self.normalize(*paths) 25 | all_paths = paths.flatten.compact.map { |path| u8(path).gsub("\x00", "").gsub("\\", "/").split("/") }.flatten 26 | all_paths.map { |path| cleanpath(path) }.reject(&:empty?).join("/") 27 | end 28 | 29 | private_class_method def self.u8(str) 30 | new_string = begin 31 | str.encode("UTF-8") 32 | rescue Encoding::UndefinedConversionError 33 | str.dup.force_encoding("UTF-8") 34 | end 35 | 36 | if new_string.valid_encoding? 37 | new_string 38 | else 39 | new_string.force_encoding("ISO-8859-1").encode("UTF-8") 40 | end 41 | end 42 | 43 | private_class_method def self.unicode_normalize_and_transliterate(string) 44 | # convert multi-code-point characters into single-code-point characters 45 | normalized_string = string.unicode_normalize(:nfkc) 46 | 47 | normalized_string.gsub(/[^\x00-\x7f]/u) do |char| 48 | TRANSLIT_MAP[char] || char 49 | end 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/files.com/response.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class Response 5 | attr_accessor :data, :http_body, :http_headers, :http_status 6 | 7 | def self.from_faraday_hash(http_resp) 8 | resp = new 9 | resp.data = JSON.parse(http_resp[:body], symbolize_names: true) if http_resp[:status] != 204 10 | resp.http_body = http_resp[:body] 11 | resp.http_headers = http_resp[:headers] 12 | resp.http_status = http_resp[:status] 13 | resp 14 | end 15 | 16 | def self.from_faraday_response(http_resp) 17 | resp = new 18 | resp.data = JSON.parse(http_resp.body, symbolize_names: true) if http_resp.status != 204 19 | resp.http_body = http_resp.body 20 | resp.http_headers = http_resp.headers 21 | resp.http_status = http_resp.status 22 | resp 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/files.com/sizable_io.rb: -------------------------------------------------------------------------------- 1 | module Files 2 | class SizableIO < IO 3 | def self.pipe 4 | r, w = super 5 | 6 | w.instance_variable_set(:@read_io, r) 7 | 8 | [ r, w ] 9 | end 10 | 11 | def size 12 | read_io.content_length_promise.wait.value 13 | end 14 | 15 | def wait!(timeout = nil) 16 | read_io.ready_promise.wait(timeout) 17 | error! 18 | self 19 | end 20 | 21 | def fulfill_content_length(length) 22 | read_io.content_length = length 23 | read_io.content_length_promise.execute 24 | end 25 | 26 | def ready! 27 | read_io.ready_promise.execute 28 | end 29 | 30 | def close 31 | raise @with_error if @with_error 32 | 33 | super 34 | read_io.content_length_promise.try_set(nil) 35 | read_io.ready_promise.try_set(true) 36 | end 37 | 38 | def error! 39 | raise read_io.with_error if read_io.with_error 40 | end 41 | 42 | def do_set_error(e) 43 | read_io.with_error = e 44 | end 45 | 46 | protected 47 | 48 | attr_accessor :content_length, :with_error 49 | 50 | def content_length_promise 51 | @content_length_promise ||= Concurrent::Promise.new { content_length } 52 | end 53 | 54 | def ready_promise 55 | @ready_promise ||= Concurrent::Promise.new { true } 56 | end 57 | 58 | def read_io 59 | @read_io || self 60 | end 61 | 62 | def read_io? 63 | read_io == self 64 | end 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /lib/files.com/system_profiler.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | class SystemProfiler 5 | def self.uname 6 | if ::File.exist?("/proc/version") 7 | ::File.read("/proc/version").strip 8 | else 9 | case RbConfig::CONFIG["host_os"] 10 | when /linux|darwin|bsd|sunos|solaris|cygwin/i 11 | uname_from_system 12 | when /mswin|mingw/i 13 | uname_from_system_ver 14 | else 15 | "unknown platform" 16 | end 17 | end 18 | end 19 | 20 | def self.uname_from_system 21 | (`uname -a 2>/dev/null` || "").strip 22 | rescue Errno::ENOENT 23 | "uname executable not found" 24 | rescue Errno::ENOMEM # couldn't create subprocess 25 | "uname lookup failed" 26 | end 27 | 28 | def self.uname_from_system_ver 29 | (`ver` || "").strip 30 | rescue Errno::ENOENT 31 | "ver executable not found" 32 | rescue Errno::ENOMEM # couldn't create subprocess 33 | "uname lookup failed" 34 | end 35 | 36 | def initialize 37 | @uname = self.class.uname 38 | end 39 | 40 | def user_agent 41 | lang_version = "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})" 42 | 43 | { 44 | application: Files.app_info, 45 | bindings_version: Files::VERSION, 46 | lang: "ruby", 47 | lang_version: lang_version, 48 | platform: RUBY_PLATFORM, 49 | engine: defined?(RUBY_ENGINE) ? RUBY_ENGINE : "", 50 | publisher: "Action Verb LLC", 51 | uname: @uname, 52 | hostname: Socket.gethostname, 53 | }.delete_if { |_k, v| v.nil? } 54 | end 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/files.com/uri.rb: -------------------------------------------------------------------------------- 1 | module Files 2 | module URI 3 | # This is a copy of Addressable::URI.normalize_component without Addressable::IDNA.unicode_normalize_kc. 4 | def self.normalize_component(component, character_class = 5 | Addressable::URI::CharacterClasses::RESERVED + Addressable::URI::CharacterClasses::UNRESERVED, 6 | leave_encoded = '') 7 | return nil if component.nil? 8 | 9 | unless component.is_a? String 10 | begin 11 | component = component.to_str 12 | rescue NoMethodError, TypeError 13 | raise TypeError, "Can't convert #{component.class} into String." 14 | end 15 | end 16 | 17 | unless [ String, Regexp ].include?(character_class.class) 18 | raise TypeError, 19 | "Expected String or Regexp, got #{character_class.inspect}" 20 | end 21 | if character_class.is_a?(String) 22 | leave_re = unless leave_encoded.empty? 23 | character_class = "#{character_class}%" unless character_class.include?('%') 24 | 25 | "|%(?!#{leave_encoded.chars.map do |char| 26 | seq = SEQUENCE_ENCODING_TABLE[char] 27 | [ seq.upcase, seq.downcase ] 28 | end.flatten.join('|')})" 29 | end 30 | 31 | character_class = /[^#{character_class}]#{leave_re}/ 32 | end 33 | # We can't perform regexps on invalid UTF sequences, but 34 | # here we need to, so switch to ASCII. 35 | component = component.dup 36 | component.force_encoding(Encoding::ASCII_8BIT) 37 | encoded = Addressable::URI.encode_component( 38 | component, 39 | character_class, 40 | leave_encoded 41 | ) 42 | encoded.force_encoding(Encoding::UTF_8) 43 | encoded 44 | end 45 | 46 | def self.normalized_path(path) 47 | if path =~ Addressable::URI::NORMPATH 48 | # Relative paths with colons in the first segment are ambiguous. 49 | path = path.sub(":", "%2F") 50 | end 51 | # String#split(delimeter, -1) uses the more strict splitting behavior 52 | # found by default in Python. 53 | result = path.strip.split(Addressable::URI::SLASH, -1).map do |segment| 54 | normalize_component( 55 | segment, 56 | Addressable::URI::CharacterClasses::PCHAR 57 | ) 58 | end.join(Addressable::URI::SLASH) 59 | 60 | # All normalized values should be UTF-8 61 | result.force_encoding(Encoding::UTF_8) 62 | end 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /lib/files.com/util.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | module Util 5 | OPTS = Set[:api_key, :client, :session_id].freeze 6 | COLOR_CODES = { 7 | black: 0, light_black: 60, 8 | red: 1, light_red: 61, 9 | green: 2, light_green: 62, 10 | yellow: 3, light_yellow: 63, 11 | blue: 4, light_blue: 64, 12 | magenta: 5, light_magenta: 65, 13 | cyan: 6, light_cyan: 66, 14 | white: 7, light_white: 67, 15 | default: 9, 16 | }.freeze 17 | 18 | def self.colorize(val, color, isatty) 19 | return val unless isatty 20 | 21 | mode = 0 # default 22 | foreground = 30 + COLOR_CODES.fetch(color) 23 | background = 40 + COLOR_CODES.fetch(:default) 24 | 25 | "\033[#{mode};#{foreground};#{background}m#{val}\033[0m" 26 | end 27 | 28 | def self.level_name(level) 29 | case level 30 | when LEVEL_DEBUG then "debug" 31 | when LEVEL_ERROR then "error" 32 | when LEVEL_INFO then "info" 33 | else level 34 | end 35 | end 36 | 37 | def self.log_error(message, data = {}) 38 | if !Files.logger.nil? || 39 | (!Files.log_level.nil? && Files.log_level <= Files::LEVEL_ERROR) 40 | log_internal(message, data, color: :cyan, level: Files::LEVEL_ERROR, 41 | logger: Files.logger, out: $stderr 42 | ) 43 | end 44 | end 45 | 46 | def self.log_info(message, data = {}) 47 | if !Files.logger.nil? || 48 | (!Files.log_level.nil? && Files.log_level <= Files::LEVEL_INFO) 49 | log_internal(message, data, color: :cyan, level: Files::LEVEL_INFO, 50 | logger: Files.logger, out: $stdout 51 | ) 52 | end 53 | end 54 | 55 | def self.log_debug(message, data = {}) 56 | if !Files.logger.nil? || 57 | (!Files.log_level.nil? && Files.log_level <= Files::LEVEL_DEBUG) 58 | log_internal(message, data, color: :blue, level: Files::LEVEL_DEBUG, 59 | logger: Files.logger, out: $stdout 60 | ) 61 | end 62 | end 63 | 64 | def self.log_internal(message, data = {}, color: nil, level: nil, 65 | logger: nil, out: nil) 66 | data_str = data.compact.map do |(k, v)| 67 | format("%s=%s", 68 | key: colorize(k, color, logger.nil? && !out.nil? && out.isatty), 69 | value: v 70 | ) 71 | end.join(" ") 72 | 73 | if !logger.nil? 74 | # the library's log levels are mapped to the same values as the 75 | # standard library's logger 76 | logger.log(level, 77 | format("message=%s %s", 78 | message: message, 79 | data_str: data_str 80 | ) 81 | ) 82 | elsif out.isatty 83 | out.puts format("%s %s %s", 84 | level: colorize(level_name(level)[0, 4].upcase, 85 | color, out.isatty 86 | ), 87 | message: message, 88 | data_str: data_str 89 | ) 90 | else 91 | out.puts format("message=%s level=%s %s", 92 | message: message, 93 | level: level_name(level), 94 | data_str: data_str 95 | ) 96 | end 97 | end 98 | 99 | def self.check_api_key!(key) 100 | raise TypeError, "api_key must be a string" unless key.is_a?(String) 101 | 102 | key 103 | end 104 | end 105 | end 106 | -------------------------------------------------------------------------------- /lib/files.com/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Files 4 | VERSION = "1.1.266" 5 | end 6 | -------------------------------------------------------------------------------- /shared/header_test_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "headers": {}, 4 | "result": null 5 | }, 6 | { 7 | "headers": { 8 | "Retry-After": ["aaaaaa"] 9 | }, 10 | "result": null 11 | }, 12 | { 13 | "headers": { 14 | "Retry-After": ["5"] 15 | }, 16 | "result": 5 17 | }, 18 | { 19 | "headers": { 20 | "Retry-After": ["60"] 21 | }, 22 | "result": null 23 | }, 24 | { 25 | "headers": { 26 | "Retry-After": ["5", "10"] 27 | }, 28 | "result": 5 29 | }, 30 | { 31 | "headers": { 32 | "Retry-After": ["5", "aaaaaa"] 33 | }, 34 | "result": 5 35 | }, 36 | { 37 | "headers": { 38 | "Retry-After": ["%s"] 39 | }, 40 | "result": 8 41 | } 42 | ] -------------------------------------------------------------------------------- /shared/normalization_for_comparison_test_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ "filename.txt", "filename.txt" ], 3 | [ "FiLeNaMe.TxT", "filename.txt" ], 4 | [ "FILENAME.TXT", "filename.txt" ], 5 | [ "FÎŁĘÑÂMÉ.TXT", "filename.txt" ], 6 | [ "Fïłèńämê.Txt", "filename.txt" ], 7 | [ "a/b/c.txt", "a/b/c.txt" ], 8 | [ "A\\B\\C.TXT", "a/b/c.txt" ], 9 | [ "A/B\\C.TXT", "a/b/c.txt" ], 10 | [ "//a/b//c.txt", "a/b/c.txt" ], 11 | [ "a/b/c.txt ", "a/b/c.txt" ], 12 | [ "a/b/c.txt\t", "a/b/c.txt" ], 13 | [ "a/b/c.txt\n", "a/b/c.txt" ], 14 | [ "a/b/c.txt\r", "a/b/c.txt" ], 15 | [ " space_at_beginning", " space_at_beginning"], 16 | [ "space_at_end ", "space_at_end"], 17 | [ "tab\tseparated", "tab\tseparated"], 18 | [ "hello</hello>", "<title>hello</hello>"], 19 | [ "안녕하세요", "안녕하세요" ], 20 | [ "こんにちは", "こんにちは" ], 21 | [ "今日は", "今日は" ], 22 | [ "longest_unicode_character_﷽", "longest_unicode_character_﷽"], 23 | [ "invalid_null_byte_before\u0000after", "invalid_null_byte_beforeafter" ], 24 | [ "a/b/c/../../hello", "a/b/c/hello" ], 25 | [ "a/b/c/././hello", "a/b/c/hello" ], 26 | [ "one_code_point_ą", "one_code_point_a" ], 27 | [ "two_code_points_ą", "two_code_points_a" ], 28 | [ "one_code_point_훯", "one_code_point_훯"], 29 | [ "three_code_points_훯", "three_code_points_훯" ], 30 | [ "ÞþŊŋŦŧ", "þþŋŋŧŧ" ], 31 | [ "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "aaaaaaaeceeeeiiiidnoooooouuuuyssaaaaaaaeceeeeiiiidnoooooouuuuyy" ], 32 | [ "ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİIJij", "aaaaaaccccccccddddeeeeeeeeeegggggggghhhhiiiiiiiiiijij" ], 33 | [ "ĴĵĶķĹĺĻļĽľŁłŃńŅņŇňʼnŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤť", "jjkkllllllllnnnnnnʼnoooooooeoerrrrrrsssssssstttt" ], 34 | [ "ŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž", "uuuuuuuuuuuuwwyyyzzzzzz" ], 35 | [ "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗", "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗" ], 36 | [ "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️", "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️" ], 37 | [ "emoji_‼️", "emoji_!!️" ], 38 | [ "<title>hello<:hello>.txt", "<title>hello<:hello>.txt" ], 39 | [ "twodotfile..txt", "twodotfile..txt" ], 40 | [ "three/.../dots_path", "three/.../dots_path" ], 41 | [ ".", "" ], 42 | [ "..", ""], 43 | [ "./..", "" ], 44 | [ "../..", ""], 45 | [ "./.", "" ], 46 | [ "../.", ""], 47 | [ "./../.", "" ], 48 | [ ".././..", ""] 49 | ] -------------------------------------------------------------------------------- /shared/url_test_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "substitute_urls": [ 3 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=%s&X-Goog-Expires=%s&X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-SignedHeaders=host", 4 | "https://s3.amazonaws.com/test.example.com/metadata/1234/00000000-0000-0000-0001-00000000?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=%s&X-Amz-Expires=%s", 5 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=se=%s" 6 | ], 7 | "error_urls": [ 8 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z", 9 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z&X-Goog-Date=20220202T120000Z", 10 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Expires=900&X-Goog-Expires=600", 11 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=se=20220101T120000Z&sp=se=20220202T120000Z", 12 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=20220101T120000Z", 13 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101&X-Goog-Expires=900", 14 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=asdf&X-Goog-Expires=900", 15 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z&&X-Goog-Expires=900", 16 | "https://s3.amazonaws.com/test.example.com/metadata/1234/00000000-0000-0000-0001-00000000?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=asdf&X-Amz-Expires=900" 17 | ] 18 | } -------------------------------------------------------------------------------- /spec/language_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | 3 | RSpec.describe 'Language setting', :with_test_folder do 4 | it 'sets the language' do 5 | # Set language and verify 6 | Files.language = 'es' 7 | expect(Files.language).to eq('es') 8 | begin 9 | Files::File.find(test_folder.join("read.txt").to_s, {}, options) 10 | rescue StandardError => e 11 | expect(e.message).to include('No se ha encontrado') 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/models/folder_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | 3 | RSpec.describe Files::Folder, :with_test_folder do 4 | xdescribe "#list_for" do 5 | before do 6 | Files::File.open(test_folder.join("example.txt").to_s, 'w', options) do |f| 7 | f.write("my text") 8 | end 9 | 10 | Files::Folder.mkdir(test_folder.join("other").to_s, {}, options) 11 | 12 | Files::File.open(test_folder.join("other/example2.txt").to_s, 'w', options) do |f| 13 | f.write("my text 2") 14 | end 15 | end 16 | 17 | it "lists from the root" do 18 | results = described_class.list_for(test_folder.to_s, {}, options) 19 | 20 | expect(results.map(&:path).to_a).to match_array([ test_folder.join("example.txt").to_s, test_folder.join("other").to_s ]) 21 | expect(results.map(&:type).to_a).to match_array(%w[file directory]) 22 | end 23 | end 24 | 25 | xdescribe "#delete" do 26 | it "deletes a folder" do 27 | Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options) 28 | Files::Folder.delete(test_folder.join("my-new-folder").to_s, {}, options) 29 | 30 | expect(Files::Folder.exist?(test_folder.join("my-new-folder").to_s, options)).to eq(false) 31 | end 32 | end 33 | 34 | xdescribe "mkdir" do 35 | it "makes a new folder" do 36 | Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options) 37 | expect(Files::Folder.exist?(test_folder.join("my-new-folder").to_s, options)).to eq(true) 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /spec/path_util_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | require 'json' 3 | 4 | RSpec.describe Files::PathUtil do 5 | json_str = File.read("shared/normalization_for_comparison_test_data.json") 6 | test_cases = JSON.parse json_str 7 | 8 | test_cases.each do |test_case_info| 9 | src_chars, dst_chars = test_case_info 10 | example "normalizes #{src_chars} to #{dst_chars}" do 11 | expect(Files::PathUtil.same?(src_chars, dst_chars)).to eq(true) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require "files.com" 2 | require "pathname" 3 | 4 | RSpec.configure do |config| 5 | config.expect_with :rspec do |expectations| 6 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 7 | end 8 | 9 | config.mock_with :rspec do |mocks| 10 | mocks.verify_partial_doubles = true 11 | end 12 | 13 | RSpec.shared_context "API Helpers" do 14 | let(:test_folder) { @test_folder } 15 | let(:api_key) { @api_key } 16 | let(:options) { { api_key: api_key } } 17 | end 18 | 19 | config.include_context "API Helpers", :with_test_folder 20 | 21 | config.around(:example, :with_test_folder) do |all| 22 | @api_key = ENV["TEST_API_KEY"] || File.read("../../config/test_api_key.txt") 23 | @test_folder = Pathname.new("files_regional_worker/#{SecureRandom.uuid}") 24 | Files::Folder.exist?("files_regional_worker", api_key: @api_key) 25 | Files::Folder.mkdir("files_regional_worker", {}, api_key: @api_key) unless Files::Folder.exist?("files_regional_worker", api_key: @api_key) 26 | Files::Folder.mkdir(@test_folder.to_s, {}, api_key: @api_key) 27 | all.run 28 | ensure 29 | Files::Folder.delete(@test_folder.to_s, { recursive: true }, api_key: @api_key) 30 | end 31 | 32 | config.shared_context_metadata_behavior = :apply_to_host_groups 33 | config.disable_monkey_patching! 34 | config.order = :random 35 | Kernel.srand config.seed 36 | end 37 | -------------------------------------------------------------------------------- /spec/uri_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | 3 | RSpec.describe Files::URI do 4 | describe "normalized_path" do 5 | it { expect(described_class.normalized_path("path/[[strange stuff]]#yes.text")).to eq("path/%5B%5Bstrange%20stuff%5D%5D%23yes.text") } 6 | it { expect(Addressable::URI.unencode_component(described_class.normalized_path("[[strange stuff]]#yes.text"))).to eq("[[strange stuff]]#yes.text") } 7 | 8 | it { expect(described_class.normalized_path("folder/AdÇe")).to eq("folder/AdC%CC%A7e") } 9 | it { expect(Addressable::URI.unencode_component(described_class.normalized_path("AdÇe"))).to eq("AdÇe") } 10 | 11 | it { expect(described_class.normalized_path("lorem%20ipsum.txt")).to eq("lorem%2520ipsum.txt") } 12 | it { expect(described_class.normalized_path("lorem%ipsum.txt")).to eq("lorem%25ipsum.txt") } 13 | it { expect(described_class.normalized_path("lorem ipsum.txt")).to eq("lorem%20ipsum.txt") } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "bundler" 3 | Bundler.with_unbundled_env do 4 | Dir.chdir("generated/ruby") do 5 | system "bundle install" if ARGV[0] == "true" 6 | system "bundle exec rspec" 7 | end 8 | end -------------------------------------------------------------------------------- /test/test.rb: -------------------------------------------------------------------------------- 1 | require '../lib/files.com' 2 | require 'tempfile' 3 | 4 | def assert(value) 5 | raise "failed assertion" unless value 6 | end 7 | 8 | Files.api_key = File.read(File.expand_path("../../../.test_credentials", __dir__)).strip 9 | Files.base_url = "https://sdk.filesstaging.av" 10 | Files.logger = Logger.new($stdout) 11 | Files.log_level = 'debug' 12 | 13 | def test_user_list_and_update 14 | user = Files::User.all.first 15 | user = Files::User.find(user.id) 16 | user.name = name = "Name #{Time.now.to_i}" 17 | user.save 18 | sleep 0.5 19 | user = Files::User.find(user.id) 20 | assert(name == user.name) 21 | end 22 | 23 | def test_user_create_and_delete 24 | name = "Test User #{Time.now.to_i}" 25 | user = Files::User.new(name: name, username: "test_user_#{Time.now.to_i}") 26 | user.save 27 | sleep 0.5 28 | user = Files::User.find(user.id) 29 | assert(name == user.name) 30 | user.destroy 31 | end 32 | 33 | def test_folder_operations 34 | name = "folder_#{Time.now.to_i}" 35 | Files::Folder.create(name) 36 | file = Files::File.find(name) 37 | file.copy("#{name}_copy") 38 | file.delete 39 | file = Files::File.find("#{name}_copy") 40 | file.move("#{name}_moved_copy") 41 | file = Files::File.find("#{name}_moved_copy") 42 | Files::Folder.create("#{file.path}/child") 43 | Files::FileUtils.rm_r(file.path) 44 | end 45 | 46 | def test_file_operations 47 | name = "file_#{Time.now.to_i}.txt" 48 | Files::File.upload_file(File.expand_path("../README.md", __dir__), name) 49 | file = Files::Folder.find(name) # also finds files 50 | file.delete 51 | end 52 | 53 | def test_file_ruby_emulation 54 | data_string = "File contents - #{Time.now}" 55 | name = "file_#{Time.now.to_i}.txt" 56 | Files::File.open(name, 'w') do |f| 57 | f.write(data_string) 58 | end 59 | file = Files::File.find(name) 60 | assert(file.read == data_string) 61 | file.delete 62 | end 63 | 64 | def test_sessions 65 | session = Files::Session.create(username: "sessionuser", password: "sessionuserpassword") 66 | Files::ApiKey.list({ user_id: 0 }, session: session) 67 | session.destroy 68 | end 69 | 70 | #test_user_list_and_update 71 | #test_user_create_and_delete 72 | #test_folder_operations 73 | #test_file_operations 74 | #test_file_ruby_emulation 75 | test_sessions 76 | --------------------------------------------------------------------------------