files.com 1.0.166 → 1.0.167

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da325e9d1150ae1ef34a33f394d1e397750b4d11ebf538ff3ed38a26d896267
4
- data.tar.gz: cefd6944825749652aad83230374f957b4fda3c19fa0b63fc1da7976557d6fc6
3
+ metadata.gz: 3bfca4f729a53761969566b2f3e3a2015529db8c8a0974eaadd956e11aa8a8c9
4
+ data.tar.gz: f054ddd8f70aca03083f81b0fcc532568e9bd7fec100403d36b3713b342e61dc
5
5
  SHA512:
6
- metadata.gz: 79a8bac49e15ba046e94bcf1d19f75f55a27ba410fa4acb4006faa7be5354224a4d6368629b923912e7ce78842e33a4b1d9fba096af6340bf15b1d77ded8523c
7
- data.tar.gz: 571e00841bbee105c2f6ebdb397409aeb8372faaaa85bb4074eac73985ae6ae5558014b3bcecd77ff52f7f6fae748d5930ef04f1f8f104bc118ecdf73dc2a5d3
6
+ metadata.gz: c120550e170dbec63173ac48e7026aa951ed5f085c0f14701607dc87ba8eab0e4315d089bea72a75a48a035774956961d0d0fcb3df3dcc79a317c57d74813212
7
+ data.tar.gz: 312b8a9e7746e2686163c23e98ce445f192e361a3202d6b0fa13e54981e56872cdac76e84bd6aa39e87a20e5e3f79248aa84754f29f1567b0700907c17c12e46
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.166
1
+ 1.0.167
@@ -0,0 +1,82 @@
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.
@@ -0,0 +1,49 @@
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
+ per_page: 1,
40
+ action_notification_export_id: 1
41
+ )
42
+ ```
43
+
44
+ ### Parameters
45
+
46
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
47
+ * `cursor` (string): Used for pagination. Send a cursor value 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.
48
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
49
+ * `action_notification_export_id` (int64): Required - ID of the associated action notification export.
@@ -56,7 +56,7 @@
56
56
  * `query_target_username` (string): If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username.
57
57
  * `query_target_platform` (string): If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform.
58
58
  * `query_target_permission_set` (string): If searching for Histories about API keys, this parameter restricts results to API keys with this permission set.
59
- * `results_url` (string): If `status` is `ready` and the query succeeded, this will be a URL where all the results can be downloaded at once as a CSV.
59
+ * `results_url` (string): If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV.
60
60
  * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
61
61
 
62
62
 
data/lib/files.com.rb CHANGED
@@ -29,6 +29,8 @@ require "files.com/uri"
29
29
 
30
30
  require "files.com/models/account_line_item"
31
31
  require "files.com/models/action"
32
+ require "files.com/models/action_notification_export"
33
+ require "files.com/models/action_notification_export_result"
32
34
  require "files.com/models/api_key"
33
35
  require "files.com/models/app"
34
36
  require "files.com/models/as2_key"
@@ -118,11 +118,11 @@ module Files
118
118
  class ContactAdminForPasswordChangeHelpError < NotAuthorizedError; end
119
119
  class FolderAdminOrBillingPermissionRequiredError < NotAuthorizedError; end
120
120
  class FolderAdminPermissionRequiredError < NotAuthorizedError; end
121
- class HistoryExportNonAdminsMustQueryByFolderOrPathError < NotAuthorizedError; end
122
121
  class HistoryPermissionRequiredError < NotAuthorizedError; end
123
122
  class InsufficientPermissionForParamsError < NotAuthorizedError; end
124
123
  class MustAuthenticateWithApiKeyError < NotAuthorizedError; end
125
124
  class NeedAdminPermissionForInboxError < NotAuthorizedError; end
125
+ class NonAdminsMustQueryByFolderOrPathError < NotAuthorizedError; end
126
126
  class NotAllowedToCreateBundleError < NotAuthorizedError; end
127
127
  class PasswordChangeNotRequiredError < NotAuthorizedError; end
128
128
  class PasswordChangeRequiredError < NotAuthorizedError; end
@@ -158,6 +158,8 @@ module Files
158
158
  class DestinationParentConflictError < ProcessingFailureError; end
159
159
  class DestinationParentDoesNotExistError < ProcessingFailureError; end
160
160
  class ExpiredPublicKeyError < ProcessingFailureError; end
161
+ class ExportFailureError < ProcessingFailureError; end
162
+ class ExportNotReadyError < ProcessingFailureError; end
161
163
  class FailedToChangePasswordError < ProcessingFailureError; end
162
164
  class FileLockedError < ProcessingFailureError; end
163
165
  class FileNotUploadedError < ProcessingFailureError; end
@@ -165,8 +167,6 @@ module Files
165
167
  class FileUploadedToWrongRegionError < ProcessingFailureError; end
166
168
  class FolderLockedError < ProcessingFailureError; end
167
169
  class FolderNotEmptyError < ProcessingFailureError; end
168
- class HistoryExportFailureError < ProcessingFailureError; end
169
- class HistoryExportNotReadyError < ProcessingFailureError; end
170
170
  class HistoryUnavailableError < ProcessingFailureError; end
171
171
  class InvalidBundleCodeError < ProcessingFailureError; end
172
172
  class InvalidFileTypeError < ProcessingFailureError; end
@@ -0,0 +1,189 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class ActionNotificationExport
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - History Export ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ def id=(value)
18
+ @attributes[:id] = value
19
+ end
20
+
21
+ # string - Version of the underlying records for the export.
22
+ def export_version
23
+ @attributes[:export_version]
24
+ end
25
+
26
+ def export_version=(value)
27
+ @attributes[:export_version] = value
28
+ end
29
+
30
+ # date-time - Start date/time of export range.
31
+ def start_at
32
+ @attributes[:start_at]
33
+ end
34
+
35
+ def start_at=(value)
36
+ @attributes[:start_at] = value
37
+ end
38
+
39
+ # date-time - End date/time of export range.
40
+ def end_at
41
+ @attributes[:end_at]
42
+ end
43
+
44
+ def end_at=(value)
45
+ @attributes[:end_at] = value
46
+ end
47
+
48
+ # string - Status of export. Valid values: `building`, `ready`, or `failed`
49
+ def status
50
+ @attributes[:status]
51
+ end
52
+
53
+ def status=(value)
54
+ @attributes[:status] = value
55
+ end
56
+
57
+ # string - Return notifications that were triggered by actions on this specific path.
58
+ def query_path
59
+ @attributes[:query_path]
60
+ end
61
+
62
+ def query_path=(value)
63
+ @attributes[:query_path] = value
64
+ end
65
+
66
+ # string - Return notifications that were triggered by actions in this folder.
67
+ def query_folder
68
+ @attributes[:query_folder]
69
+ end
70
+
71
+ def query_folder=(value)
72
+ @attributes[:query_folder] = value
73
+ end
74
+
75
+ # string - Error message associated with the request, if any.
76
+ def query_message
77
+ @attributes[:query_message]
78
+ end
79
+
80
+ def query_message=(value)
81
+ @attributes[:query_message] = value
82
+ end
83
+
84
+ # string - The HTTP request method used by the webhook.
85
+ def query_request_method
86
+ @attributes[:query_request_method]
87
+ end
88
+
89
+ def query_request_method=(value)
90
+ @attributes[:query_request_method] = value
91
+ end
92
+
93
+ # string - The target webhook URL.
94
+ def query_request_url
95
+ @attributes[:query_request_url]
96
+ end
97
+
98
+ def query_request_url=(value)
99
+ @attributes[:query_request_url] = value
100
+ end
101
+
102
+ # string - The HTTP status returned from the server in response to the webhook request.
103
+ def query_status
104
+ @attributes[:query_status]
105
+ end
106
+
107
+ def query_status=(value)
108
+ @attributes[:query_status] = value
109
+ end
110
+
111
+ # boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
112
+ def query_success
113
+ @attributes[:query_success]
114
+ end
115
+
116
+ def query_success=(value)
117
+ @attributes[:query_success] = value
118
+ end
119
+
120
+ # string - If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV.
121
+ def results_url
122
+ @attributes[:results_url]
123
+ end
124
+
125
+ def results_url=(value)
126
+ @attributes[:results_url] = value
127
+ end
128
+
129
+ # int64 - User ID. Provide a value of `0` to operate the current session's user.
130
+ def user_id
131
+ @attributes[:user_id]
132
+ end
133
+
134
+ def user_id=(value)
135
+ @attributes[:user_id] = value
136
+ end
137
+
138
+ def save
139
+ if @attributes[:id]
140
+ raise NotImplementedError.new("The ActionNotificationExport object doesn't support updates.")
141
+ else
142
+ new_obj = ActionNotificationExport.create(@attributes, @options)
143
+ @attributes = new_obj.attributes
144
+ end
145
+ end
146
+
147
+ # Parameters:
148
+ # id (required) - int64 - Action Notification Export ID.
149
+ def self.find(id, params = {}, options = {})
150
+ params ||= {}
151
+ params[:id] = id
152
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
153
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
154
+
155
+ response, options = Api.send_request("/action_notification_exports/#{params[:id]}", :get, params, options)
156
+ ActionNotificationExport.new(response.data, options)
157
+ end
158
+
159
+ def self.get(id, params = {}, options = {})
160
+ find(id, params, options)
161
+ end
162
+
163
+ # Parameters:
164
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
165
+ # start_at - string - Start date/time of export range.
166
+ # end_at - string - End date/time of export range.
167
+ # query_message - string - Error message associated with the request, if any.
168
+ # query_request_method - string - The HTTP request method used by the webhook.
169
+ # query_request_url - string - The target webhook URL.
170
+ # query_status - string - The HTTP status returned from the server in response to the webhook request.
171
+ # query_success - boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
172
+ # query_path - string - Return notifications that were triggered by actions on this specific path.
173
+ # query_folder - string - Return notifications that were triggered by actions in this folder.
174
+ def self.create(params = {}, options = {})
175
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
176
+ raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params.dig(:start_at) and !params.dig(:start_at).is_a?(String)
177
+ raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params.dig(:end_at) and !params.dig(:end_at).is_a?(String)
178
+ raise InvalidParameterError.new("Bad parameter: query_message must be an String") if params.dig(:query_message) and !params.dig(:query_message).is_a?(String)
179
+ raise InvalidParameterError.new("Bad parameter: query_request_method must be an String") if params.dig(:query_request_method) and !params.dig(:query_request_method).is_a?(String)
180
+ raise InvalidParameterError.new("Bad parameter: query_request_url must be an String") if params.dig(:query_request_url) and !params.dig(:query_request_url).is_a?(String)
181
+ raise InvalidParameterError.new("Bad parameter: query_status must be an String") if params.dig(:query_status) and !params.dig(:query_status).is_a?(String)
182
+ raise InvalidParameterError.new("Bad parameter: query_path must be an String") if params.dig(:query_path) and !params.dig(:query_path).is_a?(String)
183
+ raise InvalidParameterError.new("Bad parameter: query_folder must be an String") if params.dig(:query_folder) and !params.dig(:query_folder).is_a?(String)
184
+
185
+ response, options = Api.send_request("/action_notification_exports", :post, params, options)
186
+ ActionNotificationExport.new(response.data, options)
187
+ end
188
+ end
189
+ end
@@ -0,0 +1,83 @@
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. Send a cursor value 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.
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.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
69
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
70
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
71
+ raise InvalidParameterError.new("Bad parameter: action_notification_export_id must be an Integer") if params.dig(:action_notification_export_id) and !params.dig(:action_notification_export_id).is_a?(Integer)
72
+ raise MissingParameterError.new("Parameter missing: action_notification_export_id") unless params.dig(: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
@@ -225,7 +225,7 @@ module Files
225
225
  @attributes[:query_target_permission_set] = value
226
226
  end
227
227
 
228
- # string - If `status` is `ready` and the query succeeded, this will be a URL where all the results can be downloaded at once as a CSV.
228
+ # string - If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV.
229
229
  def results_url
230
230
  @attributes[:results_url]
231
231
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.166
4
+ version: 1.0.167
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-23 00:00:00.000000000 Z
11
+ date: 2021-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -88,6 +88,8 @@ files:
88
88
  - build.sh
89
89
  - docs/account_line_item.md
90
90
  - docs/action.md
91
+ - docs/action_notification_export.md
92
+ - docs/action_notification_export_result.md
91
93
  - docs/api_key.md
92
94
  - docs/app.md
93
95
  - docs/as2_key.md
@@ -160,6 +162,8 @@ files:
160
162
  - lib/files.com/list.rb
161
163
  - lib/files.com/models/account_line_item.rb
162
164
  - lib/files.com/models/action.rb
165
+ - lib/files.com/models/action_notification_export.rb
166
+ - lib/files.com/models/action_notification_export_result.rb
163
167
  - lib/files.com/models/api_key.rb
164
168
  - lib/files.com/models/app.rb
165
169
  - lib/files.com/models/as2_key.rb