files.com 1.0.379 → 1.0.381
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/gpg_key.md +151 -0
- data/lib/files.com/models/gpg_key.rb +204 -0
- data/lib/files.com/version.rb +1 -1
- data/lib/files.com.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0eb4172dc7d2e3c8bd4586a3f3a2295602d1ea10e41119e58eee5f4ad84ec806
|
4
|
+
data.tar.gz: c5f52e363c827bc589cdd85416d1879e00bd7d3471cac365a88629cb45788483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cc364e5eefa768131ebed3c400d0c2a565e2aef72df35f977b0ca5e4ebf7184bef426903427e91720a2afeaa0a786906c3463dc02e3af1375b2629ff61deb3f
|
7
|
+
data.tar.gz: 57cd6365ad0ef3ccf088dfbde4e1a9e1c4ff26d292c170f498fd0e3e93225c0a87fe1dbf6ca1fc62510fb5beb58995c810fc9c018d875392bc1cb562ef30c533
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.381
|
data/docs/gpg_key.md
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
# GpgKey
|
2
|
+
|
3
|
+
## Example GpgKey Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"id": 1,
|
8
|
+
"expires_at": "2000-01-01T01:00:00Z",
|
9
|
+
"name": "key name",
|
10
|
+
"user_id": 1,
|
11
|
+
"public_key": "7f8bc1210b09b9ddf469e6b6b8920e76",
|
12
|
+
"private_key": "ab236cfe4a195f0226bc2e674afdd6b0",
|
13
|
+
"private_key_password": "[your GPG private key password]"
|
14
|
+
}
|
15
|
+
```
|
16
|
+
|
17
|
+
* `id` (int64): Your GPG key ID.
|
18
|
+
* `expires_at` (date-time): Your GPG key expiration date.
|
19
|
+
* `name` (string): Your GPG key name.
|
20
|
+
* `user_id` (int64): GPG owner's user id
|
21
|
+
* `public_key` (string): Your GPG public key
|
22
|
+
* `private_key` (string): Your GPG private key.
|
23
|
+
* `private_key_password` (string): Your GPG private key password. Only required for password protected keys.
|
24
|
+
|
25
|
+
|
26
|
+
---
|
27
|
+
|
28
|
+
## List Gpg Keys
|
29
|
+
|
30
|
+
```
|
31
|
+
Files::GpgKey.list(
|
32
|
+
user_id: 1,
|
33
|
+
per_page: 1
|
34
|
+
)
|
35
|
+
```
|
36
|
+
|
37
|
+
### Parameters
|
38
|
+
|
39
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
40
|
+
* `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.
|
41
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
42
|
+
|
43
|
+
|
44
|
+
---
|
45
|
+
|
46
|
+
## Show Gpg Key
|
47
|
+
|
48
|
+
```
|
49
|
+
Files::GpgKey.find(id)
|
50
|
+
```
|
51
|
+
|
52
|
+
### Parameters
|
53
|
+
|
54
|
+
* `id` (int64): Required - Gpg Key ID.
|
55
|
+
|
56
|
+
|
57
|
+
---
|
58
|
+
|
59
|
+
## Create Gpg Key
|
60
|
+
|
61
|
+
```
|
62
|
+
Files::GpgKey.create(
|
63
|
+
user_id: 1,
|
64
|
+
name: "key name",
|
65
|
+
public_key: "7f8bc1210b09b9ddf469e6b6b8920e76",
|
66
|
+
private_key: "ab236cfe4a195f0226bc2e674afdd6b0",
|
67
|
+
private_key_password: "[your GPG private key password]"
|
68
|
+
)
|
69
|
+
```
|
70
|
+
|
71
|
+
### Parameters
|
72
|
+
|
73
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
74
|
+
* `name` (string): Required - Your GPG key name.
|
75
|
+
* `public_key` (string): Your GPG public key
|
76
|
+
* `private_key` (string): Your GPG private key.
|
77
|
+
* `private_key_password` (string): Your GPG private key password. Only required for password protected keys.
|
78
|
+
|
79
|
+
|
80
|
+
---
|
81
|
+
|
82
|
+
## Update Gpg Key
|
83
|
+
|
84
|
+
```
|
85
|
+
Files::GpgKey.update(id,
|
86
|
+
name: "key name",
|
87
|
+
public_key: "7f8bc1210b09b9ddf469e6b6b8920e76",
|
88
|
+
private_key: "ab236cfe4a195f0226bc2e674afdd6b0",
|
89
|
+
private_key_password: "[your GPG private key password]"
|
90
|
+
)
|
91
|
+
```
|
92
|
+
|
93
|
+
### Parameters
|
94
|
+
|
95
|
+
* `id` (int64): Required - Gpg Key ID.
|
96
|
+
* `name` (string): Required - Your GPG key name.
|
97
|
+
* `public_key` (string): Your GPG public key
|
98
|
+
* `private_key` (string): Your GPG private key.
|
99
|
+
* `private_key_password` (string): Your GPG private key password. Only required for password protected keys.
|
100
|
+
|
101
|
+
|
102
|
+
---
|
103
|
+
|
104
|
+
## Delete Gpg Key
|
105
|
+
|
106
|
+
```
|
107
|
+
Files::GpgKey.delete(id)
|
108
|
+
```
|
109
|
+
|
110
|
+
### Parameters
|
111
|
+
|
112
|
+
* `id` (int64): Required - Gpg Key ID.
|
113
|
+
|
114
|
+
|
115
|
+
---
|
116
|
+
|
117
|
+
## Update Gpg Key
|
118
|
+
|
119
|
+
```
|
120
|
+
gpg_key = Files::GpgKey.list.first
|
121
|
+
|
122
|
+
gpg_key.update(
|
123
|
+
name: "key name",
|
124
|
+
public_key: "7f8bc1210b09b9ddf469e6b6b8920e76",
|
125
|
+
private_key: "ab236cfe4a195f0226bc2e674afdd6b0",
|
126
|
+
private_key_password: "[your GPG private key password]"
|
127
|
+
)
|
128
|
+
```
|
129
|
+
|
130
|
+
### Parameters
|
131
|
+
|
132
|
+
* `id` (int64): Required - Gpg Key ID.
|
133
|
+
* `name` (string): Required - Your GPG key name.
|
134
|
+
* `public_key` (string): Your GPG public key
|
135
|
+
* `private_key` (string): Your GPG private key.
|
136
|
+
* `private_key_password` (string): Your GPG private key password. Only required for password protected keys.
|
137
|
+
|
138
|
+
|
139
|
+
---
|
140
|
+
|
141
|
+
## Delete Gpg Key
|
142
|
+
|
143
|
+
```
|
144
|
+
gpg_key = Files::GpgKey.list.first
|
145
|
+
|
146
|
+
gpg_key.delete
|
147
|
+
```
|
148
|
+
|
149
|
+
### Parameters
|
150
|
+
|
151
|
+
* `id` (int64): Required - Gpg Key ID.
|
@@ -0,0 +1,204 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class GpgKey
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# int64 - Your GPG key ID.
|
13
|
+
def id
|
14
|
+
@attributes[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
def id=(value)
|
18
|
+
@attributes[:id] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# date-time - Your GPG key expiration date.
|
22
|
+
def expires_at
|
23
|
+
@attributes[:expires_at]
|
24
|
+
end
|
25
|
+
|
26
|
+
def expires_at=(value)
|
27
|
+
@attributes[:expires_at] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# string - Your GPG key name.
|
31
|
+
def name
|
32
|
+
@attributes[:name]
|
33
|
+
end
|
34
|
+
|
35
|
+
def name=(value)
|
36
|
+
@attributes[:name] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
# int64 - GPG owner's user id
|
40
|
+
def user_id
|
41
|
+
@attributes[:user_id]
|
42
|
+
end
|
43
|
+
|
44
|
+
def user_id=(value)
|
45
|
+
@attributes[:user_id] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# string - Your GPG public key
|
49
|
+
def public_key
|
50
|
+
@attributes[:public_key]
|
51
|
+
end
|
52
|
+
|
53
|
+
def public_key=(value)
|
54
|
+
@attributes[:public_key] = value
|
55
|
+
end
|
56
|
+
|
57
|
+
# string - Your GPG private key.
|
58
|
+
def private_key
|
59
|
+
@attributes[:private_key]
|
60
|
+
end
|
61
|
+
|
62
|
+
def private_key=(value)
|
63
|
+
@attributes[:private_key] = value
|
64
|
+
end
|
65
|
+
|
66
|
+
# string - Your GPG private key password. Only required for password protected keys.
|
67
|
+
def private_key_password
|
68
|
+
@attributes[:private_key_password]
|
69
|
+
end
|
70
|
+
|
71
|
+
def private_key_password=(value)
|
72
|
+
@attributes[:private_key_password] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# Parameters:
|
76
|
+
# name (required) - string - Your GPG key name.
|
77
|
+
# public_key - string - Your GPG public key
|
78
|
+
# private_key - string - Your GPG private key.
|
79
|
+
# private_key_password - string - Your GPG private key password. Only required for password protected keys.
|
80
|
+
def update(params = {})
|
81
|
+
params ||= {}
|
82
|
+
params[:id] = @attributes[:id]
|
83
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
84
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
85
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
86
|
+
raise InvalidParameterError.new("Bad parameter: public_key must be an String") if params[:public_key] and !params[:public_key].is_a?(String)
|
87
|
+
raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params[:private_key] and !params[:private_key].is_a?(String)
|
88
|
+
raise InvalidParameterError.new("Bad parameter: private_key_password must be an String") if params[:private_key_password] and !params[:private_key_password].is_a?(String)
|
89
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
90
|
+
raise MissingParameterError.new("Parameter missing: name") unless params[:name]
|
91
|
+
|
92
|
+
Api.send_request("/gpg_keys/#{@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("/gpg_keys/#{@attributes[:id]}", :delete, params, @options)
|
103
|
+
end
|
104
|
+
|
105
|
+
def destroy(params = {})
|
106
|
+
delete(params)
|
107
|
+
end
|
108
|
+
|
109
|
+
def save
|
110
|
+
if @attributes[:id]
|
111
|
+
update(@attributes)
|
112
|
+
else
|
113
|
+
new_obj = GpgKey.create(@attributes, @options)
|
114
|
+
@attributes = new_obj.attributes
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# Parameters:
|
119
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
120
|
+
# 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
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
122
|
+
def self.list(params = {}, options = {})
|
123
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
|
124
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
125
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
126
|
+
|
127
|
+
List.new(GpgKey, params) do
|
128
|
+
Api.send_request("/gpg_keys", :get, params, options)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def self.all(params = {}, options = {})
|
133
|
+
list(params, options)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Parameters:
|
137
|
+
# id (required) - int64 - Gpg Key ID.
|
138
|
+
def self.find(id, params = {}, options = {})
|
139
|
+
params ||= {}
|
140
|
+
params[:id] = id
|
141
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
142
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
143
|
+
|
144
|
+
response, options = Api.send_request("/gpg_keys/#{params[:id]}", :get, params, options)
|
145
|
+
GpgKey.new(response.data, options)
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.get(id, params = {}, options = {})
|
149
|
+
find(id, params, options)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Parameters:
|
153
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
154
|
+
# name (required) - string - Your GPG key name.
|
155
|
+
# public_key - string - Your GPG public key
|
156
|
+
# private_key - string - Your GPG private key.
|
157
|
+
# private_key_password - string - Your GPG private key password. Only required for password protected keys.
|
158
|
+
def self.create(params = {}, options = {})
|
159
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
|
160
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
161
|
+
raise InvalidParameterError.new("Bad parameter: public_key must be an String") if params[:public_key] and !params[:public_key].is_a?(String)
|
162
|
+
raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params[:private_key] and !params[:private_key].is_a?(String)
|
163
|
+
raise InvalidParameterError.new("Bad parameter: private_key_password must be an String") if params[:private_key_password] and !params[:private_key_password].is_a?(String)
|
164
|
+
raise MissingParameterError.new("Parameter missing: name") unless params[:name]
|
165
|
+
|
166
|
+
response, options = Api.send_request("/gpg_keys", :post, params, options)
|
167
|
+
GpgKey.new(response.data, options)
|
168
|
+
end
|
169
|
+
|
170
|
+
# Parameters:
|
171
|
+
# name (required) - string - Your GPG key name.
|
172
|
+
# public_key - string - Your GPG public key
|
173
|
+
# private_key - string - Your GPG private key.
|
174
|
+
# private_key_password - string - Your GPG private key password. Only required for password protected keys.
|
175
|
+
def self.update(id, params = {}, options = {})
|
176
|
+
params ||= {}
|
177
|
+
params[:id] = id
|
178
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
179
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
180
|
+
raise InvalidParameterError.new("Bad parameter: public_key must be an String") if params[:public_key] and !params[:public_key].is_a?(String)
|
181
|
+
raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params[:private_key] and !params[:private_key].is_a?(String)
|
182
|
+
raise InvalidParameterError.new("Bad parameter: private_key_password must be an String") if params[:private_key_password] and !params[:private_key_password].is_a?(String)
|
183
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
184
|
+
raise MissingParameterError.new("Parameter missing: name") unless params[:name]
|
185
|
+
|
186
|
+
response, options = Api.send_request("/gpg_keys/#{params[:id]}", :patch, params, options)
|
187
|
+
GpgKey.new(response.data, options)
|
188
|
+
end
|
189
|
+
|
190
|
+
def self.delete(id, params = {}, options = {})
|
191
|
+
params ||= {}
|
192
|
+
params[:id] = id
|
193
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
194
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
195
|
+
|
196
|
+
response, _options = Api.send_request("/gpg_keys/#{params[:id]}", :delete, params, options)
|
197
|
+
response.data
|
198
|
+
end
|
199
|
+
|
200
|
+
def self.destroy(id, params = {}, options = {})
|
201
|
+
delete(id, params, options)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
data/lib/files.com/version.rb
CHANGED
data/lib/files.com.rb
CHANGED
@@ -67,6 +67,7 @@ require "files.com/models/file_upload_part"
|
|
67
67
|
require "files.com/models/folder"
|
68
68
|
require "files.com/models/form_field"
|
69
69
|
require "files.com/models/form_field_set"
|
70
|
+
require "files.com/models/gpg_key"
|
70
71
|
require "files.com/models/group"
|
71
72
|
require "files.com/models/group_user"
|
72
73
|
require "files.com/models/history"
|
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.0.
|
4
|
+
version: 1.0.381
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- docs/folder.md
|
151
151
|
- docs/form_field.md
|
152
152
|
- docs/form_field_set.md
|
153
|
+
- docs/gpg_key.md
|
153
154
|
- docs/group.md
|
154
155
|
- docs/group_user.md
|
155
156
|
- docs/history.md
|
@@ -239,6 +240,7 @@ files:
|
|
239
240
|
- lib/files.com/models/folder.rb
|
240
241
|
- lib/files.com/models/form_field.rb
|
241
242
|
- lib/files.com/models/form_field_set.rb
|
243
|
+
- lib/files.com/models/gpg_key.rb
|
242
244
|
- lib/files.com/models/group.rb
|
243
245
|
- lib/files.com/models/group_user.rb
|
244
246
|
- lib/files.com/models/history.rb
|