files.com 1.0.87 → 1.0.88

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,6 +64,7 @@ require "files.com/models/payment_line_item"
64
64
  require "files.com/models/permission"
65
65
  require "files.com/models/preview"
66
66
  require "files.com/models/project"
67
+ require "files.com/models/public_ip_address"
67
68
  require "files.com/models/public_key"
68
69
  require "files.com/models/remote_server"
69
70
  require "files.com/models/request"
@@ -68,6 +68,15 @@ module Files
68
68
  @attributes[:name] = value
69
69
  end
70
70
 
71
+ # 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.
72
+ def path
73
+ @attributes[:path]
74
+ end
75
+
76
+ def path=(value)
77
+ @attributes[:path] = value
78
+ end
79
+
71
80
  # 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.
72
81
  def permission_set
73
82
  @attributes[:permission_set]
@@ -140,15 +149,30 @@ module Files
140
149
  # page - int64 - Current page number.
141
150
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
142
151
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
152
+ # 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.
153
+ # 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`.
154
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `expires_at`.
155
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `expires_at`.
156
+ # 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`.
157
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `expires_at`.
158
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `expires_at`.
159
+ # 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`.
143
160
  def self.list(params = {}, options = {})
144
161
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
145
162
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
146
163
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
147
164
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
148
-
149
- response, options = Api.send_request("/api_keys", :get, params, options)
150
- response.data.map do |entity_data|
151
- ApiKey.new(entity_data, options)
165
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
166
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
167
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
168
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
169
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
170
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
171
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
172
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
173
+
174
+ List.new(ApiKey, params) do
175
+ Api.send_request("/api_keys", :get, params, options)
152
176
  end
153
177
  end
154
178
 
@@ -182,11 +206,13 @@ module Files
182
206
  # name - string - Internal name for the API Key. For your use.
183
207
  # expires_at - string - API Key expiration date
184
208
  # 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.
209
+ # path - string - Folder path restriction for this api key.
185
210
  def self.create(params = {}, options = {})
186
211
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
187
212
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
188
213
  raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
189
214
  raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
215
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
190
216
 
191
217
  response, options = Api.send_request("/api_keys", :post, params, options)
192
218
  ApiKey.new(response.data, options)
@@ -24,6 +24,16 @@ module Files
24
24
  @attributes[:documentation_links]
25
25
  end
26
26
 
27
+ # string - Full size logo for the App
28
+ def logo_url
29
+ @attributes[:logo_url]
30
+ end
31
+
32
+ # string - Logo thumbnail for the App
33
+ def logo_thumbnail_url
34
+ @attributes[:logo_thumbnail_url]
35
+ end
36
+
27
37
  # string - Associated SSO Strategy type, if any
28
38
  def sso_strategy_type
29
39
  @attributes[:sso_strategy_type]
@@ -58,14 +68,29 @@ module Files
58
68
  # page - int64 - Current page number.
59
69
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
70
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
71
+ # 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.
72
+ # 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 `name` and `app_type`.
73
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name` and `app_type`.
74
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name` and `app_type`.
75
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name` and `app_type`.
76
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name` and `app_type`.
77
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `name` and `app_type`.
78
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `name` and `app_type`.
61
79
  def self.list(params = {}, options = {})
62
80
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
63
81
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
64
82
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
83
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
84
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
85
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
86
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
87
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
88
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
89
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
90
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
65
91
 
66
- response, options = Api.send_request("/apps", :get, params, options)
67
- response.data.map do |entity_data|
68
- App.new(entity_data, options)
92
+ List.new(App, params) do
93
+ Api.send_request("/apps", :get, params, options)
69
94
  end
70
95
  end
71
96
 
@@ -183,16 +183,31 @@ module Files
183
183
  # page - int64 - Current page number.
184
184
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
185
185
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
186
- # automation - string - Type of automation to filter by.
186
+ # 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.
187
+ # 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 `site_id` and `automation`.
188
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `automation`.
189
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `automation`.
190
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `automation`.
191
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `automation`.
192
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `automation`.
193
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `automation`.
194
+ # automation - string - DEPRECATED: Type of automation to filter by. Use `filter[automation]` instead.
187
195
  def self.list(params = {}, options = {})
188
196
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
189
197
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
190
198
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
199
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
200
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
201
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
202
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
203
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
204
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
205
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
206
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
191
207
  raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
192
208
 
193
- response, options = Api.send_request("/automations", :get, params, options)
194
- response.data.map do |entity_data|
195
- Automation.new(entity_data, options)
209
+ List.new(Automation, params) do
210
+ Api.send_request("/automations", :get, params, options)
196
211
  end
197
212
  end
198
213
 
@@ -108,16 +108,31 @@ module Files
108
108
  # page - int64 - Current page number.
109
109
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
110
110
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
111
+ # 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.
112
+ # 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 `site_id` and `behavior`.
113
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `behavior`.
114
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `behavior`.
115
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `behavior`.
116
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `behavior`.
117
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `behavior`.
118
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `behavior`.
111
119
  # behavior - string - If set, only shows folder behaviors matching this behavior type.
112
120
  def self.list(params = {}, options = {})
113
121
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
114
122
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
115
123
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
124
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
125
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
126
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
127
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
128
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
129
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
130
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
131
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
116
132
  raise InvalidParameterError.new("Bad parameter: behavior must be an String") if params.dig(:behavior) and !params.dig(:behavior).is_a?(String)
117
133
 
118
- response, options = Api.send_request("/behaviors", :get, params, options)
119
- response.data.map do |entity_data|
120
- Behavior.new(entity_data, options)
134
+ List.new(Behavior, params) do
135
+ Api.send_request("/behaviors", :get, params, options)
121
136
  end
122
137
  end
123
138
 
@@ -125,46 +140,61 @@ module Files
125
140
  list(params, options)
126
141
  end
127
142
 
143
+ # Parameters:
144
+ # id (required) - int64 - Behavior ID.
145
+ def self.find(id, params = {}, options = {})
146
+ params ||= {}
147
+ params[:id] = id
148
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
149
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
150
+
151
+ response, options = Api.send_request("/behaviors/#{params[:id]}", :get, params, options)
152
+ Behavior.new(response.data, options)
153
+ end
154
+
155
+ def self.get(id, params = {}, options = {})
156
+ find(id, params, options)
157
+ end
158
+
128
159
  # Parameters:
129
160
  # page - int64 - Current page number.
130
161
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
131
162
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
163
+ # 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.
164
+ # 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 `site_id` and `behavior`.
165
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `behavior`.
166
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `behavior`.
167
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `behavior`.
168
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `behavior`.
169
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `behavior`.
170
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `behavior`.
132
171
  # path (required) - string - Path to operate on.
133
172
  # recursive - string - Show behaviors above this path?
134
- # behavior - string - If set only shows folder behaviors matching this behavior type.
173
+ # behavior - string - DEPRECATED: If set only shows folder behaviors matching this behavior type. Use `filter[behavior]` instead.
135
174
  def self.list_for(path, params = {}, options = {})
136
175
  params ||= {}
137
176
  params[:path] = path
138
177
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
139
178
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
140
179
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
180
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
181
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
182
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
183
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
184
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
185
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
186
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
187
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
141
188
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
142
189
  raise InvalidParameterError.new("Bad parameter: recursive must be an String") if params.dig(:recursive) and !params.dig(:recursive).is_a?(String)
143
190
  raise InvalidParameterError.new("Bad parameter: behavior must be an String") if params.dig(:behavior) and !params.dig(:behavior).is_a?(String)
144
191
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
145
192
 
146
- response, options = Api.send_request("/behaviors/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
147
- response.data.map do |entity_data|
148
- Behavior.new(entity_data, options)
193
+ List.new(Behavior, params) do
194
+ Api.send_request("/behaviors/folders/#{params[:path]}", :get, params, options)
149
195
  end
150
196
  end
151
197
 
152
- # Parameters:
153
- # id (required) - int64 - Behavior ID.
154
- def self.find(id, params = {}, options = {})
155
- params ||= {}
156
- params[:id] = id
157
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
158
- raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
159
-
160
- response, options = Api.send_request("/behaviors/#{params[:id]}", :get, params, options)
161
- Behavior.new(response.data, options)
162
- end
163
-
164
- def self.get(id, params = {}, options = {})
165
- find(id, params, options)
166
- end
167
-
168
198
  # Parameters:
169
199
  # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
170
200
  # attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
@@ -232,15 +232,30 @@ module Files
232
232
  # page - int64 - Current page number.
233
233
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
234
234
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
235
+ # 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.
236
+ # 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 `site_id`, `created_at` or `code`.
237
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `created_at`.
238
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `created_at`.
239
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `created_at`.
240
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `created_at`.
241
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `created_at`.
242
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `created_at`.
235
243
  def self.list(params = {}, options = {})
236
244
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
237
245
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
238
246
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
239
247
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
240
-
241
- response, options = Api.send_request("/bundles", :get, params, options)
242
- response.data.map do |entity_data|
243
- Bundle.new(entity_data, options)
248
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
249
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
250
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
251
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
252
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
253
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
254
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
255
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
256
+
257
+ List.new(Bundle, params) do
258
+ Api.send_request("/bundles", :get, params, options)
244
259
  end
245
260
  end
246
261
 
@@ -826,7 +826,6 @@ module Files
826
826
  #
827
827
  # Parameters:
828
828
  # action - string - Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
829
- # id - int64 - If provided, lookup the file by id instead of path.
830
829
  # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
831
830
  # with_previews - boolean - Include file preview information?
832
831
  # with_priority_color - boolean - Include file priority color information?
@@ -836,11 +835,10 @@ module Files
836
835
  raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
837
836
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
838
837
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
839
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
840
838
  raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
841
839
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
842
840
 
843
- Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, @options)
841
+ Api.send_request("/files/#{@attributes[:path]}", :get, params, @options)
844
842
  end
845
843
 
846
844
  # Parameters:
@@ -855,7 +853,7 @@ module Files
855
853
  raise InvalidParameterError.new("Bad parameter: priority_color must be an String") if params.dig(:priority_color) and !params.dig(:priority_color).is_a?(String)
856
854
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
857
855
 
858
- Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :patch, params, @options)
856
+ Api.send_request("/files/#{@attributes[:path]}", :patch, params, @options)
859
857
  end
860
858
 
861
859
  # Parameters:
@@ -867,7 +865,7 @@ module Files
867
865
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
868
866
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
869
867
 
870
- Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
868
+ Api.send_request("/files/#{@attributes[:path]}", :delete, params, @options)
871
869
  end
872
870
 
873
871
  def destroy(params = {})
@@ -887,7 +885,6 @@ module Files
887
885
  #
888
886
  # Parameters:
889
887
  # action - string - Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
890
- # id - int64 - If provided, lookup the file by id instead of path.
891
888
  # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
892
889
  # with_previews - boolean - Include file preview information?
893
890
  # with_priority_color - boolean - Include file priority color information?
@@ -896,11 +893,10 @@ module Files
896
893
  params[:path] = path
897
894
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
898
895
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
899
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
900
896
  raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
901
897
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
902
898
 
903
- response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
899
+ response, options = Api.send_request("/files/#{params[:path]}", :get, params, options)
904
900
  File.new(response.data, options)
905
901
  end
906
902
 
@@ -934,7 +930,7 @@ module Files
934
930
  raise InvalidParameterError.new("Bad parameter: structure must be an String") if params.dig(:structure) and !params.dig(:structure).is_a?(String)
935
931
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
936
932
 
937
- response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
933
+ response, options = Api.send_request("/files/#{params[:path]}", :post, params, options)
938
934
  File.new(response.data, options)
939
935
  end
940
936
 
@@ -949,7 +945,7 @@ module Files
949
945
  raise InvalidParameterError.new("Bad parameter: priority_color must be an String") if params.dig(:priority_color) and !params.dig(:priority_color).is_a?(String)
950
946
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
951
947
 
952
- response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :patch, params, options)
948
+ response, options = Api.send_request("/files/#{params[:path]}", :patch, params, options)
953
949
  File.new(response.data, options)
954
950
  end
955
951
 
@@ -961,7 +957,7 @@ module Files
961
957
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
962
958
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
963
959
 
964
- response, _options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
960
+ response, _options = Api.send_request("/files/#{params[:path]}", :delete, params, options)
965
961
  response.data
966
962
  end
967
963
 
@@ -23,7 +23,7 @@ module Files
23
23
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
24
24
  raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
25
25
 
26
- Api.send_request("/file_actions/copy/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
26
+ Api.send_request("/file_actions/copy/#{@attributes[:path]}", :post, params, @options)
27
27
  end
28
28
 
29
29
  # Move file/folder
@@ -39,7 +39,7 @@ module Files
39
39
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
40
40
  raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
41
41
 
42
- Api.send_request("/file_actions/move/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
42
+ Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
43
43
  end
44
44
 
45
45
  # Begin file upload
@@ -62,7 +62,7 @@ module Files
62
62
  raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
63
63
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
64
64
 
65
- Api.send_request("/file_actions/begin_upload/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
65
+ Api.send_request("/file_actions/begin_upload/#{@attributes[:path]}", :post, params, @options)
66
66
  end
67
67
 
68
68
  # Copy file/folder
@@ -78,7 +78,7 @@ module Files
78
78
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
79
79
  raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
80
80
 
81
- response, _options = Api.send_request("/file_actions/copy/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
81
+ response, _options = Api.send_request("/file_actions/copy/#{params[:path]}", :post, params, options)
82
82
  response.data
83
83
  end
84
84
 
@@ -94,7 +94,7 @@ module Files
94
94
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
95
95
  raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
96
96
 
97
- response, _options = Api.send_request("/file_actions/move/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
97
+ response, _options = Api.send_request("/file_actions/move/#{params[:path]}", :post, params, options)
98
98
  response.data
99
99
  end
100
100
 
@@ -117,7 +117,7 @@ module Files
117
117
  raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
118
118
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
119
119
 
120
- response, options = Api.send_request("/file_actions/begin_upload/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
120
+ response, options = Api.send_request("/file_actions/begin_upload/#{params[:path]}", :post, params, options)
121
121
  response.data.map do |entity_data|
122
122
  FilePartUpload.new(entity_data, options)
123
123
  end
@@ -96,7 +96,7 @@ module Files
96
96
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
97
97
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
98
98
 
99
- response, options = Api.send_request("/file_comments/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
99
+ response, options = Api.send_request("/file_comments/files/#{params[:path]}", :get, params, options)
100
100
  response.data.map do |entity_data|
101
101
  FileComment.new(entity_data, options)
102
102
  end