files.com 1.0.150 → 1.0.151

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: 940c377b195416e86507580f31199480f7c5c6584376b98aeefc79db3b3701fb
4
- data.tar.gz: 11dd4c65a619afa1f88117aa742a5485fd458f296d735efd3566c225d757ce2d
3
+ metadata.gz: 9901c1e216e25e63c863661f74f91b5f2093b024b37d4e247336499e6b9d4374
4
+ data.tar.gz: d50e4d704c977df30d0580503f2167680c7c7a3a9320d427af9b80558d231c11
5
5
  SHA512:
6
- metadata.gz: 2194b7f45aeed071a28b319fc48180a38d232d6423f9d9c57af01627049e8559aa0a8ee0c0e0f4a36e7e947236bbc9e93b72329c0a3c57c1ddab1be21132c93b
7
- data.tar.gz: a349c39f0d7c92cee235ebd0a3843e72c970017b4bdcf5d585d0d85160335f5b0cbcf08c932a4d96d607df30e129f85697e867234ff11025a62e3600577acade
6
+ metadata.gz: 3154a243b500b6055bd08c37b05904ede350c1f15cbd3acee8e6408693e1871b1320785ab82b39fb9c1f910b5f5b9fe2e5491aa9147bc4f21ed7b4fc586e748f
7
+ data.tar.gz: 6b234e2e36a9eeb0d88de6b9bf30036f8ea77dedbf5c22f35845748ba918b15f9ceda07f8d1f514d61e90ba50c984c062f14028a502d04497a05dcddcf3494a8
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.150
1
+ 1.0.151
data/docs/group_user.md CHANGED
@@ -42,6 +42,25 @@ Files::GroupUser.list(
42
42
  * `group_id` (int64): Group ID. If provided, will return group_users of this group.
43
43
 
44
44
 
45
+ ---
46
+
47
+ ## Create Group User
48
+
49
+ ```
50
+ Files::GroupUser.create(
51
+ group_id: 1,
52
+ user_id: 1,
53
+ admin: true
54
+ )
55
+ ```
56
+
57
+ ### Parameters
58
+
59
+ * `group_id` (int64): Required - Group ID to add user to.
60
+ * `user_id` (int64): Required - User ID to add to group.
61
+ * `admin` (boolean): Is the user a group administrator?
62
+
63
+
45
64
  ---
46
65
 
47
66
  ## Update Group User
@@ -103,7 +103,12 @@ module Files
103
103
  end
104
104
 
105
105
  def save
106
- update(@attributes)
106
+ if @attributes[:id]
107
+ update(@attributes)
108
+ else
109
+ new_obj = GroupUser.create(@attributes, @options)
110
+ @attributes = new_obj.attributes
111
+ end
107
112
  end
108
113
 
109
114
  # Parameters:
@@ -126,6 +131,20 @@ module Files
126
131
  list(params, options)
127
132
  end
128
133
 
134
+ # Parameters:
135
+ # group_id (required) - int64 - Group ID to add user to.
136
+ # user_id (required) - int64 - User ID to add to group.
137
+ # admin - boolean - Is the user a group administrator?
138
+ def self.create(params = {}, options = {})
139
+ raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
140
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
141
+ raise MissingParameterError.new("Parameter missing: group_id") unless params.dig(:group_id)
142
+ raise MissingParameterError.new("Parameter missing: user_id") unless params.dig(:user_id)
143
+
144
+ response, options = Api.send_request("/group_users", :post, params, options)
145
+ GroupUser.new(response.data, options)
146
+ end
147
+
129
148
  # Parameters:
130
149
  # group_id (required) - int64 - Group ID to add user to.
131
150
  # user_id (required) - int64 - User ID to add to group.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.150
4
+ version: 1.0.151
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-25 00:00:00.000000000 Z
11
+ date: 2021-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable