files.com 1.1.673 → 1.1.675

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.
@@ -0,0 +1,220 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class Secret
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Secret ID.
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ def id=(value)
18
+ @attributes[:id] = value
19
+ end
20
+
21
+ # int64 - Workspace ID. 0 means the default workspace.
22
+ def workspace_id
23
+ @attributes[:workspace_id]
24
+ end
25
+
26
+ def workspace_id=(value)
27
+ @attributes[:workspace_id] = value
28
+ end
29
+
30
+ # string - Secret name.
31
+ def name
32
+ @attributes[:name]
33
+ end
34
+
35
+ def name=(value)
36
+ @attributes[:name] = value
37
+ end
38
+
39
+ # string - Internal description for your reference.
40
+ def description
41
+ @attributes[:description]
42
+ end
43
+
44
+ def description=(value)
45
+ @attributes[:description] = value
46
+ end
47
+
48
+ # string - Secret type.
49
+ def secret_type
50
+ @attributes[:secret_type]
51
+ end
52
+
53
+ def secret_type=(value)
54
+ @attributes[:secret_type] = value
55
+ end
56
+
57
+ # object - Non-secret metadata for the Secret type.
58
+ def metadata
59
+ @attributes[:metadata]
60
+ end
61
+
62
+ def metadata=(value)
63
+ @attributes[:metadata] = value
64
+ end
65
+
66
+ # array(string) - Names of configured secret value fields. Secret values are never returned.
67
+ def value_field_names
68
+ @attributes[:value_field_names]
69
+ end
70
+
71
+ def value_field_names=(value)
72
+ @attributes[:value_field_names] = value
73
+ end
74
+
75
+ # date-time - Secret create date/time.
76
+ def created_at
77
+ @attributes[:created_at]
78
+ end
79
+
80
+ # date-time - Secret update date/time.
81
+ def updated_at
82
+ @attributes[:updated_at]
83
+ end
84
+
85
+ # Parameters:
86
+ # name - string - Secret name.
87
+ # description - string - Internal description for your reference.
88
+ # secret_type - string - Secret type.
89
+ # metadata - object - Non-secret metadata for the Secret type.
90
+ def update(params = {})
91
+ params ||= {}
92
+ params[:id] = @attributes[:id]
93
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
94
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
95
+ raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
96
+ raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
97
+ raise InvalidParameterError.new("Bad parameter: secret_type must be an String") if params[:secret_type] and !params[:secret_type].is_a?(String)
98
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
99
+
100
+ Api.send_request("/secrets/#{@attributes[:id]}", :patch, params, @options)
101
+ end
102
+
103
+ def delete(params = {})
104
+ params ||= {}
105
+ params[:id] = @attributes[:id]
106
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
107
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
108
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
109
+
110
+ Api.send_request("/secrets/#{@attributes[:id]}", :delete, params, @options)
111
+ end
112
+
113
+ def destroy(params = {})
114
+ delete(params)
115
+ nil
116
+ end
117
+
118
+ def save
119
+ if @attributes[:id]
120
+ new_obj = update(@attributes)
121
+ else
122
+ new_obj = Secret.create(@attributes, @options)
123
+ end
124
+
125
+ @attributes = new_obj.attributes
126
+ true
127
+ end
128
+
129
+ # Parameters:
130
+ # 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.
131
+ # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
132
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `name` or `secret_type`.
133
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`, `name` or `secret_type`. Valid field combinations are `[ workspace_id, name ]`, `[ workspace_id, secret_type ]`, `[ secret_type, name ]` or `[ workspace_id, secret_type, name ]`.
134
+ # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
135
+ def self.list(params = {}, options = {})
136
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
137
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
138
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
139
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
140
+ raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
141
+
142
+ List.new(Secret, params) do
143
+ Api.send_request("/secrets", :get, params, options)
144
+ end
145
+ end
146
+
147
+ def self.all(params = {}, options = {})
148
+ list(params, options)
149
+ end
150
+
151
+ # Parameters:
152
+ # id (required) - int64 - Secret ID.
153
+ def self.find(id, params = {}, options = {})
154
+ params ||= {}
155
+ params[:id] = id
156
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
157
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
158
+
159
+ response, options = Api.send_request("/secrets/#{params[:id]}", :get, params, options)
160
+ Secret.new(response.data, options)
161
+ end
162
+
163
+ def self.get(id, params = {}, options = {})
164
+ find(id, params, options)
165
+ end
166
+
167
+ # Parameters:
168
+ # name (required) - string - Secret name.
169
+ # description - string - Internal description for your reference.
170
+ # secret_type (required) - string - Secret type.
171
+ # metadata - object - Non-secret metadata for the Secret type.
172
+ # workspace_id - int64 - Workspace ID. 0 means the default workspace.
173
+ def self.create(params = {}, options = {})
174
+ raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
175
+ raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
176
+ raise InvalidParameterError.new("Bad parameter: secret_type must be an String") if params[:secret_type] and !params[:secret_type].is_a?(String)
177
+ raise InvalidParameterError.new("Bad parameter: metadata must be an Hash") if params[:metadata] and !params[:metadata].is_a?(Hash)
178
+ raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
179
+ raise MissingParameterError.new("Parameter missing: name") unless params[:name]
180
+ raise MissingParameterError.new("Parameter missing: secret_type") unless params[:secret_type]
181
+
182
+ response, options = Api.send_request("/secrets", :post, params, options)
183
+ Secret.new(response.data, options)
184
+ end
185
+
186
+ # Parameters:
187
+ # name - string - Secret name.
188
+ # description - string - Internal description for your reference.
189
+ # secret_type - string - Secret type.
190
+ # metadata - object - Non-secret metadata for the Secret type.
191
+ def self.update(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 InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
196
+ raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
197
+ raise InvalidParameterError.new("Bad parameter: secret_type must be an String") if params[:secret_type] and !params[:secret_type].is_a?(String)
198
+ raise InvalidParameterError.new("Bad parameter: metadata must be an Hash") if params[:metadata] and !params[:metadata].is_a?(Hash)
199
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
200
+
201
+ response, options = Api.send_request("/secrets/#{params[:id]}", :patch, params, options)
202
+ Secret.new(response.data, options)
203
+ end
204
+
205
+ def self.delete(id, params = {}, options = {})
206
+ params ||= {}
207
+ params[:id] = id
208
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
209
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
210
+
211
+ Api.send_request("/secrets/#{params[:id]}", :delete, params, options)
212
+ nil
213
+ end
214
+
215
+ def self.destroy(id, params = {}, options = {})
216
+ delete(id, params, options)
217
+ nil
218
+ end
219
+ end
220
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.673"
4
+ VERSION = "1.1.675"
5
5
  end
data/lib/files.com.rb CHANGED
@@ -117,6 +117,7 @@ require "files.com/models/notification"
117
117
  require "files.com/models/outbound_connection_log"
118
118
  require "files.com/models/partner"
119
119
  require "files.com/models/partner_channel"
120
+ require "files.com/models/partner_channel_template"
120
121
  require "files.com/models/partner_site"
121
122
  require "files.com/models/partner_site_request"
122
123
  require "files.com/models/payment"
@@ -137,6 +138,7 @@ require "files.com/models/request"
137
138
  require "files.com/models/restore"
138
139
  require "files.com/models/scheduled_export"
139
140
  require "files.com/models/scim_log"
141
+ require "files.com/models/secret"
140
142
  require "files.com/models/session"
141
143
  require "files.com/models/settings_change"
142
144
  require "files.com/models/sftp_action_log"
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.1.673
4
+ version: 1.1.675
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-07 00:00:00.000000000 Z
11
+ date: 2026-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -256,6 +256,7 @@ files:
256
256
  - docs/outbound_connection_log.md
257
257
  - docs/partner.md
258
258
  - docs/partner_channel.md
259
+ - docs/partner_channel_template.md
259
260
  - docs/partner_site.md
260
261
  - docs/partner_site_request.md
261
262
  - docs/payment.md
@@ -276,6 +277,7 @@ files:
276
277
  - docs/restore.md
277
278
  - docs/scheduled_export.md
278
279
  - docs/scim_log.md
280
+ - docs/secret.md
279
281
  - docs/session.md
280
282
  - docs/settings_change.md
281
283
  - docs/sftp_action_log.md
@@ -401,6 +403,7 @@ files:
401
403
  - lib/files.com/models/outbound_connection_log.rb
402
404
  - lib/files.com/models/partner.rb
403
405
  - lib/files.com/models/partner_channel.rb
406
+ - lib/files.com/models/partner_channel_template.rb
404
407
  - lib/files.com/models/partner_site.rb
405
408
  - lib/files.com/models/partner_site_request.rb
406
409
  - lib/files.com/models/payment.rb
@@ -421,6 +424,7 @@ files:
421
424
  - lib/files.com/models/restore.rb
422
425
  - lib/files.com/models/scheduled_export.rb
423
426
  - lib/files.com/models/scim_log.rb
427
+ - lib/files.com/models/secret.rb
424
428
  - lib/files.com/models/session.rb
425
429
  - lib/files.com/models/settings_change.rb
426
430
  - lib/files.com/models/sftp_action_log.rb