files.com 1.0.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTORS +4 -0
  3. data/Gemfile +12 -0
  4. data/Gemfile.lock +82 -0
  5. data/LICENSE +21 -0
  6. data/README.md +119 -0
  7. data/Rakefile +12 -0
  8. data/SECURITY.md +24 -0
  9. data/_VERSION +1 -0
  10. data/bin/files +8 -0
  11. data/bin/files-console +16 -0
  12. data/docs/account_line_item.md +41 -0
  13. data/docs/action.md +37 -0
  14. data/docs/api_key.md +202 -0
  15. data/docs/app.md +57 -0
  16. data/docs/as2_key.md +133 -0
  17. data/docs/auto.md +11 -0
  18. data/docs/automation.md +190 -0
  19. data/docs/behavior.md +208 -0
  20. data/docs/bundle.md +252 -0
  21. data/docs/bundle_download.md +35 -0
  22. data/docs/clickwrap.md +143 -0
  23. data/docs/dns_record.md +35 -0
  24. data/docs/errors.md +17 -0
  25. data/docs/file.md +204 -0
  26. data/docs/file_action.md +126 -0
  27. data/docs/file_comment.md +116 -0
  28. data/docs/file_comment_reaction.md +62 -0
  29. data/docs/file_part_upload.md +37 -0
  30. data/docs/file_utils.md +4 -0
  31. data/docs/folder.md +90 -0
  32. data/docs/group.md +153 -0
  33. data/docs/group_user.md +124 -0
  34. data/docs/history.md +171 -0
  35. data/docs/history_export.md +174 -0
  36. data/docs/image.md +13 -0
  37. data/docs/invoice.md +72 -0
  38. data/docs/invoice_line_item.md +27 -0
  39. data/docs/ip_address.md +55 -0
  40. data/docs/lock.md +98 -0
  41. data/docs/message.md +147 -0
  42. data/docs/message_comment.md +132 -0
  43. data/docs/message_comment_reaction.md +94 -0
  44. data/docs/message_reaction.md +94 -0
  45. data/docs/notification.md +177 -0
  46. data/docs/payment.md +72 -0
  47. data/docs/payment_line_item.md +19 -0
  48. data/docs/permission.md +95 -0
  49. data/docs/preview.md +19 -0
  50. data/docs/project.md +121 -0
  51. data/docs/public_ip_address.md +13 -0
  52. data/docs/public_key.md +133 -0
  53. data/docs/remote_server.md +356 -0
  54. data/docs/request.md +100 -0
  55. data/docs/session.md +78 -0
  56. data/docs/site.md +448 -0
  57. data/docs/sso_strategy.md +114 -0
  58. data/docs/status.md +21 -0
  59. data/docs/style.md +93 -0
  60. data/docs/usage_daily_snapshot.md +45 -0
  61. data/docs/usage_snapshot.md +53 -0
  62. data/docs/user.md +535 -0
  63. data/docs/user_cipher_use.md +41 -0
  64. data/docs/user_request.md +93 -0
  65. data/files.com.gemspec +22 -0
  66. data/lib/files.com.rb +184 -0
  67. data/lib/files.com/api.rb +38 -0
  68. data/lib/files.com/api_client.rb +340 -0
  69. data/lib/files.com/errors.rb +41 -0
  70. data/lib/files.com/list.rb +95 -0
  71. data/lib/files.com/models/account_line_item.rb +82 -0
  72. data/lib/files.com/models/action.rb +77 -0
  73. data/lib/files.com/models/api_key.rb +270 -0
  74. data/lib/files.com/models/app.rb +101 -0
  75. data/lib/files.com/models/as2_key.rb +179 -0
  76. data/lib/files.com/models/auto.rb +17 -0
  77. data/lib/files.com/models/automation.rb +304 -0
  78. data/lib/files.com/models/behavior.rb +266 -0
  79. data/lib/files.com/models/bundle.rb +371 -0
  80. data/lib/files.com/models/bundle_download.rb +49 -0
  81. data/lib/files.com/models/clickwrap.rb +197 -0
  82. data/lib/files.com/models/dir.rb +3 -0
  83. data/lib/files.com/models/dns_record.rb +51 -0
  84. data/lib/files.com/models/errors.rb +22 -0
  85. data/lib/files.com/models/file.rb +968 -0
  86. data/lib/files.com/models/file_action.rb +126 -0
  87. data/lib/files.com/models/file_comment.rb +146 -0
  88. data/lib/files.com/models/file_comment_reaction.rb +100 -0
  89. data/lib/files.com/models/file_part_upload.rb +82 -0
  90. data/lib/files.com/models/file_utils.rb +118 -0
  91. data/lib/files.com/models/folder.rb +357 -0
  92. data/lib/files.com/models/group.rb +208 -0
  93. data/lib/files.com/models/group_user.rb +171 -0
  94. data/lib/files.com/models/history.rb +228 -0
  95. data/lib/files.com/models/history_export.rb +353 -0
  96. data/lib/files.com/models/image.rb +22 -0
  97. data/lib/files.com/models/invoice.rb +117 -0
  98. data/lib/files.com/models/invoice_line_item.rb +57 -0
  99. data/lib/files.com/models/ip_address.rb +66 -0
  100. data/lib/files.com/models/lock.rb +173 -0
  101. data/lib/files.com/models/message.rb +201 -0
  102. data/lib/files.com/models/message_comment.rb +165 -0
  103. data/lib/files.com/models/message_comment_reaction.rb +128 -0
  104. data/lib/files.com/models/message_reaction.rb +128 -0
  105. data/lib/files.com/models/notification.rb +263 -0
  106. data/lib/files.com/models/payment.rb +117 -0
  107. data/lib/files.com/models/payment_line_item.rb +37 -0
  108. data/lib/files.com/models/permission.rb +172 -0
  109. data/lib/files.com/models/preview.rb +37 -0
  110. data/lib/files.com/models/project.rb +140 -0
  111. data/lib/files.com/models/public_ip_address.rb +22 -0
  112. data/lib/files.com/models/public_key.rb +179 -0
  113. data/lib/files.com/models/remote_server.rb +680 -0
  114. data/lib/files.com/models/request.rb +179 -0
  115. data/lib/files.com/models/session.rb +247 -0
  116. data/lib/files.com/models/site.rb +733 -0
  117. data/lib/files.com/models/sso_strategy.rb +227 -0
  118. data/lib/files.com/models/status.rb +37 -0
  119. data/lib/files.com/models/style.rb +131 -0
  120. data/lib/files.com/models/usage_daily_snapshot.rb +66 -0
  121. data/lib/files.com/models/usage_snapshot.rb +96 -0
  122. data/lib/files.com/models/user.rb +876 -0
  123. data/lib/files.com/models/user_cipher_use.rb +63 -0
  124. data/lib/files.com/models/user_request.rb +127 -0
  125. data/lib/files.com/response.rb +25 -0
  126. data/lib/files.com/sizable_io.rb +32 -0
  127. data/lib/files.com/system_profiler.rb +56 -0
  128. data/lib/files.com/util.rb +106 -0
  129. data/lib/files.com/version.rb +5 -0
  130. data/spec/list_spec.rb +214 -0
  131. data/spec/models/file_spec.rb +68 -0
  132. data/spec/models/folder_spec.rb +40 -0
  133. data/spec/spec_helper.rb +36 -0
  134. data/test.sh +8 -0
  135. data/test/test.rb +75 -0
  136. metadata +235 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ebf4d4605addae148b16bbe121b65c0e49c1d15c6ea46a2b1f056a0bfd3cd8d2
4
+ data.tar.gz: a8880dab867bbbc0ebb640cc39cf3aa2e7898efa9ac81fd39bcf30a060d898bf
5
+ SHA512:
6
+ metadata.gz: f1bf9ea0d78910f4c41926f971113527b199392dfa2739ac1f389f87b5947023906b7a622e9e2961b503c3b95b833435806892d74bab5a023634badd850e6acb
7
+ data.tar.gz: e6b8a6b3b6e012c9b9d01f70d5835f39622dc3cf9656701f29c54c774af987a7f0605d540aa1c5f20115ecef1cfa65f7f47bbb8e59eb4e67c3d9a32219dee824
@@ -0,0 +1,4 @@
1
+ Kevin Bombino <kevin.bombino@files.com>
2
+ Martyn Garcia <martyn.garcia@files.com>
3
+ Dustin Zeisler <dustin.zeisler@files.com>
4
+ Rommel Santor <rommel.santor@files.com>
data/Gemfile ADDED
@@ -0,0 +1,12 @@
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', '~> 12.0.0'
10
+ gem 'rspec', '~> 3.9.0'
11
+ gem 'rubocop'
12
+ end
@@ -0,0 +1,82 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ files.com (1.0)
5
+ addressable (>= 2.7.0)
6
+ concurrent-ruby (>= 1.1.3)
7
+ faraday (>= 1.0.1)
8
+ net-http-persistent
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
15
+ ast (2.4.1)
16
+ byebug (11.1.3)
17
+ coderay (1.1.2)
18
+ concurrent-ruby (1.1.6)
19
+ connection_pool (2.2.3)
20
+ diff-lcs (1.3)
21
+ faraday (1.0.1)
22
+ multipart-post (>= 1.2, < 3)
23
+ memory_profiler (0.9.14)
24
+ method_source (1.0.0)
25
+ multipart-post (2.1.1)
26
+ net-http-persistent (4.0.0)
27
+ connection_pool (~> 2.2)
28
+ parallel (1.19.2)
29
+ parser (2.7.1.4)
30
+ ast (~> 2.4.1)
31
+ pry (0.13.1)
32
+ coderay (~> 1.1)
33
+ method_source (~> 1.0)
34
+ pry-byebug (3.9.0)
35
+ byebug (~> 11.0)
36
+ pry (~> 0.13.0)
37
+ public_suffix (4.0.5)
38
+ rainbow (3.0.0)
39
+ rake (12.0.0)
40
+ regexp_parser (1.7.1)
41
+ rexml (3.2.4)
42
+ rspec (3.9.0)
43
+ rspec-core (~> 3.9.0)
44
+ rspec-expectations (~> 3.9.0)
45
+ rspec-mocks (~> 3.9.0)
46
+ rspec-core (3.9.1)
47
+ rspec-support (~> 3.9.1)
48
+ rspec-expectations (3.9.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.9.0)
51
+ rspec-mocks (3.9.1)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.9.0)
54
+ rspec-support (3.9.3)
55
+ rubocop (0.85.1)
56
+ parallel (~> 1.10)
57
+ parser (>= 2.7.0.1)
58
+ rainbow (>= 2.2.2, < 4.0)
59
+ regexp_parser (>= 1.7)
60
+ rexml
61
+ rubocop-ast (>= 0.0.3)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 1.4.0, < 2.0)
64
+ rubocop-ast (0.0.3)
65
+ parser (>= 2.7.0.1)
66
+ ruby-progressbar (1.10.1)
67
+ unicode-display_width (1.7.0)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ files.com!
74
+ memory_profiler
75
+ pry
76
+ pry-byebug
77
+ rake (~> 12.0.0)
78
+ rspec (~> 3.9.0)
79
+ rubocop
80
+
81
+ BUNDLED WITH
82
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
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.
@@ -0,0 +1,119 @@
1
+ # Files.com Ruby Client
2
+
3
+ The Files.com Ruby client library provides convenient access to the Files.com API from applications written in the Ruby language.
4
+
5
+
6
+ ## Installation
7
+
8
+ To install the package:
9
+
10
+ gem install files.com
11
+
12
+ Or add this to your app's Gemfile:
13
+
14
+ gem 'files.com', '~> 1.0'
15
+
16
+
17
+ ### Requirements
18
+
19
+ * Ruby 2.3+
20
+
21
+
22
+ ## Usage
23
+
24
+ ### Authentication
25
+
26
+ There are multiple ways to authenticate to the API.
27
+
28
+ #### Global API Key
29
+
30
+ You can set an API key globally, like this:
31
+
32
+ Files.api_key = "my-key"
33
+
34
+
35
+ #### Per-Request API Key
36
+
37
+ Or, you can pass an API key per-request, in the Options hash at the end
38
+ of every method. Like this:
39
+
40
+ Files::Group.list({}, api_key: "my-key")
41
+
42
+ That key will automatically be used for any followup actions that occur
43
+ on models returned from the API.
44
+
45
+
46
+ #### User Session
47
+
48
+ Or, you can open a user session by calling `Files::Session.create`
49
+
50
+ session = Files::Session.create(username: "username", password: "password")
51
+
52
+ Then use it as follows:
53
+
54
+ Files::Group.list({}, session: session)
55
+
56
+ Or use if for all subsequent API calls globally like this:
57
+
58
+ Files.session = Files::Session.create(username: "username", password: "password")
59
+
60
+
61
+ ### Setting Global Options
62
+
63
+ You can set the following global options directly on the `Files` module:
64
+
65
+ * `Files.log_level` - set to `nil`, `info`, or `debug`
66
+ * `Files.open_timeout` - open timeout in seconds (default: 30)
67
+ * `Files.read_timeout` - read timeout in seconds (default: 80)
68
+ * `Files.initial_network_retry_delay` - initial retry delay in seconds (default: 0.5)
69
+ * `Files.max_network_retries` - max retries (default: 3)
70
+ * `Files.max_network_retry_delay` - max retry delay in seconds (default: 2)
71
+ * `Files.base_url` - to point this client at an on-premise
72
+ installation of Files.com, set its URL here.
73
+ * `Files.proxy` - proxy configuration (uses Faraday format)
74
+
75
+
76
+ ### File Operations
77
+
78
+ The Files::File and Files::Dir models implement the standard Ruby API
79
+ for File and Dir, respectively. (Note that the Files.com API uses the
80
+ word Folder, not Dir, and Files::Dir is simply an alias for
81
+ Files::Folder).
82
+
83
+
84
+ #### List root folder
85
+
86
+ Files::Folder.list_for("/").each do |file|
87
+ puts file.path
88
+ end
89
+
90
+
91
+ #### Writing a file example
92
+
93
+ Files::File.open("foo.txt", 'w') do |f|
94
+ f.write("contents")
95
+ end
96
+
97
+
98
+ #### Reading a file example
99
+
100
+ Files::File.find("foo.txt").read
101
+
102
+
103
+ ### Additional Object Documentation
104
+
105
+ Additional docs are available at https://developers.files.com/ and also
106
+ in the `docs/` subdirectory of this directory.
107
+
108
+
109
+ ### RDoc (YARD) Generated Documentation coming in the future
110
+
111
+ We hope to add RDoc/Yard documentation to a future release.
112
+
113
+
114
+ ## Getting Support
115
+
116
+ The Files.com team is happy to help with any SDK Integration challenges you
117
+ may face.
118
+
119
+ Just email support@files.com and we'll get the process started.
@@ -0,0 +1,12 @@
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
@@ -0,0 +1,24 @@
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!
@@ -0,0 +1 @@
1
+ 1.0.90
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,16 @@
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
@@ -0,0 +1,41 @@
1
+ # AccountLineItem
2
+
3
+ ## Example AccountLineItem Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "amount": "",
9
+ "balance": "",
10
+ "created_at": "2000-01-01T01:00:00Z",
11
+ "currency": "USD",
12
+ "download_uri": "https://url...",
13
+ "invoice_line_items": [
14
+
15
+ ],
16
+ "method": "paypal",
17
+ "payment_line_items": [
18
+
19
+ ],
20
+ "payment_reversed_at": "2000-01-01T01:00:00Z",
21
+ "payment_type": "",
22
+ "site_name": "My Site",
23
+ "type": "invoice",
24
+ "updated_at": "2000-01-01T01:00:00Z"
25
+ }
26
+ ```
27
+
28
+ * `id` (int64): Line item Id
29
+ * `amount` (double): Line item amount
30
+ * `balance` (double): Line item balance
31
+ * `created_at` (date-time): Line item created at
32
+ * `currency` (string): Line item currency
33
+ * `download_uri` (string): Line item download uri
34
+ * `invoice_line_items` (array): Associated invoice line items
35
+ * `method` (string): Line item payment method
36
+ * `payment_line_items` (array): Associated payment line items
37
+ * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable
38
+ * `payment_type` (string): Type of payment if applicable
39
+ * `site_name` (string): Site name this line item is for
40
+ * `type` (string): Type of line item, either payment or invoice
41
+ * `updated_at` (date-time): Line item updated at
@@ -0,0 +1,37 @@
1
+ # Action
2
+
3
+ ## Example Action Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "path": "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": [
15
+
16
+ ],
17
+ "user_id": 1,
18
+ "username": "user",
19
+ "action": "create",
20
+ "failure_type": "none",
21
+ "interface": "web"
22
+ }
23
+ ```
24
+
25
+ * `id` (int64): Action ID
26
+ * `path` (string): Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
27
+ * `when` (date-time): Action occurrence date/time
28
+ * `destination` (string): The destination path for this action, if applicable
29
+ * `display` (string): Friendly displayed output
30
+ * `ip` (string): IP Address that performed this action
31
+ * `source` (string): The source path for this action, if applicable
32
+ * `targets` (array): Targets
33
+ * `user_id` (int64): User ID
34
+ * `username` (string): Username
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.
@@ -0,0 +1,202 @@
1
+ # ApiKey
2
+
3
+ ## Example ApiKey Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "descriptive_label": "Site-wide API key for https://site.files.com/ (key ID #1)",
9
+ "created_at": "2000-01-01T01:00:00Z",
10
+ "expires_at": "2000-01-01T01:00:00Z",
11
+ "key": "[key]",
12
+ "last_use_at": "2000-01-01T01:00:00Z",
13
+ "name": "My Main API Key",
14
+ "path": "shared/docs",
15
+ "permission_set": "full",
16
+ "platform": "win32",
17
+ "user_id": 1
18
+ }
19
+ ```
20
+
21
+ * `id` (int64): API Key ID
22
+ * `descriptive_label` (string): Unique label that describes this API key. Useful for external systems where you may have API keys from multiple accounts and want a human-readable label for each key.
23
+ * `created_at` (date-time): Time which API Key was created
24
+ * `expires_at` (date-time): API Key expiration date
25
+ * `key` (string): API Key actual key string
26
+ * `last_use_at` (date-time): API Key last used - note this value is only updated once per 3 hour period, so the 'actual' time of last use may be up to 3 hours later than this timestamp.
27
+ * `name` (string): Internal name for the API Key. For your use.
28
+ * `path` (string): Folder path restriction for this api key. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
29
+ * `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
30
+ * `platform` (string): If this API key represents a Desktop app, what platform was it created on?
31
+ * `user_id` (int64): User ID for the owner of this API Key. May be blank for Site-wide API Keys.
32
+
33
+
34
+ ---
35
+
36
+ ## List Api Keys
37
+
38
+ ```
39
+ Files::ApiKey.list(
40
+ user_id: 1,
41
+ page: 1,
42
+ per_page: 1
43
+ )
44
+ ```
45
+
46
+ ### Parameters
47
+
48
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
49
+ * `page` (int64): Current page number.
50
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
51
+ * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
52
+ * `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
53
+ * `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `deleted_at` and `expires_at`.
54
+ * `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `expires_at`.
55
+ * `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `expires_at`.
56
+ * `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `expires_at`.
57
+ * `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `expires_at`.
58
+ * `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `expires_at`.
59
+ * `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `expires_at`.
60
+
61
+
62
+ ---
63
+
64
+ ## Show information about current API key. (Requires current API connection to be using an API key.)
65
+
66
+ ```
67
+ Files::ApiKey.find_current
68
+ ```
69
+
70
+
71
+ ---
72
+
73
+ ## Show Api Key
74
+
75
+ ```
76
+ Files::ApiKey.find(id)
77
+ ```
78
+
79
+ ### Parameters
80
+
81
+ * `id` (int64): Required - Api Key ID.
82
+
83
+
84
+ ---
85
+
86
+ ## Create Api Key
87
+
88
+ ```
89
+ Files::ApiKey.create(
90
+ user_id: 1,
91
+ name: "My Main API Key",
92
+ expires_at: "2000-01-01T01:00:00Z",
93
+ permission_set: "full",
94
+ path: "shared/docs"
95
+ )
96
+ ```
97
+
98
+ ### Parameters
99
+
100
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
101
+ * `name` (string): Internal name for the API Key. For your use.
102
+ * `expires_at` (string): API Key expiration date
103
+ * `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
104
+ * `path` (string): Folder path restriction for this api key.
105
+
106
+
107
+ ---
108
+
109
+ ## Update current API key. (Requires current API connection to be using an API key.)
110
+
111
+ ```
112
+ Files::ApiKey.update_current(
113
+ expires_at: "2000-01-01T01:00:00Z",
114
+ name: "My Main API Key",
115
+ permission_set: "full"
116
+ )
117
+ ```
118
+
119
+ ### Parameters
120
+
121
+ * `expires_at` (string): API Key expiration date
122
+ * `name` (string): Internal name for the API Key. For your use.
123
+ * `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
124
+
125
+
126
+ ---
127
+
128
+ ## Update Api Key
129
+
130
+ ```
131
+ Files::ApiKey.update(id,
132
+ name: "My Main API Key",
133
+ expires_at: "2000-01-01T01:00:00Z",
134
+ permission_set: "full"
135
+ )
136
+ ```
137
+
138
+ ### Parameters
139
+
140
+ * `id` (int64): Required - Api Key ID.
141
+ * `name` (string): Internal name for the API Key. For your use.
142
+ * `expires_at` (string): API Key expiration date
143
+ * `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
144
+
145
+
146
+ ---
147
+
148
+ ## Delete current API key. (Requires current API connection to be using an API key.)
149
+
150
+ ```
151
+ Files::ApiKey.delete_current
152
+ ```
153
+
154
+
155
+ ---
156
+
157
+ ## Delete Api Key
158
+
159
+ ```
160
+ Files::ApiKey.delete(id)
161
+ ```
162
+
163
+ ### Parameters
164
+
165
+ * `id` (int64): Required - Api Key ID.
166
+
167
+
168
+ ---
169
+
170
+ ## Update Api Key
171
+
172
+ ```
173
+ api_key = Files::ApiKey.list_for(path).first
174
+
175
+ api_key.update(
176
+ name: "My Main API Key",
177
+ expires_at: "2000-01-01T01:00:00Z",
178
+ permission_set: "full"
179
+ )
180
+ ```
181
+
182
+ ### Parameters
183
+
184
+ * `id` (int64): Required - Api Key ID.
185
+ * `name` (string): Internal name for the API Key. For your use.
186
+ * `expires_at` (string): API Key expiration date
187
+ * `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
188
+
189
+
190
+ ---
191
+
192
+ ## Delete Api Key
193
+
194
+ ```
195
+ api_key = Files::ApiKey.list_for(path).first
196
+
197
+ api_key.delete
198
+ ```
199
+
200
+ ### Parameters
201
+
202
+ * `id` (int64): Required - Api Key ID.