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.
@@ -338,7 +338,7 @@ module Files
338
338
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
339
339
 
340
340
  List.new(File, params) do
341
- Api.send_request("/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
341
+ Api.send_request("/folders/#{params[:path]}", :get, params, options)
342
342
  end
343
343
  end
344
344
 
@@ -350,7 +350,7 @@ module Files
350
350
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
351
351
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
352
352
 
353
- response, options = Api.send_request("/folders/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
353
+ response, options = Api.send_request("/folders/#{params[:path]}", :post, params, options)
354
354
  File.new(response.data, options)
355
355
  end
356
356
  end
@@ -109,16 +109,31 @@ module Files
109
109
  # page - int64 - Current page number.
110
110
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
111
111
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
112
+ # 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.
113
+ # 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 `active`, `deleted_at`, `site_id` or `name`.
114
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`.
115
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name`.
116
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name`.
117
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`.
118
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `name`.
119
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `name`.
112
120
  # ids - string - Comma-separated list of group ids to include in results.
113
121
  def self.list(params = {}, options = {})
114
122
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
115
123
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
116
124
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
125
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
126
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
127
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
128
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
129
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
130
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
131
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
132
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
117
133
  raise InvalidParameterError.new("Bad parameter: ids must be an String") if params.dig(:ids) and !params.dig(:ids).is_a?(String)
118
134
 
119
- response, options = Api.send_request("/groups", :get, params, options)
120
- response.data.map do |entity_data|
121
- Group.new(entity_data, options)
135
+ List.new(Group, params) do
136
+ Api.send_request("/groups", :get, params, options)
122
137
  end
123
138
  end
124
139
 
@@ -81,6 +81,8 @@ module Files
81
81
  # page - int64 - Current page number.
82
82
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
83
83
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
84
+ # 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.
85
+ # 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 `user_id` and `created_at`.
84
86
  # path (required) - string - Path to operate on.
85
87
  def self.list_for_file(path, params = {}, options = {})
86
88
  params ||= {}
@@ -91,12 +93,13 @@ module Files
91
93
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
92
94
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
93
95
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
96
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
97
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
94
98
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
95
99
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
96
100
 
97
- response, options = Api.send_request("/history/files(/*path)", :get, params, options)
98
- response.data.map do |entity_data|
99
- Action.new(entity_data, options)
101
+ List.new(Action, params) do
102
+ Api.send_request("/history/files/#{params[:path]}", :get, params, options)
100
103
  end
101
104
  end
102
105
 
@@ -107,6 +110,8 @@ module Files
107
110
  # page - int64 - Current page number.
108
111
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
109
112
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
113
+ # 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.
114
+ # 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 `user_id` and `created_at`.
110
115
  # path (required) - string - Path to operate on.
111
116
  def self.list_for_folder(path, params = {}, options = {})
112
117
  params ||= {}
@@ -117,12 +122,13 @@ module Files
117
122
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
118
123
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
119
124
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
125
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
126
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
120
127
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
121
128
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
122
129
 
123
- response, options = Api.send_request("/history/folders(/*path)", :get, params, options)
124
- response.data.map do |entity_data|
125
- Action.new(entity_data, options)
130
+ List.new(Action, params) do
131
+ Api.send_request("/history/folders/#{params[:path]}", :get, params, options)
126
132
  end
127
133
  end
128
134
 
@@ -133,6 +139,8 @@ module Files
133
139
  # page - int64 - Current page number.
134
140
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
135
141
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
142
+ # 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.
143
+ # 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 `user_id` and `created_at`.
136
144
  # user_id (required) - int64 - User ID.
137
145
  def self.list_for_user(user_id, params = {}, options = {})
138
146
  params ||= {}
@@ -143,12 +151,13 @@ module Files
143
151
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
144
152
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
145
153
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
154
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
155
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
146
156
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
147
157
  raise MissingParameterError.new("Parameter missing: user_id") unless params.dig(:user_id)
148
158
 
149
- response, options = Api.send_request("/history/users/#{params[:user_id]}", :get, params, options)
150
- response.data.map do |entity_data|
151
- Action.new(entity_data, options)
159
+ List.new(Action, params) do
160
+ Api.send_request("/history/users/#{params[:user_id]}", :get, params, options)
152
161
  end
153
162
  end
154
163
 
@@ -159,6 +168,8 @@ module Files
159
168
  # page - int64 - Current page number.
160
169
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
161
170
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
171
+ # 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.
172
+ # 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 `user_id` and `created_at`.
162
173
  def self.list_logins(params = {}, options = {})
163
174
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params.dig(:start_at) and !params.dig(:start_at).is_a?(String)
164
175
  raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params.dig(:end_at) and !params.dig(:end_at).is_a?(String)
@@ -166,10 +177,11 @@ module Files
166
177
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
167
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)
168
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)
169
182
 
170
- response, options = Api.send_request("/history/login", :get, params, options)
171
- response.data.map do |entity_data|
172
- Action.new(entity_data, options)
183
+ List.new(Action, params) do
184
+ Api.send_request("/history/login", :get, params, options)
173
185
  end
174
186
  end
175
187
 
@@ -180,6 +192,14 @@ module Files
180
192
  # page - int64 - Current page number.
181
193
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
182
194
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
195
+ # 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.
196
+ # 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`, `path`, `created_at`, `folder` or `user_id`.
197
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `user_id`, `folder` or `path`.
198
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `user_id`, `folder` or `path`.
199
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `user_id`, `folder` or `path`.
200
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `user_id`, `folder` or `path`.
201
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `user_id`, `folder` or `path`.
202
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `user_id`, `folder` or `path`.
183
203
  def self.list(params = {}, options = {})
184
204
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params.dig(:start_at) and !params.dig(:start_at).is_a?(String)
185
205
  raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params.dig(:end_at) and !params.dig(:end_at).is_a?(String)
@@ -187,10 +207,17 @@ module Files
187
207
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
188
208
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
189
209
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
190
-
191
- response, options = Api.send_request("/history", :get, params, options)
192
- response.data.map do |entity_data|
193
- Action.new(entity_data, options)
210
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
211
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
212
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
213
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
214
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
215
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
216
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
217
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
218
+
219
+ List.new(Action, params) do
220
+ Api.send_request("/history", :get, params, options)
194
221
  end
195
222
  end
196
223
 
@@ -47,5 +47,20 @@ module Files
47
47
  def self.all(params = {}, options = {})
48
48
  list(params, options)
49
49
  end
50
+
51
+ # Parameters:
52
+ # page - int64 - Current page number.
53
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
54
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
55
+ def self.get_reserved(params = {}, options = {})
56
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
57
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
58
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
59
+
60
+ response, options = Api.send_request("/ip_addresses/reserved", :get, params, options)
61
+ response.data.map do |entity_data|
62
+ PublicIpAddress.new(entity_data, options)
63
+ end
64
+ end
50
65
  end
51
66
  end
@@ -101,7 +101,7 @@ module Files
101
101
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
102
102
  raise MissingParameterError.new("Parameter missing: token") unless params.dig(:token)
103
103
 
104
- Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
104
+ Api.send_request("/locks/#{@attributes[:path]}", :delete, params, @options)
105
105
  end
106
106
 
107
107
  def destroy(params = {})
@@ -132,7 +132,7 @@ module Files
132
132
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
133
133
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
134
134
 
135
- response, options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
135
+ response, options = Api.send_request("/locks/#{params[:path]}", :get, params, options)
136
136
  response.data.map do |entity_data|
137
137
  Lock.new(entity_data, options)
138
138
  end
@@ -148,7 +148,7 @@ module Files
148
148
  raise InvalidParameterError.new("Bad parameter: timeout must be an Integer") if params.dig(:timeout) and !params.dig(:timeout).is_a?(Integer)
149
149
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
150
150
 
151
- response, options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
151
+ response, options = Api.send_request("/locks/#{params[:path]}", :post, params, options)
152
152
  Lock.new(response.data, options)
153
153
  end
154
154
 
@@ -162,7 +162,7 @@ module Files
162
162
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
163
163
  raise MissingParameterError.new("Parameter missing: token") unless params.dig(:token)
164
164
 
165
- response, _options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
165
+ response, _options = Api.send_request("/locks/#{params[:path]}", :delete, params, options)
166
166
  response.data
167
167
  end
168
168
 
@@ -156,11 +156,19 @@ module Files
156
156
  end
157
157
 
158
158
  # Parameters:
159
- # user_id - int64 - Show notifications for this User ID.
159
+ # user_id - int64 - DEPRECATED: Show notifications for this User ID. Use `filter[user_id]` instead.
160
160
  # page - int64 - Current page number.
161
161
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
162
162
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
163
- # group_id - int64 - Show notifications for this Group ID.
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`, `path`, `user_id` or `group_id`.
165
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `user_id`, `group_id` or `path`.
166
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `user_id`, `group_id` or `path`.
167
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `user_id`, `group_id` or `path`.
168
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `user_id`, `group_id` or `path`.
169
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `user_id`, `group_id` or `path`.
170
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `user_id`, `group_id` or `path`.
171
+ # group_id - int64 - DEPRECATED: Show notifications for this Group ID. Use `filter[group_id]` instead.
164
172
  # path - string - Show notifications for this Path.
165
173
  # include_ancestors - boolean - If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
166
174
  def self.list(params = {}, options = {})
@@ -168,12 +176,19 @@ module Files
168
176
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
169
177
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
170
178
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
179
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
180
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
181
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
182
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
183
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
184
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
185
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
186
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
171
187
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
172
188
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
173
189
 
174
- response, options = Api.send_request("/notifications", :get, params, options)
175
- response.data.map do |entity_data|
176
- Notification.new(entity_data, options)
190
+ List.new(Notification, params) do
191
+ Api.send_request("/notifications", :get, params, options)
177
192
  end
178
193
  end
179
194
 
@@ -94,9 +94,17 @@ module Files
94
94
  # page - int64 - Current page number.
95
95
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
96
96
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
97
- # path - string - Permission path. If provided, will scope permissions to this path.
98
- # group_id - string - Group ID. If provided, will scope permissions to this group.
99
- # user_id - string - User ID. If provided, will scope permissions to this user.
97
+ # 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.
98
+ # 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`, `group_id`, `path`, `user_id` or `permission`.
99
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
100
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `group_id`, `user_id` or `path`.
101
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
102
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
103
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `group_id`, `user_id` or `path`.
104
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
105
+ # path - string - DEPRECATED: Permission path. If provided, will scope permissions to this path. Use `filter[path]` instead.
106
+ # group_id - string - DEPRECATED: Group ID. If provided, will scope permissions to this group. Use `filter[group_id]` instead.`
107
+ # user_id - string - DEPRECATED: User ID. If provided, will scope permissions to this user. Use `filter[user_id]` instead.`
100
108
  # include_groups - boolean - If searching by user or group, also include user's permissions that are inherited from its groups?
101
109
  def self.list(path, params = {}, options = {})
102
110
  params ||= {}
@@ -104,13 +112,20 @@ module Files
104
112
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
105
113
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
106
114
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
115
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
116
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
117
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
118
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
119
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
120
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
121
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
122
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
107
123
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
108
124
  raise InvalidParameterError.new("Bad parameter: group_id must be an String") if params.dig(:group_id) and !params.dig(:group_id).is_a?(String)
109
125
  raise InvalidParameterError.new("Bad parameter: user_id must be an String") if params.dig(:user_id) and !params.dig(:user_id).is_a?(String)
110
126
 
111
- response, options = Api.send_request("/permissions", :get, params, options)
112
- response.data.map do |entity_data|
113
- Permission.new(entity_data, options)
127
+ List.new(Permission, params) do
128
+ Api.send_request("/permissions", :get, params, options)
114
129
  end
115
130
  end
116
131
 
@@ -0,0 +1,22 @@
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
+ end
22
+ end
@@ -81,25 +81,6 @@ module Files
81
81
  @attributes[:group_ids] = value
82
82
  end
83
83
 
84
- # List Requests
85
- #
86
- # Parameters:
87
- # page - int64 - Current page number.
88
- # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
89
- # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
90
- # mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
91
- def folders(params = {})
92
- params ||= {}
93
- params[:path] = @attributes[:path]
94
- raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
95
- raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
96
- raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
97
- raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
98
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
99
-
100
- Api.send_request("/requests/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, @options)
101
- end
102
-
103
84
  def save
104
85
  if @attributes[:path]
105
86
  raise NotImplementedError.new("The Request object doesn't support updates.")
@@ -113,6 +94,8 @@ module Files
113
94
  # page - int64 - Current page number.
114
95
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
115
96
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
97
+ # 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.
98
+ # 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`, `folder_id` or `destination`.
116
99
  # mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
117
100
  # path - string - Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
118
101
  def self.list(path, params = {}, options = {})
@@ -121,11 +104,12 @@ module Files
121
104
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
122
105
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
123
106
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
107
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
108
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
124
109
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
125
110
 
126
- response, options = Api.send_request("/requests", :get, params, options)
127
- response.data.map do |entity_data|
128
- Request.new(entity_data, options)
111
+ List.new(Request, params) do
112
+ Api.send_request("/requests", :get, params, options)
129
113
  end
130
114
  end
131
115
 
@@ -133,24 +117,27 @@ module Files
133
117
  list(path, params, options)
134
118
  end
135
119
 
136
- # List Requests
137
- #
138
120
  # Parameters:
139
121
  # page - int64 - Current page number.
140
122
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
141
123
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
124
+ # 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.
125
+ # 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`, `folder_id` or `destination`.
142
126
  # mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
143
- def self.folders(path, params = {}, options = {})
127
+ # path (required) - string - Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
128
+ def self.find_folder(path, params = {}, options = {})
144
129
  params ||= {}
145
130
  params[:path] = path
146
131
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
147
132
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
148
133
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
134
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
135
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
149
136
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
137
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
150
138
 
151
- response, options = Api.send_request("/requests/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
152
- response.data.map do |entity_data|
153
- Request.new(entity_data, options)
139
+ List.new(Request, params) do
140
+ Api.send_request("/requests/folders/#{params[:path]}", :get, params, options)
154
141
  end
155
142
  end
156
143
 
@@ -64,7 +64,7 @@ module Files
64
64
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
65
65
  raise MissingParameterError.new("Parameter missing: file") unless params.dig(:file)
66
66
 
67
- Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :patch, params, @options)
67
+ Api.send_request("/styles/#{@attributes[:path]}", :patch, params, @options)
68
68
  end
69
69
 
70
70
  def delete(params = {})
@@ -74,7 +74,7 @@ module Files
74
74
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
75
75
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
76
76
 
77
- Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
77
+ Api.send_request("/styles/#{@attributes[:path]}", :delete, params, @options)
78
78
  end
79
79
 
80
80
  def destroy(params = {})
@@ -87,18 +87,18 @@ module Files
87
87
 
88
88
  # Parameters:
89
89
  # path (required) - string - Style path.
90
- def self.list(path, params = {}, options = {})
90
+ def self.find(path, params = {}, options = {})
91
91
  params ||= {}
92
92
  params[:path] = path
93
93
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
94
94
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
95
95
 
96
- response, options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
96
+ response, options = Api.send_request("/styles/#{params[:path]}", :get, params, options)
97
97
  Style.new(response.data, options)
98
98
  end
99
99
 
100
- def self.all(path, params = {}, options = {})
101
- list(path, params, options)
100
+ def self.get(path, params = {}, options = {})
101
+ find(path, params, options)
102
102
  end
103
103
 
104
104
  # Parameters:
@@ -110,7 +110,7 @@ module Files
110
110
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
111
111
  raise MissingParameterError.new("Parameter missing: file") unless params.dig(:file)
112
112
 
113
- response, options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :patch, params, options)
113
+ response, options = Api.send_request("/styles/#{params[:path]}", :patch, params, options)
114
114
  Style.new(response.data, options)
115
115
  end
116
116
 
@@ -120,7 +120,7 @@ module Files
120
120
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
121
121
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
122
122
 
123
- response, _options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
123
+ response, _options = Api.send_request("/styles/#{params[:path]}", :delete, params, options)
124
124
  response.data
125
125
  end
126
126