files.com 1.1.673 → 1.1.674

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: 2c0f447b5e7b8543176cf0015a4faeb255fa1dcbcbc851c99c315ae8790ec10c
4
- data.tar.gz: 84cbfcdb04f041ee2f8066c5ae5ce20f0976cfd50ef025541a0601d083b87dac
3
+ metadata.gz: dfac253ada1c524557191c3ef8d512141f29e74ec07c3b99f16e5d545e43d92e
4
+ data.tar.gz: 1ccf4f0f1e882b9e33e444155c3c4c8f5db18b3cbc5ee258445912b4756eaf4e
5
5
  SHA512:
6
- metadata.gz: a13395a04d8e6610d4270134ef6dfd441f60e4649f276781593b41048b61b3ebd6fda4f1ca7cca53be0f03851ffcc70c1b40ff5b3139cb546a56baca2b22a002
7
- data.tar.gz: 000737fb292996b739973ede951603d43b19548f80c4bbca286c8ee12f2730341c298f3532624c3f782f33e683000748178ba31dd8239f215ce025eb65033de6
6
+ metadata.gz: 7f4d0e3ab1661ea668dd192b0c0d0b85fa5f642ac28841f6b8b4f44c032c7ad10a52d3df00b042d011cebc2aab52ad8336e688b76a784e98c5b4e5f3632c922e
7
+ data.tar.gz: 4c0c048f5a1a5449b9d80d1ea24f7e6c8409b717bd84887d4c1ab7759bc6522681add1251b8d9512fa2f75ac2e9ef65f84ebe227faf548946c3d60d25adf9b14
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.673
1
+ 1.1.674
data/docs/behavior.md CHANGED
@@ -13,6 +13,7 @@
13
13
  "value": {
14
14
  "method": "GET"
15
15
  },
16
+ "public_hosting_url": "example",
16
17
  "disable_parent_folder_behavior": true,
17
18
  "recursive": true
18
19
  }
@@ -25,6 +26,7 @@
25
26
  * `name` (string): Name for this behavior.
26
27
  * `description` (string): Description for this behavior.
27
28
  * `value` (object): Settings for this behavior. See the section above for an example value to provide here. Formatting is different for each Behavior type. May be sent as nested JSON or a single JSON-encoded string. If using XML encoding for the API call, this data must be sent as a JSON-encoded string.
29
+ * `public_hosting_url` (string): Public URL for this publicly hosted folder when the `Serve Publicly` behavior has a key configured. When a Custom Domain with `public_hosting` destination is attached to this behavior, the URL uses that domain. Otherwise it uses the site's `subdomain.hosted-by-files.com` host.
28
30
  * `disable_parent_folder_behavior` (boolean): If true, the parent folder's behavior will be disabled for this folder and its children.
29
31
  * `recursive` (boolean): Whether this behavior is recursive for this record. `always` behaviors are always `true`, `never` behaviors are always `false`, and `sometimes` behaviors may be either value.
30
32
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the `watermark` behavior requires a watermark image. Attach that file here.
@@ -18,11 +18,11 @@
18
18
 
19
19
  * `id` (int64): Custom Domain ID.
20
20
  * `domain` (string): Customer-owned domain name.
21
- * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
21
+ * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
22
22
  * `dns_status` (string): Current DNS verification status.
23
23
  * `ssl_certificate_id` (int64): Current SSL certificate ID.
24
24
  * `brick_managed` (boolean): Is this domain's SSL certificate automatically managed and renewed by Files.com?
25
- * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
25
+ * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
26
26
  * `created_at` (date-time): When this Custom Domain was created.
27
27
  * `updated_at` (date-time): When this Custom Domain was last updated.
28
28
 
@@ -70,8 +70,8 @@ Files::CustomDomain.create(
70
70
 
71
71
  ### Parameters
72
72
 
73
- * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
74
- * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
73
+ * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
74
+ * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
75
75
  * `ssl_certificate_id` (int64): Current SSL certificate ID.
76
76
  * `domain` (string): Required - Customer-owned domain name.
77
77
 
@@ -92,8 +92,8 @@ Files::CustomDomain.update(id,
92
92
  ### Parameters
93
93
 
94
94
  * `id` (int64): Required - Custom Domain ID.
95
- * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
96
- * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
95
+ * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
96
+ * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
97
97
  * `ssl_certificate_id` (int64): Current SSL certificate ID.
98
98
  * `domain` (string): Customer-owned domain name.
99
99
 
@@ -129,8 +129,8 @@ custom_domain.update(
129
129
  ### Parameters
130
130
 
131
131
  * `id` (int64): Required - Custom Domain ID.
132
- * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
133
- * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
132
+ * `destination` (string): Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
133
+ * `folder_behavior_id` (int64): Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
134
134
  * `ssl_certificate_id` (int64): Current SSL certificate ID.
135
135
  * `domain` (string): Customer-owned domain name.
136
136
 
data/docs/secret.md ADDED
@@ -0,0 +1,158 @@
1
+ # Secret
2
+
3
+ ## Example Secret Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "workspace_id": 1,
9
+ "name": "Production API token",
10
+ "description": "Used by production API integrations.",
11
+ "secret_type": "token",
12
+ "metadata": {
13
+ "key": "example value"
14
+ },
15
+ "value_field_names": [
16
+ "example"
17
+ ],
18
+ "created_at": "2000-01-01T01:00:00Z",
19
+ "updated_at": "2000-01-01T01:00:00Z"
20
+ }
21
+ ```
22
+
23
+ * `id` (int64): Secret ID.
24
+ * `workspace_id` (int64): Workspace ID. 0 means the default workspace.
25
+ * `name` (string): Secret name.
26
+ * `description` (string): Internal description for your reference.
27
+ * `secret_type` (string): Secret type.
28
+ * `metadata` (object): Non-secret metadata for the Secret type.
29
+ * `value_field_names` (array(string)): Names of configured secret value fields. Secret values are never returned.
30
+ * `created_at` (date-time): Secret create date/time.
31
+ * `updated_at` (date-time): Secret update date/time.
32
+
33
+
34
+ ---
35
+
36
+ ## List Secrets
37
+
38
+ ```
39
+ Files::Secret.list
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ * `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.
45
+ * `per_page` (int64): Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
46
+ * `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`.
47
+ * `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 ]`.
48
+ * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
49
+
50
+
51
+ ---
52
+
53
+ ## Show Secret
54
+
55
+ ```
56
+ Files::Secret.find(id)
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ * `id` (int64): Required - Secret ID.
62
+
63
+
64
+ ---
65
+
66
+ ## Create Secret
67
+
68
+ ```
69
+ Files::Secret.create(
70
+ name: "Production API token",
71
+ description: "Used by production API integrations.",
72
+ secret_type: "token",
73
+ metadata: {"key":"example value"},
74
+ workspace_id: 0
75
+ )
76
+ ```
77
+
78
+ ### Parameters
79
+
80
+ * `name` (string): Required - Secret name.
81
+ * `description` (string): Internal description for your reference.
82
+ * `secret_type` (string): Required - Secret type.
83
+ * `metadata` (object): Non-secret metadata for the Secret type.
84
+ * `workspace_id` (int64): Workspace ID. 0 means the default workspace.
85
+
86
+
87
+ ---
88
+
89
+ ## Update Secret
90
+
91
+ ```
92
+ Files::Secret.update(id,
93
+ name: "Production API token",
94
+ description: "Used by production API integrations.",
95
+ secret_type: "token",
96
+ metadata: {"key":"example value"}
97
+ )
98
+ ```
99
+
100
+ ### Parameters
101
+
102
+ * `id` (int64): Required - Secret ID.
103
+ * `name` (string): Secret name.
104
+ * `description` (string): Internal description for your reference.
105
+ * `secret_type` (string): Secret type.
106
+ * `metadata` (object): Non-secret metadata for the Secret type.
107
+
108
+
109
+ ---
110
+
111
+ ## Delete Secret
112
+
113
+ ```
114
+ Files::Secret.delete(id)
115
+ ```
116
+
117
+ ### Parameters
118
+
119
+ * `id` (int64): Required - Secret ID.
120
+
121
+
122
+ ---
123
+
124
+ ## Update Secret
125
+
126
+ ```
127
+ secret = Files::Secret.find(id)
128
+
129
+ secret.update(
130
+ name: "Production API token",
131
+ description: "Used by production API integrations.",
132
+ secret_type: "token",
133
+ metadata: {"key":"example value"}
134
+ )
135
+ ```
136
+
137
+ ### Parameters
138
+
139
+ * `id` (int64): Required - Secret ID.
140
+ * `name` (string): Secret name.
141
+ * `description` (string): Internal description for your reference.
142
+ * `secret_type` (string): Secret type.
143
+ * `metadata` (object): Non-secret metadata for the Secret type.
144
+
145
+
146
+ ---
147
+
148
+ ## Delete Secret
149
+
150
+ ```
151
+ secret = Files::Secret.find(id)
152
+
153
+ secret.delete
154
+ ```
155
+
156
+ ### Parameters
157
+
158
+ * `id` (int64): Required - Secret ID.
@@ -72,6 +72,15 @@ module Files
72
72
  @attributes[:value] = value
73
73
  end
74
74
 
75
+ # string - Public URL for this publicly hosted folder when the `Serve Publicly` behavior has a key configured. When a Custom Domain with `public_hosting` destination is attached to this behavior, the URL uses that domain. Otherwise it uses the site's `subdomain.hosted-by-files.com` host.
76
+ def public_hosting_url
77
+ @attributes[:public_hosting_url]
78
+ end
79
+
80
+ def public_hosting_url=(value)
81
+ @attributes[:public_hosting_url] = value
82
+ end
83
+
75
84
  # boolean - If true, the parent folder's behavior will be disabled for this folder and its children.
76
85
  def disable_parent_folder_behavior
77
86
  @attributes[:disable_parent_folder_behavior]
@@ -27,7 +27,7 @@ module Files
27
27
  @attributes[:domain] = value
28
28
  end
29
29
 
30
- # string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
30
+ # string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
31
31
  def destination
32
32
  @attributes[:destination]
33
33
  end
@@ -63,7 +63,7 @@ module Files
63
63
  @attributes[:brick_managed] = value
64
64
  end
65
65
 
66
- # int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
66
+ # int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
67
67
  def folder_behavior_id
68
68
  @attributes[:folder_behavior_id]
69
69
  end
@@ -83,8 +83,8 @@ module Files
83
83
  end
84
84
 
85
85
  # Parameters:
86
- # destination - string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
87
- # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
86
+ # destination - string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
87
+ # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
88
88
  # ssl_certificate_id - int64 - Current SSL certificate ID.
89
89
  # domain - string - Customer-owned domain name.
90
90
  def update(params = {})
@@ -162,8 +162,8 @@ module Files
162
162
  end
163
163
 
164
164
  # Parameters:
165
- # destination - string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
166
- # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
165
+ # destination - string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
166
+ # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
167
167
  # ssl_certificate_id - int64 - Current SSL certificate ID.
168
168
  # domain (required) - string - Customer-owned domain name.
169
169
  def self.create(params = {}, options = {})
@@ -178,8 +178,8 @@ module Files
178
178
  end
179
179
 
180
180
  # Parameters:
181
- # destination - string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, or `s3_endpoint`.
182
- # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior.
181
+ # destination - string - Where this custom domain routes. Can be `site_alias`, `public_hosting`, `s3_endpoint`, or `unassigned` (not routing traffic). Set to `unassigned` automatically when a bound `public_hosting` folder behavior is deleted, and can be set manually via the API for any reason.
182
+ # folder_behavior_id - int64 - Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when `destination` becomes `unassigned`.
183
183
  # ssl_certificate_id - int64 - Current SSL certificate ID.
184
184
  # domain - string - Customer-owned domain name.
185
185
  def self.update(id, params = {}, options = {})
@@ -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.674"
5
5
  end
data/lib/files.com.rb CHANGED
@@ -137,6 +137,7 @@ require "files.com/models/request"
137
137
  require "files.com/models/restore"
138
138
  require "files.com/models/scheduled_export"
139
139
  require "files.com/models/scim_log"
140
+ require "files.com/models/secret"
140
141
  require "files.com/models/session"
141
142
  require "files.com/models/settings_change"
142
143
  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.674
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-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -276,6 +276,7 @@ files:
276
276
  - docs/restore.md
277
277
  - docs/scheduled_export.md
278
278
  - docs/scim_log.md
279
+ - docs/secret.md
279
280
  - docs/session.md
280
281
  - docs/settings_change.md
281
282
  - docs/sftp_action_log.md
@@ -421,6 +422,7 @@ files:
421
422
  - lib/files.com/models/restore.rb
422
423
  - lib/files.com/models/scheduled_export.rb
423
424
  - lib/files.com/models/scim_log.rb
425
+ - lib/files.com/models/secret.rb
424
426
  - lib/files.com/models/session.rb
425
427
  - lib/files.com/models/settings_change.rb
426
428
  - lib/files.com/models/sftp_action_log.rb