files.com 1.1.424 → 1.1.425
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 +4 -4
- data/_VERSION +1 -1
- data/docs/key_lifecycle_rule.md +134 -0
- data/lib/files.com/models/key_lifecycle_rule.rb +170 -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: f1aa899b3ef24b3c97cda33710444c22587f077d9405bc428895fc4011525e09
|
|
4
|
+
data.tar.gz: ef47dd4fe033230135af5732e71b28901127ca63787b33185c9052daf82c9dac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 814c0379ba803494be7207df2e2efd19dd28849b22392434682cf10832431f874deb674ec28f643a31b7d9409b5bd03a810731d61c03f94627a4140bbe499019
|
|
7
|
+
data.tar.gz: 97dd1347352397df2f132456b73a2909d4f29b75a9af2b45ef957d58cf0ecc675e721bde1139f191d99e311ddf01dd49793a5c59ea169e19477d3e1ffa463d25
|
data/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1.
|
|
1
|
+
1.1.425
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# KeyLifecycleRule
|
|
2
|
+
|
|
3
|
+
## Example KeyLifecycleRule Object
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{
|
|
7
|
+
"id": 1,
|
|
8
|
+
"key_type": "gpg",
|
|
9
|
+
"inactivity_days": 12,
|
|
10
|
+
"name": "inactive gpg keys"
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* `id` (int64): Key Lifecycle Rule ID
|
|
15
|
+
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
|
|
16
|
+
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
|
|
17
|
+
* `name` (string): Key Lifecycle Rule name
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## List Key Lifecycle Rules
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Files::KeyLifecycleRule.list
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Parameters
|
|
29
|
+
|
|
30
|
+
* `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.
|
|
31
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
32
|
+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Show Key Lifecycle Rule
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Files::KeyLifecycleRule.find(id)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Parameters
|
|
44
|
+
|
|
45
|
+
* `id` (int64): Required - Key Lifecycle Rule ID.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Create Key Lifecycle Rule
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Files::KeyLifecycleRule.create(
|
|
54
|
+
key_type: "gpg",
|
|
55
|
+
inactivity_days: 12,
|
|
56
|
+
name: "inactive gpg keys"
|
|
57
|
+
)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Parameters
|
|
61
|
+
|
|
62
|
+
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
|
|
63
|
+
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
|
|
64
|
+
* `name` (string): Key Lifecycle Rule name
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Update Key Lifecycle Rule
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Files::KeyLifecycleRule.update(id,
|
|
73
|
+
key_type: "gpg",
|
|
74
|
+
inactivity_days: 12,
|
|
75
|
+
name: "inactive gpg keys"
|
|
76
|
+
)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Parameters
|
|
80
|
+
|
|
81
|
+
* `id` (int64): Required - Key Lifecycle Rule ID.
|
|
82
|
+
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
|
|
83
|
+
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
|
|
84
|
+
* `name` (string): Key Lifecycle Rule name
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Delete Key Lifecycle Rule
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Files::KeyLifecycleRule.delete(id)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Parameters
|
|
96
|
+
|
|
97
|
+
* `id` (int64): Required - Key Lifecycle Rule ID.
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Update Key Lifecycle Rule
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
key_lifecycle_rule = Files::KeyLifecycleRule.find(id)
|
|
106
|
+
|
|
107
|
+
key_lifecycle_rule.update(
|
|
108
|
+
key_type: "gpg",
|
|
109
|
+
inactivity_days: 12,
|
|
110
|
+
name: "inactive gpg keys"
|
|
111
|
+
)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Parameters
|
|
115
|
+
|
|
116
|
+
* `id` (int64): Required - Key Lifecycle Rule ID.
|
|
117
|
+
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
|
|
118
|
+
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
|
|
119
|
+
* `name` (string): Key Lifecycle Rule name
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Delete Key Lifecycle Rule
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
key_lifecycle_rule = Files::KeyLifecycleRule.find(id)
|
|
128
|
+
|
|
129
|
+
key_lifecycle_rule.delete
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Parameters
|
|
133
|
+
|
|
134
|
+
* `id` (int64): Required - Key Lifecycle Rule ID.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Files
|
|
4
|
+
class KeyLifecycleRule
|
|
5
|
+
attr_reader :options, :attributes
|
|
6
|
+
|
|
7
|
+
def initialize(attributes = {}, options = {})
|
|
8
|
+
@attributes = attributes || {}
|
|
9
|
+
@options = options || {}
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# int64 - Key Lifecycle Rule ID
|
|
13
|
+
def id
|
|
14
|
+
@attributes[:id]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def id=(value)
|
|
18
|
+
@attributes[:id] = value
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# string - Key type for which the rule will apply (gpg or ssh).
|
|
22
|
+
def key_type
|
|
23
|
+
@attributes[:key_type]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def key_type=(value)
|
|
27
|
+
@attributes[:key_type] = value
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# int64 - Number of days of inactivity before the rule applies.
|
|
31
|
+
def inactivity_days
|
|
32
|
+
@attributes[:inactivity_days]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def inactivity_days=(value)
|
|
36
|
+
@attributes[:inactivity_days] = value
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# string - Key Lifecycle Rule name
|
|
40
|
+
def name
|
|
41
|
+
@attributes[:name]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def name=(value)
|
|
45
|
+
@attributes[:name] = value
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Parameters:
|
|
49
|
+
# key_type - string - Key type for which the rule will apply (gpg or ssh).
|
|
50
|
+
# inactivity_days - int64 - Number of days of inactivity before the rule applies.
|
|
51
|
+
# name - string - Key Lifecycle Rule name
|
|
52
|
+
def update(params = {})
|
|
53
|
+
params ||= {}
|
|
54
|
+
params[:id] = @attributes[:id]
|
|
55
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
56
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
57
|
+
raise InvalidParameterError.new("Bad parameter: key_type must be an String") if params[:key_type] and !params[:key_type].is_a?(String)
|
|
58
|
+
raise InvalidParameterError.new("Bad parameter: inactivity_days must be an Integer") if params[:inactivity_days] and !params[:inactivity_days].is_a?(Integer)
|
|
59
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
60
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
61
|
+
|
|
62
|
+
Api.send_request("/key_lifecycle_rules/#{@attributes[:id]}", :patch, params, @options)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def delete(params = {})
|
|
66
|
+
params ||= {}
|
|
67
|
+
params[:id] = @attributes[:id]
|
|
68
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
69
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
70
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
71
|
+
|
|
72
|
+
Api.send_request("/key_lifecycle_rules/#{@attributes[:id]}", :delete, params, @options)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def destroy(params = {})
|
|
76
|
+
delete(params)
|
|
77
|
+
nil
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def save
|
|
81
|
+
if @attributes[:id]
|
|
82
|
+
new_obj = update(@attributes)
|
|
83
|
+
else
|
|
84
|
+
new_obj = KeyLifecycleRule.create(@attributes, @options)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
@attributes = new_obj.attributes
|
|
88
|
+
true
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Parameters:
|
|
92
|
+
# 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.
|
|
93
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
94
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
95
|
+
def self.list(params = {}, options = {})
|
|
96
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
97
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
98
|
+
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
|
99
|
+
|
|
100
|
+
List.new(KeyLifecycleRule, params) do
|
|
101
|
+
Api.send_request("/key_lifecycle_rules", :get, params, options)
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def self.all(params = {}, options = {})
|
|
106
|
+
list(params, options)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Parameters:
|
|
110
|
+
# id (required) - int64 - Key Lifecycle Rule ID.
|
|
111
|
+
def self.find(id, params = {}, options = {})
|
|
112
|
+
params ||= {}
|
|
113
|
+
params[:id] = id
|
|
114
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
115
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
116
|
+
|
|
117
|
+
response, options = Api.send_request("/key_lifecycle_rules/#{params[:id]}", :get, params, options)
|
|
118
|
+
KeyLifecycleRule.new(response.data, options)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def self.get(id, params = {}, options = {})
|
|
122
|
+
find(id, params, options)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Parameters:
|
|
126
|
+
# key_type - string - Key type for which the rule will apply (gpg or ssh).
|
|
127
|
+
# inactivity_days - int64 - Number of days of inactivity before the rule applies.
|
|
128
|
+
# name - string - Key Lifecycle Rule name
|
|
129
|
+
def self.create(params = {}, options = {})
|
|
130
|
+
raise InvalidParameterError.new("Bad parameter: key_type must be an String") if params[:key_type] and !params[:key_type].is_a?(String)
|
|
131
|
+
raise InvalidParameterError.new("Bad parameter: inactivity_days must be an Integer") if params[:inactivity_days] and !params[:inactivity_days].is_a?(Integer)
|
|
132
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
133
|
+
|
|
134
|
+
response, options = Api.send_request("/key_lifecycle_rules", :post, params, options)
|
|
135
|
+
KeyLifecycleRule.new(response.data, options)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Parameters:
|
|
139
|
+
# key_type - string - Key type for which the rule will apply (gpg or ssh).
|
|
140
|
+
# inactivity_days - int64 - Number of days of inactivity before the rule applies.
|
|
141
|
+
# name - string - Key Lifecycle Rule name
|
|
142
|
+
def self.update(id, params = {}, options = {})
|
|
143
|
+
params ||= {}
|
|
144
|
+
params[:id] = id
|
|
145
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
146
|
+
raise InvalidParameterError.new("Bad parameter: key_type must be an String") if params[:key_type] and !params[:key_type].is_a?(String)
|
|
147
|
+
raise InvalidParameterError.new("Bad parameter: inactivity_days must be an Integer") if params[:inactivity_days] and !params[:inactivity_days].is_a?(Integer)
|
|
148
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
149
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
150
|
+
|
|
151
|
+
response, options = Api.send_request("/key_lifecycle_rules/#{params[:id]}", :patch, params, options)
|
|
152
|
+
KeyLifecycleRule.new(response.data, options)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def self.delete(id, params = {}, options = {})
|
|
156
|
+
params ||= {}
|
|
157
|
+
params[:id] = id
|
|
158
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
159
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
160
|
+
|
|
161
|
+
Api.send_request("/key_lifecycle_rules/#{params[:id]}", :delete, params, options)
|
|
162
|
+
nil
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def self.destroy(id, params = {}, options = {})
|
|
166
|
+
delete(id, params, options)
|
|
167
|
+
nil
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
data/lib/files.com/version.rb
CHANGED
data/lib/files.com.rb
CHANGED
|
@@ -91,6 +91,7 @@ require "files.com/models/inbox_upload"
|
|
|
91
91
|
require "files.com/models/invoice"
|
|
92
92
|
require "files.com/models/invoice_line_item"
|
|
93
93
|
require "files.com/models/ip_address"
|
|
94
|
+
require "files.com/models/key_lifecycle_rule"
|
|
94
95
|
require "files.com/models/lock"
|
|
95
96
|
require "files.com/models/message"
|
|
96
97
|
require "files.com/models/message_comment"
|
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.
|
|
4
|
+
version: 1.1.425
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- files.com
|
|
@@ -216,6 +216,7 @@ files:
|
|
|
216
216
|
- docs/invoice.md
|
|
217
217
|
- docs/invoice_line_item.md
|
|
218
218
|
- docs/ip_address.md
|
|
219
|
+
- docs/key_lifecycle_rule.md
|
|
219
220
|
- docs/lock.md
|
|
220
221
|
- docs/message.md
|
|
221
222
|
- docs/message_comment.md
|
|
@@ -333,6 +334,7 @@ files:
|
|
|
333
334
|
- lib/files.com/models/invoice.rb
|
|
334
335
|
- lib/files.com/models/invoice_line_item.rb
|
|
335
336
|
- lib/files.com/models/ip_address.rb
|
|
337
|
+
- lib/files.com/models/key_lifecycle_rule.rb
|
|
336
338
|
- lib/files.com/models/lock.rb
|
|
337
339
|
- lib/files.com/models/message.rb
|
|
338
340
|
- lib/files.com/models/message_comment.rb
|