files.com 1.1.334 → 1.1.336

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9488cfb5b22f57a1844d34b93def327e31405e10072458227754a4282ccd7bb
4
- data.tar.gz: ad460ec7456e52ae77ab04bfb2ba4f3ac6d4acad893f9c6e5e8db19efe87148d
3
+ metadata.gz: 9c936c175deeddfd4894e53c06f6b2880f0660310a070c94a189ba61a798f0e0
4
+ data.tar.gz: f78326fad01e92d2b6a0c9cc00470ec1071271d517d8e5c614122cd528af5d93
5
5
  SHA512:
6
- metadata.gz: 6b39d39032a8d48a88a8cef3c897e4ba0be8af21a526dc7783a86ab69eb493d18518d2f1bcfc186009ae700d16c61202e8dcd4f156617f2b0da06b7c68929004
7
- data.tar.gz: 111dc8e5298f71d990bd7923cb67680880872ce4dc94423935abadce07fa4df127d21ad68a4c73b2ae25feff86c5f76d3f02fef341f4e1561a6149beee8f5a3d
6
+ metadata.gz: 3772512a57234236522aabb195c712cb07c2ac2fffeeb1435eb99eb55a26f227cc8cc9ee469e515cceb1c9a68c724b3781b32e24cca39c531d810b1b2cb80751
7
+ data.tar.gz: 7117d3f81962120039bec8631244a9630e668430151d665418866787b67f107890a631010d4f6a43bc9f72fa0f988dddc0ee113e3a80f6b1c777e76960d42ea7
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.334
1
+ 1.1.336
data/docs/partner.md ADDED
@@ -0,0 +1,158 @@
1
+ # Partner
2
+
3
+ ## Example Partner Object
4
+
5
+ ```
6
+ {
7
+ "allow_bypassing_2fa_policies": true,
8
+ "allow_credential_changes": true,
9
+ "allow_user_creation": true,
10
+ "id": 1,
11
+ "name": "Acme Corp",
12
+ "notes": "This is a note about the partner.",
13
+ "root_folder": "/AcmeCorp"
14
+ }
15
+ ```
16
+
17
+ * `allow_bypassing_2fa_policies` (boolean): Allow users created under this Partner to bypass Two-Factor Authentication policies.
18
+ * `allow_credential_changes` (boolean): Allow Partner Admins to change or reset credentials for users belonging to this Partner.
19
+ * `allow_user_creation` (boolean): Allow Partner Admins to create users.
20
+ * `id` (int64): The unique ID of the Partner.
21
+ * `name` (string): The name of the Partner.
22
+ * `notes` (string): Notes about this Partner.
23
+ * `root_folder` (string): The root folder path for this Partner.
24
+
25
+
26
+ ---
27
+
28
+ ## List Partners
29
+
30
+ ```
31
+ Files::Partner.list
32
+ ```
33
+
34
+ ### Parameters
35
+
36
+ * `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.
37
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
38
+ * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
39
+
40
+
41
+ ---
42
+
43
+ ## Show Partner
44
+
45
+ ```
46
+ Files::Partner.find(id)
47
+ ```
48
+
49
+ ### Parameters
50
+
51
+ * `id` (int64): Required - Partner ID.
52
+
53
+
54
+ ---
55
+
56
+ ## Create Partner
57
+
58
+ ```
59
+ Files::Partner.create(
60
+ allow_bypassing_2fa_policies: false,
61
+ allow_credential_changes: false,
62
+ allow_user_creation: false,
63
+ name: "Acme Corp",
64
+ notes: "This is a note about the partner.",
65
+ root_folder: "/AcmeCorp"
66
+ )
67
+ ```
68
+
69
+ ### Parameters
70
+
71
+ * `allow_bypassing_2fa_policies` (boolean): Allow users created under this Partner to bypass Two-Factor Authentication policies.
72
+ * `allow_credential_changes` (boolean): Allow Partner Admins to change or reset credentials for users belonging to this Partner.
73
+ * `allow_user_creation` (boolean): Allow Partner Admins to create users.
74
+ * `name` (string): The name of the Partner.
75
+ * `notes` (string): Notes about this Partner.
76
+ * `root_folder` (string): The root folder path for this Partner.
77
+
78
+
79
+ ---
80
+
81
+ ## Update Partner
82
+
83
+ ```
84
+ Files::Partner.update(id,
85
+ allow_bypassing_2fa_policies: false,
86
+ allow_credential_changes: false,
87
+ allow_user_creation: false,
88
+ name: "Acme Corp",
89
+ notes: "This is a note about the partner.",
90
+ root_folder: "/AcmeCorp"
91
+ )
92
+ ```
93
+
94
+ ### Parameters
95
+
96
+ * `id` (int64): Required - Partner ID.
97
+ * `allow_bypassing_2fa_policies` (boolean): Allow users created under this Partner to bypass Two-Factor Authentication policies.
98
+ * `allow_credential_changes` (boolean): Allow Partner Admins to change or reset credentials for users belonging to this Partner.
99
+ * `allow_user_creation` (boolean): Allow Partner Admins to create users.
100
+ * `name` (string): The name of the Partner.
101
+ * `notes` (string): Notes about this Partner.
102
+ * `root_folder` (string): The root folder path for this Partner.
103
+
104
+
105
+ ---
106
+
107
+ ## Delete Partner
108
+
109
+ ```
110
+ Files::Partner.delete(id)
111
+ ```
112
+
113
+ ### Parameters
114
+
115
+ * `id` (int64): Required - Partner ID.
116
+
117
+
118
+ ---
119
+
120
+ ## Update Partner
121
+
122
+ ```
123
+ partner = Files::Partner.find(id)
124
+
125
+ partner.update(
126
+ allow_bypassing_2fa_policies: false,
127
+ allow_credential_changes: false,
128
+ allow_user_creation: false,
129
+ name: "Acme Corp",
130
+ notes: "This is a note about the partner.",
131
+ root_folder: "/AcmeCorp"
132
+ )
133
+ ```
134
+
135
+ ### Parameters
136
+
137
+ * `id` (int64): Required - Partner ID.
138
+ * `allow_bypassing_2fa_policies` (boolean): Allow users created under this Partner to bypass Two-Factor Authentication policies.
139
+ * `allow_credential_changes` (boolean): Allow Partner Admins to change or reset credentials for users belonging to this Partner.
140
+ * `allow_user_creation` (boolean): Allow Partner Admins to create users.
141
+ * `name` (string): The name of the Partner.
142
+ * `notes` (string): Notes about this Partner.
143
+ * `root_folder` (string): The root folder path for this Partner.
144
+
145
+
146
+ ---
147
+
148
+ ## Delete Partner
149
+
150
+ ```
151
+ partner = Files::Partner.find(id)
152
+
153
+ partner.delete
154
+ ```
155
+
156
+ ### Parameters
157
+
158
+ * `id` (int64): Required - Partner ID.
data/docs/permission.md CHANGED
@@ -10,6 +10,7 @@
10
10
  "username": "user",
11
11
  "group_id": 1,
12
12
  "group_name": "example",
13
+ "partner_id": 1,
13
14
  "permission": "full",
14
15
  "recursive": true,
15
16
  "site_id": 1
@@ -22,6 +23,7 @@
22
23
  * `username` (string): Username (if applicable)
23
24
  * `group_id` (int64): Group ID
24
25
  * `group_name` (string): Group name (if applicable)
26
+ * `partner_id` (int64): Partner ID (if applicable)
25
27
  * `permission` (string): Permission type. See the table referenced in the documentation for an explanation of each permission.
26
28
  * `recursive` (boolean): Recursive: does this permission apply to subfolders?
27
29
  * `site_id` (int64): Site ID
@@ -36,6 +38,7 @@ Files::Permission.list(
36
38
  path: "example",
37
39
  include_groups: false,
38
40
  group_id: 1,
41
+ partner_id: 1,
39
42
  user_id: 1
40
43
  )
41
44
  ```
@@ -44,12 +47,13 @@ Files::Permission.list(
44
47
 
45
48
  * `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.
46
49
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
47
- * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id` or `id`.
48
- * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]` or `[ user_id, group_id, path ]`.
50
+ * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id`, `partner_id` or `id`.
51
+ * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id`, `partner_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ partner_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]`, `[ user_id, group_id, path ]`, `[ user_id, group_id, partner_id ]` or `[ user_id, group_id, partner_id, path ]`.
49
52
  * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
50
53
  * `path` (string): Permission path. If provided, will scope all permissions(including upward) to this path.
51
54
  * `include_groups` (boolean): If searching by user or group, also include user's permissions that are inherited from its groups?
52
55
  * `group_id` (string):
56
+ * `partner_id` (string):
53
57
  * `user_id` (string):
54
58
 
55
59
 
@@ -63,6 +67,7 @@ Files::Permission.create(
63
67
  group_id: 1,
64
68
  permission: "full",
65
69
  recursive: false,
70
+ partner_id: 1,
66
71
  user_id: 1,
67
72
  username: "user",
68
73
  group_name: "example",
@@ -76,6 +81,7 @@ Files::Permission.create(
76
81
  * `group_id` (int64): Group ID. Provide `group_name` or `group_id`
77
82
  * `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
78
83
  * `recursive` (boolean): Apply to subfolders recursively?
84
+ * `partner_id` (int64): Partner ID if this Permission belongs to a partner.
79
85
  * `user_id` (int64): User ID. Provide `username` or `user_id`
80
86
  * `username` (string): User username. Provide `username` or `user_id`
81
87
  * `group_name` (string): Group name. Provide `group_name` or `group_id`
data/docs/site.md CHANGED
@@ -259,6 +259,8 @@
259
259
  "notes": "Internal notes on this user.",
260
260
  "notification_daily_send_time": 18,
261
261
  "office_integration_enabled": true,
262
+ "partner_admin": true,
263
+ "partner_id": 1,
262
264
  "password_set_at": "2000-01-01T01:00:00Z",
263
265
  "password_validity_days": 1,
264
266
  "public_keys_count": 1,
data/docs/user.md CHANGED
@@ -46,6 +46,8 @@
46
46
  "notes": "Internal notes on this user.",
47
47
  "notification_daily_send_time": 18,
48
48
  "office_integration_enabled": true,
49
+ "partner_admin": true,
50
+ "partner_id": 1,
49
51
  "password_set_at": "2000-01-01T01:00:00Z",
50
52
  "password_validity_days": 1,
51
53
  "public_keys_count": 1,
@@ -116,6 +118,8 @@
116
118
  * `notes` (string): Any internal notes on the user
117
119
  * `notification_daily_send_time` (int64): Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
118
120
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
121
+ * `partner_admin` (boolean): Is this user a Partner administrator?
122
+ * `partner_id` (int64): Partner ID if this user belongs to a Partner
119
123
  * `password_set_at` (date-time): Last time the user's password was set
120
124
  * `password_validity_days` (int64): Number of days to allow user to use the same password
121
125
  * `public_keys_count` (int64): Number of public keys associated with this user
@@ -224,6 +228,7 @@ Files::User.create(
224
228
  company: "ACME Corp.",
225
229
  notes: "Internal notes on this user.",
226
230
  office_integration_enabled: true,
231
+ partner_id: 1,
227
232
  password_validity_days: 1,
228
233
  readonly_site_admin: true,
229
234
  receive_admin_alerts: true,
@@ -277,6 +282,7 @@ Files::User.create(
277
282
  * `company` (string): User's company
278
283
  * `notes` (string): Any internal notes on the user
279
284
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
285
+ * `partner_id` (int64): Partner ID if this user belongs to a Partner
280
286
  * `password_validity_days` (int64): Number of days to allow user to use the same password
281
287
  * `readonly_site_admin` (boolean): Is the user an allowed to view all (non-billing) site configuration for this site?
282
288
  * `receive_admin_alerts` (boolean): Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -365,6 +371,7 @@ Files::User.update(id,
365
371
  company: "ACME Corp.",
366
372
  notes: "Internal notes on this user.",
367
373
  office_integration_enabled: true,
374
+ partner_id: 1,
368
375
  password_validity_days: 1,
369
376
  readonly_site_admin: true,
370
377
  receive_admin_alerts: true,
@@ -420,6 +427,7 @@ Files::User.update(id,
420
427
  * `company` (string): User's company
421
428
  * `notes` (string): Any internal notes on the user
422
429
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
430
+ * `partner_id` (int64): Partner ID if this user belongs to a Partner
423
431
  * `password_validity_days` (int64): Number of days to allow user to use the same password
424
432
  * `readonly_site_admin` (boolean): Is the user an allowed to view all (non-billing) site configuration for this site?
425
433
  * `receive_admin_alerts` (boolean): Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -533,6 +541,7 @@ user.update(
533
541
  company: "ACME Corp.",
534
542
  notes: "Internal notes on this user.",
535
543
  office_integration_enabled: true,
544
+ partner_id: 1,
536
545
  password_validity_days: 1,
537
546
  readonly_site_admin: true,
538
547
  receive_admin_alerts: true,
@@ -588,6 +597,7 @@ user.update(
588
597
  * `company` (string): User's company
589
598
  * `notes` (string): Any internal notes on the user
590
599
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
600
+ * `partner_id` (int64): Partner ID if this user belongs to a Partner
591
601
  * `password_validity_days` (int64): Number of days to allow user to use the same password
592
602
  * `readonly_site_admin` (boolean): Is the user an allowed to view all (non-billing) site configuration for this site?
593
603
  * `receive_admin_alerts` (boolean): Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -197,6 +197,7 @@ module Files
197
197
 
198
198
  private def check_api_key!(api_key)
199
199
  raise AuthenticationError, "No Files.com API key provided. Set your API key using \"Files.api_key = <API-KEY>\". You can generate API keys from the Files.com's web interface. " unless api_key
200
+ raise AuthenticationError, "Your API key must be a string" unless api_key.is_a?(String)
200
201
 
201
202
  return unless api_key =~ /\s/
202
203
 
@@ -0,0 +1,206 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class Partner
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
13
+ def allow_bypassing_2fa_policies
14
+ @attributes[:allow_bypassing_2fa_policies]
15
+ end
16
+
17
+ def allow_bypassing_2fa_policies=(value)
18
+ @attributes[:allow_bypassing_2fa_policies] = value
19
+ end
20
+
21
+ # boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
22
+ def allow_credential_changes
23
+ @attributes[:allow_credential_changes]
24
+ end
25
+
26
+ def allow_credential_changes=(value)
27
+ @attributes[:allow_credential_changes] = value
28
+ end
29
+
30
+ # boolean - Allow Partner Admins to create users.
31
+ def allow_user_creation
32
+ @attributes[:allow_user_creation]
33
+ end
34
+
35
+ def allow_user_creation=(value)
36
+ @attributes[:allow_user_creation] = value
37
+ end
38
+
39
+ # int64 - The unique ID of the Partner.
40
+ def id
41
+ @attributes[:id]
42
+ end
43
+
44
+ def id=(value)
45
+ @attributes[:id] = value
46
+ end
47
+
48
+ # string - The name of the Partner.
49
+ def name
50
+ @attributes[:name]
51
+ end
52
+
53
+ def name=(value)
54
+ @attributes[:name] = value
55
+ end
56
+
57
+ # string - Notes about this Partner.
58
+ def notes
59
+ @attributes[:notes]
60
+ end
61
+
62
+ def notes=(value)
63
+ @attributes[:notes] = value
64
+ end
65
+
66
+ # string - The root folder path for this Partner.
67
+ def root_folder
68
+ @attributes[:root_folder]
69
+ end
70
+
71
+ def root_folder=(value)
72
+ @attributes[:root_folder] = value
73
+ end
74
+
75
+ # Parameters:
76
+ # allow_bypassing_2fa_policies - boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
77
+ # allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
78
+ # allow_user_creation - boolean - Allow Partner Admins to create users.
79
+ # name - string - The name of the Partner.
80
+ # notes - string - Notes about this Partner.
81
+ # root_folder - string - The root folder path for this Partner.
82
+ def update(params = {})
83
+ params ||= {}
84
+ params[:id] = @attributes[:id]
85
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
86
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
87
+ raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
88
+ raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
89
+ raise InvalidParameterError.new("Bad parameter: root_folder must be an String") if params[:root_folder] and !params[:root_folder].is_a?(String)
90
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
91
+
92
+ Api.send_request("/partners/#{@attributes[:id]}", :patch, params, @options)
93
+ end
94
+
95
+ def delete(params = {})
96
+ params ||= {}
97
+ params[:id] = @attributes[:id]
98
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
99
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
100
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
101
+
102
+ Api.send_request("/partners/#{@attributes[:id]}", :delete, params, @options)
103
+ end
104
+
105
+ def destroy(params = {})
106
+ delete(params)
107
+ nil
108
+ end
109
+
110
+ def save
111
+ if @attributes[:id]
112
+ new_obj = update(@attributes)
113
+ else
114
+ new_obj = Partner.create(@attributes, @options)
115
+ end
116
+
117
+ @attributes = new_obj.attributes
118
+ true
119
+ end
120
+
121
+ # Parameters:
122
+ # 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.
123
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
124
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
125
+ def self.list(params = {}, options = {})
126
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
127
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
128
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
129
+
130
+ List.new(Partner, params) do
131
+ Api.send_request("/partners", :get, params, options)
132
+ end
133
+ end
134
+
135
+ def self.all(params = {}, options = {})
136
+ list(params, options)
137
+ end
138
+
139
+ # Parameters:
140
+ # id (required) - int64 - Partner ID.
141
+ def self.find(id, params = {}, options = {})
142
+ params ||= {}
143
+ params[:id] = id
144
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
145
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
146
+
147
+ response, options = Api.send_request("/partners/#{params[:id]}", :get, params, options)
148
+ Partner.new(response.data, options)
149
+ end
150
+
151
+ def self.get(id, params = {}, options = {})
152
+ find(id, params, options)
153
+ end
154
+
155
+ # Parameters:
156
+ # allow_bypassing_2fa_policies - boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
157
+ # allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
158
+ # allow_user_creation - boolean - Allow Partner Admins to create users.
159
+ # name - string - The name of the Partner.
160
+ # notes - string - Notes about this Partner.
161
+ # root_folder - string - The root folder path for this Partner.
162
+ def self.create(params = {}, options = {})
163
+ raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
164
+ raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
165
+ raise InvalidParameterError.new("Bad parameter: root_folder must be an String") if params[:root_folder] and !params[:root_folder].is_a?(String)
166
+
167
+ response, options = Api.send_request("/partners", :post, params, options)
168
+ Partner.new(response.data, options)
169
+ end
170
+
171
+ # Parameters:
172
+ # allow_bypassing_2fa_policies - boolean - Allow users created under this Partner to bypass Two-Factor Authentication policies.
173
+ # allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
174
+ # allow_user_creation - boolean - Allow Partner Admins to create users.
175
+ # name - string - The name of the Partner.
176
+ # notes - string - Notes about this Partner.
177
+ # root_folder - string - The root folder path for this Partner.
178
+ def self.update(id, params = {}, options = {})
179
+ params ||= {}
180
+ params[:id] = id
181
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
182
+ raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
183
+ raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
184
+ raise InvalidParameterError.new("Bad parameter: root_folder must be an String") if params[:root_folder] and !params[:root_folder].is_a?(String)
185
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
186
+
187
+ response, options = Api.send_request("/partners/#{params[:id]}", :patch, params, options)
188
+ Partner.new(response.data, options)
189
+ end
190
+
191
+ def self.delete(id, params = {}, options = {})
192
+ params ||= {}
193
+ params[:id] = id
194
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
195
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
196
+
197
+ Api.send_request("/partners/#{params[:id]}", :delete, params, options)
198
+ nil
199
+ end
200
+
201
+ def self.destroy(id, params = {}, options = {})
202
+ delete(id, params, options)
203
+ nil
204
+ end
205
+ end
206
+ end
@@ -63,6 +63,15 @@ module Files
63
63
  @attributes[:group_name] = value
64
64
  end
65
65
 
66
+ # int64 - Partner ID (if applicable)
67
+ def partner_id
68
+ @attributes[:partner_id]
69
+ end
70
+
71
+ def partner_id=(value)
72
+ @attributes[:partner_id] = value
73
+ end
74
+
66
75
  # string - Permission type. See the table referenced in the documentation for an explanation of each permission.
67
76
  def permission
68
77
  @attributes[:permission]
@@ -119,12 +128,13 @@ module Files
119
128
  # Parameters:
120
129
  # 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.
121
130
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
122
- # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id` or `id`.
123
- # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]` or `[ user_id, group_id, path ]`.
131
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id`, `partner_id` or `id`.
132
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id`, `partner_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ partner_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]`, `[ user_id, group_id, path ]`, `[ user_id, group_id, partner_id ]` or `[ user_id, group_id, partner_id, path ]`.
124
133
  # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
125
134
  # path - string - Permission path. If provided, will scope all permissions(including upward) to this path.
126
135
  # include_groups - boolean - If searching by user or group, also include user's permissions that are inherited from its groups?
127
136
  # group_id - string
137
+ # partner_id - string
128
138
  # user_id - string
129
139
  def self.list(params = {}, options = {})
130
140
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
@@ -134,6 +144,7 @@ module Files
134
144
  raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
135
145
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
136
146
  raise InvalidParameterError.new("Bad parameter: group_id must be an String") if params[:group_id] and !params[:group_id].is_a?(String)
147
+ raise InvalidParameterError.new("Bad parameter: partner_id must be an String") if params[:partner_id] and !params[:partner_id].is_a?(String)
137
148
  raise InvalidParameterError.new("Bad parameter: user_id must be an String") if params[:user_id] and !params[:user_id].is_a?(String)
138
149
 
139
150
  List.new(Permission, params) do
@@ -150,6 +161,7 @@ module Files
150
161
  # group_id - int64 - Group ID. Provide `group_name` or `group_id`
151
162
  # permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
152
163
  # recursive - boolean - Apply to subfolders recursively?
164
+ # partner_id - int64 - Partner ID if this Permission belongs to a partner.
153
165
  # user_id - int64 - User ID. Provide `username` or `user_id`
154
166
  # username - string - User username. Provide `username` or `user_id`
155
167
  # group_name - string - Group name. Provide `group_name` or `group_id`
@@ -158,6 +170,7 @@ module Files
158
170
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
159
171
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer)
160
172
  raise InvalidParameterError.new("Bad parameter: permission must be an String") if params[:permission] and !params[:permission].is_a?(String)
173
+ raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer)
161
174
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
162
175
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String)
163
176
  raise InvalidParameterError.new("Bad parameter: group_name must be an String") if params[:group_name] and !params[:group_name].is_a?(String)
@@ -365,6 +365,24 @@ module Files
365
365
  @attributes[:office_integration_enabled] = value
366
366
  end
367
367
 
368
+ # boolean - Is this user a Partner administrator?
369
+ def partner_admin
370
+ @attributes[:partner_admin]
371
+ end
372
+
373
+ def partner_admin=(value)
374
+ @attributes[:partner_admin] = value
375
+ end
376
+
377
+ # int64 - Partner ID if this user belongs to a Partner
378
+ def partner_id
379
+ @attributes[:partner_id]
380
+ end
381
+
382
+ def partner_id=(value)
383
+ @attributes[:partner_id] = value
384
+ end
385
+
368
386
  # date-time - Last time the user's password was set
369
387
  def password_set_at
370
388
  @attributes[:password_set_at]
@@ -771,6 +789,7 @@ module Files
771
789
  # company - string - User's company
772
790
  # notes - string - Any internal notes on the user
773
791
  # office_integration_enabled - boolean - Enable integration with Office for the web?
792
+ # partner_id - int64 - Partner ID if this user belongs to a Partner
774
793
  # password_validity_days - int64 - Number of days to allow user to use the same password
775
794
  # readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
776
795
  # receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -814,6 +833,7 @@ module Files
814
833
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
815
834
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String)
816
835
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
836
+ raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer)
817
837
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params[:password_validity_days] and !params[:password_validity_days].is_a?(Integer)
818
838
  raise InvalidParameterError.new("Bad parameter: require_login_by must be an String") if params[:require_login_by] and !params[:require_login_by].is_a?(String)
819
839
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params[:ssl_required] and !params[:ssl_required].is_a?(String)
@@ -939,6 +959,7 @@ module Files
939
959
  # company - string - User's company
940
960
  # notes - string - Any internal notes on the user
941
961
  # office_integration_enabled - boolean - Enable integration with Office for the web?
962
+ # partner_id - int64 - Partner ID if this user belongs to a Partner
942
963
  # password_validity_days - int64 - Number of days to allow user to use the same password
943
964
  # readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
944
965
  # receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -977,6 +998,7 @@ module Files
977
998
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
978
999
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String)
979
1000
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
1001
+ raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer)
980
1002
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params[:password_validity_days] and !params[:password_validity_days].is_a?(Integer)
981
1003
  raise InvalidParameterError.new("Bad parameter: require_login_by must be an String") if params[:require_login_by] and !params[:require_login_by].is_a?(String)
982
1004
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params[:ssl_required] and !params[:ssl_required].is_a?(String)
@@ -1056,6 +1078,7 @@ module Files
1056
1078
  # company - string - User's company
1057
1079
  # notes - string - Any internal notes on the user
1058
1080
  # office_integration_enabled - boolean - Enable integration with Office for the web?
1081
+ # partner_id - int64 - Partner ID if this user belongs to a Partner
1059
1082
  # password_validity_days - int64 - Number of days to allow user to use the same password
1060
1083
  # readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
1061
1084
  # receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -1098,6 +1121,7 @@ module Files
1098
1121
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
1099
1122
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String)
1100
1123
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
1124
+ raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer)
1101
1125
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params[:password_validity_days] and !params[:password_validity_days].is_a?(Integer)
1102
1126
  raise InvalidParameterError.new("Bad parameter: require_login_by must be an String") if params[:require_login_by] and !params[:require_login_by].is_a?(String)
1103
1127
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params[:ssl_required] and !params[:ssl_required].is_a?(String)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.334"
4
+ VERSION = "1.1.336"
5
5
  end
data/lib/files.com.rb CHANGED
@@ -96,6 +96,7 @@ require "files.com/models/message_comment_reaction"
96
96
  require "files.com/models/message_reaction"
97
97
  require "files.com/models/notification"
98
98
  require "files.com/models/outbound_connection_log"
99
+ require "files.com/models/partner"
99
100
  require "files.com/models/payment"
100
101
  require "files.com/models/payment_line_item"
101
102
  require "files.com/models/permission"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.334
4
+ version: 1.1.336
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
@@ -221,6 +221,7 @@ files:
221
221
  - docs/message_reaction.md
222
222
  - docs/notification.md
223
223
  - docs/outbound_connection_log.md
224
+ - docs/partner.md
224
225
  - docs/payment.md
225
226
  - docs/payment_line_item.md
226
227
  - docs/permission.md
@@ -334,6 +335,7 @@ files:
334
335
  - lib/files.com/models/message_reaction.rb
335
336
  - lib/files.com/models/notification.rb
336
337
  - lib/files.com/models/outbound_connection_log.rb
338
+ - lib/files.com/models/partner.rb
337
339
  - lib/files.com/models/payment.rb
338
340
  - lib/files.com/models/payment_line_item.rb
339
341
  - lib/files.com/models/permission.rb