files.com 1.0.34 → 1.0.35
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/as2_key.md +131 -0
- data/lib/files.com.rb +1 -0
- data/lib/files.com/models/as2_key.rb +176 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19e707f4959f4ff9e8ce51199325bb0a3ecd91570dd5fcc4eabb5cac5ee39467
|
4
|
+
data.tar.gz: 47767a543fa853985ebd8cb03573331027a17dfefb1778558e9e617b881e22c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccedd2cfd8b6f4eb234eec5288686c1aba531f07625d2e21d10e4ddac589498fd6397760f7872f332d28903ce9112ab4260174ed658122c46e41c066685395f3
|
7
|
+
data.tar.gz: a477ed676cd337a577e26c1e696c7477a5da44605901296403eb8d4f05c0864e18e3a8dd51fbd5a5fe5fc9b8114b726995c51622b5d48bd0111dc046883e3eb6
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.35
|
data/docs/as2_key.md
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
# As2Key
|
2
|
+
|
3
|
+
## Example As2Key Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"id": 1,
|
8
|
+
"as2_partnership_name": "Test",
|
9
|
+
"created_at": "2000-01-01T01:00:00Z",
|
10
|
+
"fingerprint": "cf:cb:d3:26:52:6c:55:88:83:17:13:cf:e7:70:eb:1b:32:37:38:c0"
|
11
|
+
}
|
12
|
+
```
|
13
|
+
|
14
|
+
* `id` (int64): AS2 Key ID
|
15
|
+
* `as2_partnership_name` (string): AS2 Partnership Name
|
16
|
+
* `created_at` (date-time): AS2 Key created at date/time
|
17
|
+
* `fingerprint` (string): Public key fingerprint
|
18
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
19
|
+
* `public_key` (string): Actual contents of Public key.
|
20
|
+
|
21
|
+
|
22
|
+
---
|
23
|
+
|
24
|
+
## List As2 Keys
|
25
|
+
|
26
|
+
```
|
27
|
+
Files::As2Key.list(
|
28
|
+
user_id: 1,
|
29
|
+
page: 1,
|
30
|
+
per_page: 1
|
31
|
+
)
|
32
|
+
```
|
33
|
+
|
34
|
+
### Parameters
|
35
|
+
|
36
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
37
|
+
* `page` (int64): Current page number.
|
38
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
39
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
40
|
+
|
41
|
+
|
42
|
+
---
|
43
|
+
|
44
|
+
## Show As2 Key
|
45
|
+
|
46
|
+
```
|
47
|
+
Files::As2Key.find(id)
|
48
|
+
```
|
49
|
+
|
50
|
+
### Parameters
|
51
|
+
|
52
|
+
* `id` (int64): Required - As2 Key ID.
|
53
|
+
|
54
|
+
|
55
|
+
---
|
56
|
+
|
57
|
+
## Create As2 Key
|
58
|
+
|
59
|
+
```
|
60
|
+
Files::As2Key.create(
|
61
|
+
user_id: 1,
|
62
|
+
as2_partnership_name: "Test",
|
63
|
+
public_key: "public_key"
|
64
|
+
)
|
65
|
+
```
|
66
|
+
|
67
|
+
### Parameters
|
68
|
+
|
69
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
70
|
+
* `as2_partnership_name` (string): Required - AS2 Partnership Name
|
71
|
+
* `public_key` (string): Required - Actual contents of Public key.
|
72
|
+
|
73
|
+
|
74
|
+
---
|
75
|
+
|
76
|
+
## Update As2 Key
|
77
|
+
|
78
|
+
```
|
79
|
+
Files::As2Key.update(id,
|
80
|
+
as2_partnership_name: "Test"
|
81
|
+
)
|
82
|
+
```
|
83
|
+
|
84
|
+
### Parameters
|
85
|
+
|
86
|
+
* `id` (int64): Required - As2 Key ID.
|
87
|
+
* `as2_partnership_name` (string): Required - AS2 Partnership Name
|
88
|
+
|
89
|
+
|
90
|
+
---
|
91
|
+
|
92
|
+
## Delete As2 Key
|
93
|
+
|
94
|
+
```
|
95
|
+
Files::As2Key.delete(id)
|
96
|
+
```
|
97
|
+
|
98
|
+
### Parameters
|
99
|
+
|
100
|
+
* `id` (int64): Required - As2 Key ID.
|
101
|
+
|
102
|
+
|
103
|
+
---
|
104
|
+
|
105
|
+
## Update As2 Key
|
106
|
+
|
107
|
+
```
|
108
|
+
as2_key = Files::As2Key.find(1)
|
109
|
+
as2_key.update(
|
110
|
+
as2_partnership_name: "Test"
|
111
|
+
)
|
112
|
+
```
|
113
|
+
|
114
|
+
### Parameters
|
115
|
+
|
116
|
+
* `id` (int64): Required - As2 Key ID.
|
117
|
+
* `as2_partnership_name` (string): Required - AS2 Partnership Name
|
118
|
+
|
119
|
+
|
120
|
+
---
|
121
|
+
|
122
|
+
## Delete As2 Key
|
123
|
+
|
124
|
+
```
|
125
|
+
as2_key = Files::As2Key.find(1)
|
126
|
+
as2_key.delete
|
127
|
+
```
|
128
|
+
|
129
|
+
### Parameters
|
130
|
+
|
131
|
+
* `id` (int64): Required - As2 Key ID.
|
data/lib/files.com.rb
CHANGED
@@ -27,6 +27,7 @@ require "files.com/list"
|
|
27
27
|
require "files.com/models/account_line_item"
|
28
28
|
require "files.com/models/action"
|
29
29
|
require "files.com/models/api_key"
|
30
|
+
require "files.com/models/as2_key"
|
30
31
|
require "files.com/models/auto"
|
31
32
|
require "files.com/models/automation"
|
32
33
|
require "files.com/models/behavior"
|
@@ -0,0 +1,176 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class As2Key
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# int64 - AS2 Key ID
|
13
|
+
def id
|
14
|
+
@attributes[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
def id=(value)
|
18
|
+
@attributes[:id] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# string - AS2 Partnership Name
|
22
|
+
def as2_partnership_name
|
23
|
+
@attributes[:as2_partnership_name]
|
24
|
+
end
|
25
|
+
|
26
|
+
def as2_partnership_name=(value)
|
27
|
+
@attributes[:as2_partnership_name] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# date-time - AS2 Key created at date/time
|
31
|
+
def created_at
|
32
|
+
@attributes[:created_at]
|
33
|
+
end
|
34
|
+
|
35
|
+
# string - Public key fingerprint
|
36
|
+
def fingerprint
|
37
|
+
@attributes[:fingerprint]
|
38
|
+
end
|
39
|
+
|
40
|
+
def fingerprint=(value)
|
41
|
+
@attributes[:fingerprint] = value
|
42
|
+
end
|
43
|
+
|
44
|
+
# int64 - User ID. Provide a value of `0` to operate the current session's user.
|
45
|
+
def user_id
|
46
|
+
@attributes[:user_id]
|
47
|
+
end
|
48
|
+
|
49
|
+
def user_id=(value)
|
50
|
+
@attributes[:user_id] = value
|
51
|
+
end
|
52
|
+
|
53
|
+
# string - Actual contents of Public key.
|
54
|
+
def public_key
|
55
|
+
@attributes[:public_key]
|
56
|
+
end
|
57
|
+
|
58
|
+
def public_key=(value)
|
59
|
+
@attributes[:public_key] = value
|
60
|
+
end
|
61
|
+
|
62
|
+
# Parameters:
|
63
|
+
# as2_partnership_name (required) - string - AS2 Partnership Name
|
64
|
+
def update(params = {})
|
65
|
+
params ||= {}
|
66
|
+
params[:id] = @attributes[:id]
|
67
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
68
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
69
|
+
raise InvalidParameterError.new("Bad parameter: as2_partnership_name must be an String") if params.dig(:as2_partnership_name) and !params.dig(:as2_partnership_name).is_a?(String)
|
70
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
71
|
+
raise MissingParameterError.new("Parameter missing: as2_partnership_name") unless params.dig(:as2_partnership_name)
|
72
|
+
|
73
|
+
Api.send_request("/as2_keys/#{@attributes[:id]}", :patch, params, @options)
|
74
|
+
end
|
75
|
+
|
76
|
+
def delete(params = {})
|
77
|
+
params ||= {}
|
78
|
+
params[:id] = @attributes[:id]
|
79
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
80
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
81
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
82
|
+
|
83
|
+
Api.send_request("/as2_keys/#{@attributes[:id]}", :delete, params, @options)
|
84
|
+
end
|
85
|
+
|
86
|
+
def destroy(params = {})
|
87
|
+
delete(params)
|
88
|
+
end
|
89
|
+
|
90
|
+
def save
|
91
|
+
if @attributes[:id]
|
92
|
+
update(@attributes)
|
93
|
+
else
|
94
|
+
new_obj = As2Key.create(@attributes, @options)
|
95
|
+
@attributes = new_obj.attributes
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Parameters:
|
100
|
+
# user_id - integer - User ID. Provide a value of `0` to operate the current session's user.
|
101
|
+
# page - integer - Current page number.
|
102
|
+
# per_page - integer - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
103
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
104
|
+
def self.list(params = {}, options = {})
|
105
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
106
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
107
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
108
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
109
|
+
|
110
|
+
response, options = Api.send_request("/as2_keys", :get, params, options)
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.all(params = {}, options = {})
|
114
|
+
list(params, options)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Parameters:
|
118
|
+
# id (required) - integer - As2 Key ID.
|
119
|
+
def self.find(id, params = {}, options = {})
|
120
|
+
params ||= {}
|
121
|
+
params[:id] = id
|
122
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
123
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
124
|
+
|
125
|
+
response, options = Api.send_request("/as2_keys/#{params[:id]}", :get, params, options)
|
126
|
+
As2Key.new(response.data, options)
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.get(id, params = {}, options = {})
|
130
|
+
find(id, params, options)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Parameters:
|
134
|
+
# user_id - integer - User ID. Provide a value of `0` to operate the current session's user.
|
135
|
+
# as2_partnership_name (required) - string - AS2 Partnership Name
|
136
|
+
# public_key (required) - string - Actual contents of Public key.
|
137
|
+
def self.create(params = {}, options = {})
|
138
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
139
|
+
raise InvalidParameterError.new("Bad parameter: as2_partnership_name must be an String") if params.dig(:as2_partnership_name) and !params.dig(:as2_partnership_name).is_a?(String)
|
140
|
+
raise InvalidParameterError.new("Bad parameter: public_key must be an String") if params.dig(:public_key) and !params.dig(:public_key).is_a?(String)
|
141
|
+
raise MissingParameterError.new("Parameter missing: as2_partnership_name") unless params.dig(:as2_partnership_name)
|
142
|
+
raise MissingParameterError.new("Parameter missing: public_key") unless params.dig(:public_key)
|
143
|
+
|
144
|
+
response, options = Api.send_request("/as2_keys", :post, params, options)
|
145
|
+
As2Key.new(response.data, options)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Parameters:
|
149
|
+
# as2_partnership_name (required) - string - AS2 Partnership Name
|
150
|
+
def self.update(id, params = {}, options = {})
|
151
|
+
params ||= {}
|
152
|
+
params[:id] = id
|
153
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
154
|
+
raise InvalidParameterError.new("Bad parameter: as2_partnership_name must be an String") if params.dig(:as2_partnership_name) and !params.dig(:as2_partnership_name).is_a?(String)
|
155
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
156
|
+
raise MissingParameterError.new("Parameter missing: as2_partnership_name") unless params.dig(:as2_partnership_name)
|
157
|
+
|
158
|
+
response, options = Api.send_request("/as2_keys/#{params[:id]}", :patch, params, options)
|
159
|
+
As2Key.new(response.data, options)
|
160
|
+
end
|
161
|
+
|
162
|
+
def self.delete(id, params = {}, options = {})
|
163
|
+
params ||= {}
|
164
|
+
params[:id] = id
|
165
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
166
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
167
|
+
|
168
|
+
response, _options = Api.send_request("/as2_keys/#{params[:id]}", :delete, params, options)
|
169
|
+
response.data
|
170
|
+
end
|
171
|
+
|
172
|
+
def self.destroy(id, params = {}, options = {})
|
173
|
+
delete(id, params, options)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
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.
|
4
|
+
version: 1.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- docs/action.md
|
76
76
|
- docs/announcement.md
|
77
77
|
- docs/api_key.md
|
78
|
+
- docs/as2_key.md
|
78
79
|
- docs/auto.md
|
79
80
|
- docs/automation.md
|
80
81
|
- docs/behavior.md
|
@@ -158,6 +159,7 @@ files:
|
|
158
159
|
- lib/files.com/models/action.rb
|
159
160
|
- lib/files.com/models/announcement.rb
|
160
161
|
- lib/files.com/models/api_key.rb
|
162
|
+
- lib/files.com/models/as2_key.rb
|
161
163
|
- lib/files.com/models/auto.rb
|
162
164
|
- lib/files.com/models/automation.rb
|
163
165
|
- lib/files.com/models/behavior.rb
|