files.com 1.1.768 → 1.1.770

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +47 -7
  4. data/_VERSION +1 -1
  5. data/docs/file.md +37 -0
  6. data/lib/files.com/api.rb +9 -4
  7. data/lib/files.com/api_client.rb +181 -55
  8. data/lib/files.com/list.rb +98 -66
  9. data/lib/files.com/models/action_log.rb +7 -2
  10. data/lib/files.com/models/action_notification_export.rb +13 -3
  11. data/lib/files.com/models/action_notification_export_result.rb +7 -2
  12. data/lib/files.com/models/ai_assistant_personality.rb +34 -8
  13. data/lib/files.com/models/ai_task.rb +39 -8
  14. data/lib/files.com/models/api_key.rb +49 -10
  15. data/lib/files.com/models/api_request_log.rb +7 -2
  16. data/lib/files.com/models/app.rb +7 -2
  17. data/lib/files.com/models/as2_incoming_message.rb +7 -2
  18. data/lib/files.com/models/as2_outgoing_message.rb +7 -2
  19. data/lib/files.com/models/as2_partner.rb +34 -8
  20. data/lib/files.com/models/as2_station.rb +34 -8
  21. data/lib/files.com/models/automation.rb +50 -10
  22. data/lib/files.com/models/automation_log.rb +7 -2
  23. data/lib/files.com/models/automation_run.rb +31 -6
  24. data/lib/files.com/models/bandwidth_snapshot.rb +7 -2
  25. data/lib/files.com/models/behavior.rb +46 -10
  26. data/lib/files.com/models/bundle.rb +39 -8
  27. data/lib/files.com/models/bundle_action.rb +7 -2
  28. data/lib/files.com/models/bundle_download.rb +7 -2
  29. data/lib/files.com/models/bundle_notification.rb +34 -8
  30. data/lib/files.com/models/bundle_recipient.rb +14 -4
  31. data/lib/files.com/models/bundle_registration.rb +7 -2
  32. data/lib/files.com/models/chat_session.rb +13 -3
  33. data/lib/files.com/models/child_site_management_policy.rb +34 -8
  34. data/lib/files.com/models/clickwrap.rb +34 -8
  35. data/lib/files.com/models/custom_domain.rb +40 -9
  36. data/lib/files.com/models/desktop_configuration_profile.rb +34 -8
  37. data/lib/files.com/models/dns_record.rb +7 -2
  38. data/lib/files.com/models/email_incoming_message.rb +7 -2
  39. data/lib/files.com/models/email_log.rb +7 -2
  40. data/lib/files.com/models/event_channel.rb +34 -8
  41. data/lib/files.com/models/event_delivery_attempt.rb +13 -3
  42. data/lib/files.com/models/event_record.rb +13 -3
  43. data/lib/files.com/models/event_subscription.rb +34 -8
  44. data/lib/files.com/models/event_target.rb +34 -8
  45. data/lib/files.com/models/exavault_api_request_log.rb +7 -2
  46. data/lib/files.com/models/expectation.rb +40 -9
  47. data/lib/files.com/models/expectation_evaluation.rb +13 -3
  48. data/lib/files.com/models/expectation_incident.rb +31 -6
  49. data/lib/files.com/models/external_event.rb +20 -5
  50. data/lib/files.com/models/file.rb +93 -15
  51. data/lib/files.com/models/file_comment.rb +28 -7
  52. data/lib/files.com/models/file_comment_reaction.rb +11 -2
  53. data/lib/files.com/models/file_migration.rb +6 -1
  54. data/lib/files.com/models/file_migration_log.rb +7 -2
  55. data/lib/files.com/models/folder.rb +13 -3
  56. data/lib/files.com/models/form_field_set.rb +34 -8
  57. data/lib/files.com/models/ftp_action_log.rb +7 -2
  58. data/lib/files.com/models/gpg_key.rb +34 -8
  59. data/lib/files.com/models/group.rb +34 -8
  60. data/lib/files.com/models/group_user.rb +29 -7
  61. data/lib/files.com/models/history.rb +35 -10
  62. data/lib/files.com/models/history_export.rb +13 -3
  63. data/lib/files.com/models/history_export_result.rb +7 -2
  64. data/lib/files.com/models/holiday_calendar.rb +34 -8
  65. data/lib/files.com/models/holiday_region.rb +7 -2
  66. data/lib/files.com/models/inbound_s3_log.rb +7 -2
  67. data/lib/files.com/models/inbox_recipient.rb +14 -4
  68. data/lib/files.com/models/inbox_registration.rb +7 -2
  69. data/lib/files.com/models/inbox_upload.rb +7 -2
  70. data/lib/files.com/models/integration_centric_profile.rb +34 -8
  71. data/lib/files.com/models/invoice.rb +13 -3
  72. data/lib/files.com/models/ip_address.rb +28 -8
  73. data/lib/files.com/models/key_lifecycle_rule.rb +34 -8
  74. data/lib/files.com/models/lock.rb +18 -3
  75. data/lib/files.com/models/metadata_category.rb +41 -10
  76. data/lib/files.com/models/notification.rb +34 -8
  77. data/lib/files.com/models/outbound_connection_log.rb +7 -2
  78. data/lib/files.com/models/partner.rb +34 -8
  79. data/lib/files.com/models/partner_channel.rb +34 -8
  80. data/lib/files.com/models/partner_channel_template.rb +34 -8
  81. data/lib/files.com/models/partner_site.rb +4 -0
  82. data/lib/files.com/models/partner_site_request.rb +33 -4
  83. data/lib/files.com/models/payment.rb +13 -3
  84. data/lib/files.com/models/pending_work_event.rb +13 -3
  85. data/lib/files.com/models/permission.rb +18 -4
  86. data/lib/files.com/models/public_hosting_request_log.rb +7 -2
  87. data/lib/files.com/models/public_key.rb +34 -8
  88. data/lib/files.com/models/remote_bandwidth_snapshot.rb +7 -2
  89. data/lib/files.com/models/remote_mount_backend.rb +39 -8
  90. data/lib/files.com/models/remote_server.rb +52 -11
  91. data/lib/files.com/models/remote_server_credential.rb +34 -8
  92. data/lib/files.com/models/request.rb +25 -6
  93. data/lib/files.com/models/restore.rb +14 -4
  94. data/lib/files.com/models/schedule.rb +34 -8
  95. data/lib/files.com/models/scheduled_export.rb +34 -8
  96. data/lib/files.com/models/scim_log.rb +13 -3
  97. data/lib/files.com/models/secret.rb +34 -8
  98. data/lib/files.com/models/session.rb +11 -2
  99. data/lib/files.com/models/settings_change.rb +7 -2
  100. data/lib/files.com/models/sftp_action_log.rb +7 -2
  101. data/lib/files.com/models/sftp_host_key.rb +34 -8
  102. data/lib/files.com/models/share_group.rb +34 -8
  103. data/lib/files.com/models/siem_http_destination.rb +39 -8
  104. data/lib/files.com/models/siem_http_destination_event.rb +13 -3
  105. data/lib/files.com/models/site.rb +16 -3
  106. data/lib/files.com/models/site_subdomain_redirect.rb +17 -3
  107. data/lib/files.com/models/snapshot.rb +39 -8
  108. data/lib/files.com/models/sso_event.rb +13 -3
  109. data/lib/files.com/models/sso_strategy.rb +18 -3
  110. data/lib/files.com/models/style.rb +20 -5
  111. data/lib/files.com/models/sync.rb +44 -8
  112. data/lib/files.com/models/sync_log.rb +7 -2
  113. data/lib/files.com/models/sync_run.rb +13 -3
  114. data/lib/files.com/models/usage_daily_snapshot.rb +7 -2
  115. data/lib/files.com/models/usage_snapshot.rb +7 -2
  116. data/lib/files.com/models/user.rb +50 -8
  117. data/lib/files.com/models/user_additional_email_recipient.rb +34 -8
  118. data/lib/files.com/models/user_cipher_use.rb +7 -2
  119. data/lib/files.com/models/user_lifecycle_rule.rb +34 -8
  120. data/lib/files.com/models/user_request.rb +24 -5
  121. data/lib/files.com/models/user_security_event.rb +13 -3
  122. data/lib/files.com/models/user_sftp_client_use.rb +7 -2
  123. data/lib/files.com/models/web_dav_action_log.rb +7 -2
  124. data/lib/files.com/models/webhook_test.rb +7 -2
  125. data/lib/files.com/models/workspace.rb +34 -8
  126. data/lib/files.com/response.rb +24 -0
  127. data/lib/files.com/sizable_io.rb +65 -4
  128. data/lib/files.com/version.rb +1 -1
  129. data/lib/files.com.rb +23 -1
  130. data/spec/language_spec.rb +20 -10
  131. data/spec/lib/api_client_spec.rb +173 -18
  132. data/spec/list_spec.rb +203 -187
  133. data/spec/models/file_transfer_spec.rb +346 -0
  134. data/spec/models/persistence_spec.rb +167 -0
  135. data/spec/spec_helper.rb +122 -6
  136. data/spec/support/stubbed_api.rb +14 -0
  137. data/spec/support/transfer_server.rb +60 -0
  138. metadata +6 -2
@@ -54,14 +54,19 @@ module Files
54
54
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
55
55
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `id`.
56
56
  # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `ai_task_id`, `user_id` or `workspace_id`.
57
+ #
58
+ # params:: Hash of API operation parameter values.
59
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
60
+ #
61
+ # Returns a Files::List of Files::ChatSession objects.
57
62
  def self.list(params = {}, options = {})
58
63
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
59
64
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
60
65
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
61
66
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
62
67
 
63
- List.new(ChatSession, params) do
64
- Api.send_request("/chat_sessions", :get, params, options)
68
+ List.new(ChatSession, params) do |page_params, &check_page|
69
+ Api.send_request("/chat_sessions", :get, page_params, options, &check_page)
65
70
  end
66
71
  end
67
72
 
@@ -71,13 +76,18 @@ module Files
71
76
 
72
77
  # Parameters:
73
78
  # id (required) - string - Chat Session ID.
79
+ #
80
+ # params:: Hash of API operation parameter values.
81
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
82
+ #
83
+ # Returns a Files::ChatSession.
74
84
  def self.find(id, params = {}, options = {})
75
85
  params ||= {}
76
86
  params[:id] = id
77
87
  raise InvalidParameterError.new("Bad parameter: id must be an String") if params[:id] and !params[:id].is_a?(String)
78
88
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
79
89
 
80
- response, options = Api.send_request("/chat_sessions/#{params[:id]}", :get, params, options)
90
+ response, options = Api.send_request("/chat_sessions/#{params[:id]}", :get, params, options) { |reply| reply.require_object("ChatSession") }
81
91
  ChatSession.new(response.data, options)
82
92
  end
83
93
 
@@ -120,7 +120,9 @@ module Files
120
120
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
121
121
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
122
122
 
123
- Api.send_request("/child_site_management_policies/#{@attributes[:id]}", :patch, params, @options)
123
+ response, options = Api.send_request("/child_site_management_policies/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("ChildSiteManagementPolicy") }
124
+ @attributes = response.data
125
+ [ response, options ]
124
126
  end
125
127
 
126
128
  def delete(params = {})
@@ -140,24 +142,29 @@ module Files
140
142
 
141
143
  def save
142
144
  if @attributes[:id]
143
- new_obj = update(@attributes)
145
+ update(@attributes)
144
146
  else
145
147
  new_obj = ChildSiteManagementPolicy.create(@attributes, @options)
148
+ @attributes = new_obj.attributes
146
149
  end
147
150
 
148
- @attributes = new_obj.attributes
149
151
  true
150
152
  end
151
153
 
152
154
  # Parameters:
153
155
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
154
156
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
157
+ #
158
+ # params:: Hash of API operation parameter values.
159
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
160
+ #
161
+ # Returns a Files::List of Files::ChildSiteManagementPolicy objects.
155
162
  def self.list(params = {}, options = {})
156
163
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
157
164
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
158
165
 
159
- List.new(ChildSiteManagementPolicy, params) do
160
- Api.send_request("/child_site_management_policies", :get, params, options)
166
+ List.new(ChildSiteManagementPolicy, params) do |page_params, &check_page|
167
+ Api.send_request("/child_site_management_policies", :get, page_params, options, &check_page)
161
168
  end
162
169
  end
163
170
 
@@ -167,13 +174,18 @@ module Files
167
174
 
168
175
  # Parameters:
169
176
  # id (required) - int64 - Child Site Management Policy ID.
177
+ #
178
+ # params:: Hash of API operation parameter values.
179
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
180
+ #
181
+ # Returns a Files::ChildSiteManagementPolicy.
170
182
  def self.find(id, params = {}, options = {})
171
183
  params ||= {}
172
184
  params[:id] = id
173
185
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
174
186
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
175
187
 
176
- response, options = Api.send_request("/child_site_management_policies/#{params[:id]}", :get, params, options)
188
+ response, options = Api.send_request("/child_site_management_policies/#{params[:id]}", :get, params, options) { |reply| reply.require_object("ChildSiteManagementPolicy") }
177
189
  ChildSiteManagementPolicy.new(response.data, options)
178
190
  end
179
191
 
@@ -189,6 +201,11 @@ module Files
189
201
  # policy_type (required) - string - Type of policy. Valid values: `settings`.
190
202
  # name - string - Name for this policy.
191
203
  # description - string - Description for this policy.
204
+ #
205
+ # params:: Hash of API operation parameter values.
206
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
207
+ #
208
+ # Returns a Files::ChildSiteManagementPolicy.
192
209
  def self.create(params = {}, options = {})
193
210
  raise InvalidParameterError.new("Bad parameter: value must be an Hash") if params[:value] and !params[:value].is_a?(Hash)
194
211
  raise InvalidParameterError.new("Bad parameter: skip_child_site_ids must be an Array") if params[:skip_child_site_ids] and !params[:skip_child_site_ids].is_a?(Array)
@@ -198,7 +215,7 @@ module Files
198
215
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
199
216
  raise MissingParameterError.new("Parameter missing: policy_type") unless params[:policy_type]
200
217
 
201
- response, options = Api.send_request("/child_site_management_policies", :post, params, options)
218
+ response, options = Api.send_request("/child_site_management_policies", :post, params, options) { |reply| reply.require_object("ChildSiteManagementPolicy") }
202
219
  ChildSiteManagementPolicy.new(response.data, options)
203
220
  end
204
221
 
@@ -210,6 +227,11 @@ module Files
210
227
  # policy_type - string - Type of policy. Valid values: `settings`.
211
228
  # name - string - Name for this policy.
212
229
  # description - string - Description for this policy.
230
+ #
231
+ # params:: Hash of API operation parameter values.
232
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
233
+ #
234
+ # Returns a Files::ChildSiteManagementPolicy.
213
235
  def self.update(id, params = {}, options = {})
214
236
  params ||= {}
215
237
  params[:id] = id
@@ -222,10 +244,14 @@ module Files
222
244
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
223
245
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
224
246
 
225
- response, options = Api.send_request("/child_site_management_policies/#{params[:id]}", :patch, params, options)
247
+ response, options = Api.send_request("/child_site_management_policies/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("ChildSiteManagementPolicy") }
226
248
  ChildSiteManagementPolicy.new(response.data, options)
227
249
  end
228
250
 
251
+ # params:: Hash of API operation parameter values.
252
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
253
+ #
254
+ # Returns nil.
229
255
  def self.delete(id, params = {}, options = {})
230
256
  params ||= {}
231
257
  params[:id] = id
@@ -81,7 +81,9 @@ module Files
81
81
  raise InvalidParameterError.new("Bad parameter: use_with_users must be an String") if params[:use_with_users] and !params[:use_with_users].is_a?(String)
82
82
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
83
83
 
84
- Api.send_request("/clickwraps/#{@attributes[:id]}", :patch, params, @options)
84
+ response, options = Api.send_request("/clickwraps/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("Clickwrap") }
85
+ @attributes = response.data
86
+ [ response, options ]
85
87
  end
86
88
 
87
89
  def delete(params = {})
@@ -101,12 +103,12 @@ module Files
101
103
 
102
104
  def save
103
105
  if @attributes[:id]
104
- new_obj = update(@attributes)
106
+ update(@attributes)
105
107
  else
106
108
  new_obj = Clickwrap.create(@attributes, @options)
109
+ @attributes = new_obj.attributes
107
110
  end
108
111
 
109
- @attributes = new_obj.attributes
110
112
  true
111
113
  end
112
114
 
@@ -114,13 +116,18 @@ module Files
114
116
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
115
117
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
116
118
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
119
+ #
120
+ # params:: Hash of API operation parameter values.
121
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
122
+ #
123
+ # Returns a Files::List of Files::Clickwrap objects.
117
124
  def self.list(params = {}, options = {})
118
125
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
119
126
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
120
127
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
121
128
 
122
- List.new(Clickwrap, params) do
123
- Api.send_request("/clickwraps", :get, params, options)
129
+ List.new(Clickwrap, params) do |page_params, &check_page|
130
+ Api.send_request("/clickwraps", :get, page_params, options, &check_page)
124
131
  end
125
132
  end
126
133
 
@@ -130,13 +137,18 @@ module Files
130
137
 
131
138
  # Parameters:
132
139
  # id (required) - int64 - Clickwrap ID.
140
+ #
141
+ # params:: Hash of API operation parameter values.
142
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
143
+ #
144
+ # Returns a Files::Clickwrap.
133
145
  def self.find(id, params = {}, options = {})
134
146
  params ||= {}
135
147
  params[:id] = id
136
148
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
137
149
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
138
150
 
139
- response, options = Api.send_request("/clickwraps/#{params[:id]}", :get, params, options)
151
+ response, options = Api.send_request("/clickwraps/#{params[:id]}", :get, params, options) { |reply| reply.require_object("Clickwrap") }
140
152
  Clickwrap.new(response.data, options)
141
153
  end
142
154
 
@@ -150,6 +162,11 @@ module Files
150
162
  # use_with_bundles - string - Use this Clickwrap for Bundles?
151
163
  # use_with_inboxes - string - Use this Clickwrap for Inboxes?
152
164
  # use_with_users - string - Use this Clickwrap for Users? Values: `none`, `require` (new user signup via email invitation only), `require_all_users_once` (show to all users at their next web login; once accepted, not shown again), `require_all_users_always` (show to all users on every web login).
165
+ #
166
+ # params:: Hash of API operation parameter values.
167
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
168
+ #
169
+ # Returns a Files::Clickwrap.
153
170
  def self.create(params = {}, options = {})
154
171
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
155
172
  raise InvalidParameterError.new("Bad parameter: body must be an String") if params[:body] and !params[:body].is_a?(String)
@@ -157,7 +174,7 @@ module Files
157
174
  raise InvalidParameterError.new("Bad parameter: use_with_inboxes must be an String") if params[:use_with_inboxes] and !params[:use_with_inboxes].is_a?(String)
158
175
  raise InvalidParameterError.new("Bad parameter: use_with_users must be an String") if params[:use_with_users] and !params[:use_with_users].is_a?(String)
159
176
 
160
- response, options = Api.send_request("/clickwraps", :post, params, options)
177
+ response, options = Api.send_request("/clickwraps", :post, params, options) { |reply| reply.require_object("Clickwrap") }
161
178
  Clickwrap.new(response.data, options)
162
179
  end
163
180
 
@@ -167,6 +184,11 @@ module Files
167
184
  # use_with_bundles - string - Use this Clickwrap for Bundles?
168
185
  # use_with_inboxes - string - Use this Clickwrap for Inboxes?
169
186
  # use_with_users - string - Use this Clickwrap for Users? Values: `none`, `require` (new user signup via email invitation only), `require_all_users_once` (show to all users at their next web login; once accepted, not shown again), `require_all_users_always` (show to all users on every web login).
187
+ #
188
+ # params:: Hash of API operation parameter values.
189
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
190
+ #
191
+ # Returns a Files::Clickwrap.
170
192
  def self.update(id, params = {}, options = {})
171
193
  params ||= {}
172
194
  params[:id] = id
@@ -178,10 +200,14 @@ module Files
178
200
  raise InvalidParameterError.new("Bad parameter: use_with_users must be an String") if params[:use_with_users] and !params[:use_with_users].is_a?(String)
179
201
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
180
202
 
181
- response, options = Api.send_request("/clickwraps/#{params[:id]}", :patch, params, options)
203
+ response, options = Api.send_request("/clickwraps/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("Clickwrap") }
182
204
  Clickwrap.new(response.data, options)
183
205
  end
184
206
 
207
+ # params:: Hash of API operation parameter values.
208
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
209
+ #
210
+ # Returns nil.
185
211
  def self.delete(id, params = {}, options = {})
186
212
  params ||= {}
187
213
  params[:id] = id
@@ -137,7 +137,9 @@ module Files
137
137
  raise InvalidParameterError.new("Bad parameter: domain must be an String") if params[:domain] and !params[:domain].is_a?(String)
138
138
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
139
139
 
140
- Api.send_request("/custom_domains/#{@attributes[:id]}", :patch, params, @options)
140
+ response, options = Api.send_request("/custom_domains/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("CustomDomain") }
141
+ @attributes = response.data
142
+ [ response, options ]
141
143
  end
142
144
 
143
145
  def delete(params = {})
@@ -157,12 +159,12 @@ module Files
157
159
 
158
160
  def save
159
161
  if @attributes[:id]
160
- new_obj = update(@attributes)
162
+ update(@attributes)
161
163
  else
162
164
  new_obj = CustomDomain.create(@attributes, @options)
165
+ @attributes = new_obj.attributes
163
166
  end
164
167
 
165
- @attributes = new_obj.attributes
166
168
  true
167
169
  end
168
170
 
@@ -171,14 +173,19 @@ module Files
171
173
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
172
174
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `id` or `available_to_all_workspaces`.
173
175
  # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`.
176
+ #
177
+ # params:: Hash of API operation parameter values.
178
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
179
+ #
180
+ # Returns a Files::List of Files::CustomDomain objects.
174
181
  def self.list(params = {}, options = {})
175
182
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
176
183
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
177
184
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
178
185
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
179
186
 
180
- List.new(CustomDomain, params) do
181
- Api.send_request("/custom_domains", :get, params, options)
187
+ List.new(CustomDomain, params) do |page_params, &check_page|
188
+ Api.send_request("/custom_domains", :get, page_params, options, &check_page)
182
189
  end
183
190
  end
184
191
 
@@ -188,13 +195,18 @@ module Files
188
195
 
189
196
  # Parameters:
190
197
  # id (required) - int64 - Custom Domain ID.
198
+ #
199
+ # params:: Hash of API operation parameter values.
200
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
201
+ #
202
+ # Returns a Files::CustomDomain.
191
203
  def self.find(id, params = {}, options = {})
192
204
  params ||= {}
193
205
  params[:id] = id
194
206
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
195
207
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
196
208
 
197
- response, options = Api.send_request("/custom_domains/#{params[:id]}", :get, params, options)
209
+ response, options = Api.send_request("/custom_domains/#{params[:id]}", :get, params, options) { |reply| reply.require_object("CustomDomain") }
198
210
  CustomDomain.new(response.data, options)
199
211
  end
200
212
 
@@ -205,6 +217,11 @@ module Files
205
217
  # Parameters:
206
218
  # id (required) - int64 - Custom Domain ID.
207
219
  # count (required) - int64 - Number of dedicated IP addresses to allocate.
220
+ #
221
+ # params:: Hash of API operation parameter values.
222
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
223
+ #
224
+ # Returns a Files::CustomDomain.
208
225
  def self.create_allocate_ip(id, params = {}, options = {})
209
226
  params ||= {}
210
227
  params[:id] = id
@@ -213,7 +230,7 @@ module Files
213
230
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
214
231
  raise MissingParameterError.new("Parameter missing: count") unless params[:count]
215
232
 
216
- response, options = Api.send_request("/custom_domains/#{params[:id]}/allocate_ips", :post, params, options)
233
+ response, options = Api.send_request("/custom_domains/#{params[:id]}/allocate_ips", :post, params, options) { |reply| reply.require_object("CustomDomain") }
217
234
  CustomDomain.new(response.data, options)
218
235
  end
219
236
 
@@ -224,6 +241,11 @@ module Files
224
241
  # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
225
242
  # ssl_certificate_id - int64 - Current SSL certificate ID.
226
243
  # domain (required) - string - Customer-owned domain name.
244
+ #
245
+ # params:: Hash of API operation parameter values.
246
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
247
+ #
248
+ # Returns a Files::CustomDomain.
227
249
  def self.create(params = {}, options = {})
228
250
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
229
251
  raise InvalidParameterError.new("Bad parameter: destination must be an String") if params[:destination] and !params[:destination].is_a?(String)
@@ -232,7 +254,7 @@ module Files
232
254
  raise InvalidParameterError.new("Bad parameter: domain must be an String") if params[:domain] and !params[:domain].is_a?(String)
233
255
  raise MissingParameterError.new("Parameter missing: domain") unless params[:domain]
234
256
 
235
- response, options = Api.send_request("/custom_domains", :post, params, options)
257
+ response, options = Api.send_request("/custom_domains", :post, params, options) { |reply| reply.require_object("CustomDomain") }
236
258
  CustomDomain.new(response.data, options)
237
259
  end
238
260
 
@@ -243,6 +265,11 @@ module Files
243
265
  # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
244
266
  # ssl_certificate_id - int64 - Current SSL certificate ID.
245
267
  # domain - string - Customer-owned domain name.
268
+ #
269
+ # params:: Hash of API operation parameter values.
270
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
271
+ #
272
+ # Returns a Files::CustomDomain.
246
273
  def self.update(id, params = {}, options = {})
247
274
  params ||= {}
248
275
  params[:id] = id
@@ -254,10 +281,14 @@ module Files
254
281
  raise InvalidParameterError.new("Bad parameter: domain must be an String") if params[:domain] and !params[:domain].is_a?(String)
255
282
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
256
283
 
257
- response, options = Api.send_request("/custom_domains/#{params[:id]}", :patch, params, options)
284
+ response, options = Api.send_request("/custom_domains/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("CustomDomain") }
258
285
  CustomDomain.new(response.data, options)
259
286
  end
260
287
 
288
+ # params:: Hash of API operation parameter values.
289
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
290
+ #
291
+ # Returns nil.
261
292
  def self.delete(id, params = {}, options = {})
262
293
  params ||= {}
263
294
  params[:id] = id
@@ -78,7 +78,9 @@ module Files
78
78
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
79
79
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
80
80
 
81
- Api.send_request("/desktop_configuration_profiles/#{@attributes[:id]}", :patch, params, @options)
81
+ response, options = Api.send_request("/desktop_configuration_profiles/#{@attributes[:id]}", :patch, params, @options) { |reply| reply.require_object("DesktopConfigurationProfile") }
82
+ @attributes = response.data
83
+ [ response, options ]
82
84
  end
83
85
 
84
86
  def delete(params = {})
@@ -98,12 +100,12 @@ module Files
98
100
 
99
101
  def save
100
102
  if @attributes[:id]
101
- new_obj = update(@attributes)
103
+ update(@attributes)
102
104
  else
103
105
  new_obj = DesktopConfigurationProfile.create(@attributes, @options)
106
+ @attributes = new_obj.attributes
104
107
  end
105
108
 
106
- @attributes = new_obj.attributes
107
109
  true
108
110
  end
109
111
 
@@ -112,14 +114,19 @@ module Files
112
114
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
113
115
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id` and `name`.
114
116
  # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`.
117
+ #
118
+ # params:: Hash of API operation parameter values.
119
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
120
+ #
121
+ # Returns a Files::List of Files::DesktopConfigurationProfile objects.
115
122
  def self.list(params = {}, options = {})
116
123
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
117
124
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
118
125
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
119
126
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
120
127
 
121
- List.new(DesktopConfigurationProfile, params) do
122
- Api.send_request("/desktop_configuration_profiles", :get, params, options)
128
+ List.new(DesktopConfigurationProfile, params) do |page_params, &check_page|
129
+ Api.send_request("/desktop_configuration_profiles", :get, page_params, options, &check_page)
123
130
  end
124
131
  end
125
132
 
@@ -129,13 +136,18 @@ module Files
129
136
 
130
137
  # Parameters:
131
138
  # id (required) - int64 - Desktop Configuration Profile ID.
139
+ #
140
+ # params:: Hash of API operation parameter values.
141
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
142
+ #
143
+ # Returns a Files::DesktopConfigurationProfile.
132
144
  def self.find(id, params = {}, options = {})
133
145
  params ||= {}
134
146
  params[:id] = id
135
147
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
136
148
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
137
149
 
138
- response, options = Api.send_request("/desktop_configuration_profiles/#{params[:id]}", :get, params, options)
150
+ response, options = Api.send_request("/desktop_configuration_profiles/#{params[:id]}", :get, params, options) { |reply| reply.require_object("DesktopConfigurationProfile") }
139
151
  DesktopConfigurationProfile.new(response.data, options)
140
152
  end
141
153
 
@@ -149,6 +161,11 @@ module Files
149
161
  # workspace_id - int64 - Workspace ID
150
162
  # use_for_all_users - boolean - Whether this profile applies to all users in the Workspace by default
151
163
  # disable_drive_mounting - boolean - Whether the desktop app should hide drive mounting, prevent new drive mounts, and unmount active drive mounts for users with this profile
164
+ #
165
+ # params:: Hash of API operation parameter values.
166
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
167
+ #
168
+ # Returns a Files::DesktopConfigurationProfile.
152
169
  def self.create(params = {}, options = {})
153
170
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
154
171
  raise InvalidParameterError.new("Bad parameter: mount_mappings must be an Hash") if params[:mount_mappings] and !params[:mount_mappings].is_a?(Hash)
@@ -156,7 +173,7 @@ module Files
156
173
  raise MissingParameterError.new("Parameter missing: name") unless params[:name]
157
174
  raise MissingParameterError.new("Parameter missing: mount_mappings") unless params[:mount_mappings]
158
175
 
159
- response, options = Api.send_request("/desktop_configuration_profiles", :post, params, options)
176
+ response, options = Api.send_request("/desktop_configuration_profiles", :post, params, options) { |reply| reply.require_object("DesktopConfigurationProfile") }
160
177
  DesktopConfigurationProfile.new(response.data, options)
161
178
  end
162
179
 
@@ -166,6 +183,11 @@ module Files
166
183
  # mount_mappings - object - Mount point mappings for the desktop app. Keys must be a single uppercase Windows drive letter other than A, B, or C, and values are Files.com paths to mount there.
167
184
  # use_for_all_users - boolean - Whether this profile applies to all users in the Workspace by default
168
185
  # disable_drive_mounting - boolean - Whether the desktop app should hide drive mounting, prevent new drive mounts, and unmount active drive mounts for users with this profile
186
+ #
187
+ # params:: Hash of API operation parameter values.
188
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
189
+ #
190
+ # Returns a Files::DesktopConfigurationProfile.
169
191
  def self.update(id, params = {}, options = {})
170
192
  params ||= {}
171
193
  params[:id] = id
@@ -175,10 +197,14 @@ module Files
175
197
  raise InvalidParameterError.new("Bad parameter: mount_mappings must be an Hash") if params[:mount_mappings] and !params[:mount_mappings].is_a?(Hash)
176
198
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
177
199
 
178
- response, options = Api.send_request("/desktop_configuration_profiles/#{params[:id]}", :patch, params, options)
200
+ response, options = Api.send_request("/desktop_configuration_profiles/#{params[:id]}", :patch, params, options) { |reply| reply.require_object("DesktopConfigurationProfile") }
179
201
  DesktopConfigurationProfile.new(response.data, options)
180
202
  end
181
203
 
204
+ # params:: Hash of API operation parameter values.
205
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
206
+ #
207
+ # Returns nil.
182
208
  def self.delete(id, params = {}, options = {})
183
209
  params ||= {}
184
210
  params[:id] = id
@@ -32,12 +32,17 @@ module Files
32
32
  # Parameters:
33
33
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
34
34
  # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
35
+ #
36
+ # params:: Hash of API operation parameter values.
37
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
38
+ #
39
+ # Returns a Files::List of Files::DnsRecord objects.
35
40
  def self.list(params = {}, options = {})
36
41
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
37
42
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
38
43
 
39
- List.new(DnsRecord, params) do
40
- Api.send_request("/dns_records", :get, params, options)
44
+ List.new(DnsRecord, params) do |page_params, &check_page|
45
+ Api.send_request("/dns_records", :get, page_params, options, &check_page)
41
46
  end
42
47
  end
43
48
 
@@ -64,6 +64,11 @@ module Files
64
64
  # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `sender`.
65
65
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
66
66
  # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
67
+ #
68
+ # params:: Hash of API operation parameter values.
69
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
70
+ #
71
+ # Returns a Files::List of Files::EmailIncomingMessage objects.
67
72
  def self.list(params = {}, options = {})
68
73
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
69
74
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
@@ -75,8 +80,8 @@ module Files
75
80
  raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
76
81
  raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
77
82
 
78
- List.new(EmailIncomingMessage, params) do
79
- Api.send_request("/email_incoming_messages", :get, params, options)
83
+ List.new(EmailIncomingMessage, params) do |page_params, &check_page|
84
+ Api.send_request("/email_incoming_messages", :get, page_params, options, &check_page)
80
85
  end
81
86
  end
82
87
 
@@ -67,6 +67,11 @@ module Files
67
67
  # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
68
68
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
69
69
  # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`.
70
+ #
71
+ # params:: Hash of API operation parameter values.
72
+ # options:: Hash of optional request configuration passed to Files::Api.send_request.
73
+ #
74
+ # Returns a Files::List of Files::EmailLog objects.
70
75
  def self.list(params = {}, options = {})
71
76
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
72
77
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
@@ -76,8 +81,8 @@ module Files
76
81
  raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
77
82
  raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
78
83
 
79
- List.new(EmailLog, params) do
80
- Api.send_request("/email_logs", :get, params, options)
84
+ List.new(EmailLog, params) do |page_params, &check_page|
85
+ Api.send_request("/email_logs", :get, page_params, options, &check_page)
81
86
  end
82
87
  end
83
88