Skip to content

Commit 2a10b9e

Browse files
committed
Add file_ttl support to Secure Share
1 parent 636e95c commit 2a10b9e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Added
11+
12+
- `file_ttl` support to Secure Share.
13+
1014
## 4.2.0 - 2024-12-18
1115

1216
### Added

go.work.sum

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
1515
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
1616
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
1717
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
18+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
1819
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1920
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2021
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

pangea-sdk/service/share/api.go

+6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ type ItemData struct {
8181
BillableSize int `json:"billable_size"` // The number of billable bytes (includes Metadata, Tags, etc.) for the object.
8282
CreatedAt string `json:"created_at"` // The date and time the object was created.
8383
ExternalBucketKey string `json:"external_bucket_key"` // The key in the external bucket that contains this file.
84+
FileTTL string `json:"file_ttl,omitempty"` // The explicit file TTL setting for this object.
85+
FileTTLEffective string `json:"file_ttl_effective,omitempty"` // The effective file TTL setting for this object, either explicitly set or inherited (see file_ttl_from_id.)
86+
FileTTLFromID string `json:"file_ttl_from_id,omitempty"` // The ID of the object the expiry / TTL is set from. Either a service configuration, the object itself, or a parent folder.
8487
Folder string `json:"folder"` // The full path to the folder the object is stored in.
8588
ID string `json:"id"` // The ID of a stored object.
8689
MD5 string `json:"md5"` // The MD5 hash of the file contents. Cannot be written to.
@@ -146,6 +149,7 @@ type FolderCreateRequest struct {
146149
pangea.BaseRequest
147150

148151
Name string `json:"name,omitempty"` // The name of an object.
152+
FileTTL *string `json:"file_ttl,omitempty"` // Duration until files within this folder are automatically deleted.
149153
Metadata Metadata `json:"metadata,omitempty"` // A set of string-based key/value pairs used to provide additional data about an object.
150154
ParentID string `json:"parent_id,omitempty"` // The ID of a stored object.
151155
Folder string `json:"folder,omitempty"` // The folder to place the folder in. Must match `parent_id` if also set.
@@ -226,6 +230,7 @@ type PutRequest struct {
226230
MimeType string `json:"mimetype,omitempty"` // The MIME type of the file, which will be verified by the server if provided. Uploads not matching the supplied MIME type will be rejected.
227231
ParentID string `json:"parent_id,omitempty"` // The parent ID of the object (a folder). Leave blank to keep in the root folder.
228232
Folder string `json:"folder,omitempty"` // The path to the parent folder. Leave blank for the root folder. Path must resolve to `parent_id` if also set.
233+
FileTTL *string `json:"file_ttl,omitempty"` // The TTL before expiry for the file.
229234
Password string `json:"password,omitempty"` // An optional password to protect the file with. Downloading the file will require this password.
230235
PasswordAlgorithm string `json:"password_algorithm,omitempty"` // An optional password algorithm to protect the file with. See symmetric vault password_algorithm.
231236
SHA1 string `json:"sha1,omitempty"` // The hexadecimal-encoded SHA1 hash of the file data, which will be verified by the server if provided.
@@ -304,6 +309,7 @@ type UpdateRequest struct {
304309
AddPassword string `json:"add_password,omitempty"` // Protect the file with the supplied password.
305310
AddPasswordAlgorithm string `json:"add_password_algorithm,omitempty"` // The algorithm to use to password protect the file.
306311
AddTags Tags `json:"add_tags,omitempty"` // A list of Tags to add. It is not an error to provide a tag which already exists.
312+
FileTTL *string `json:"file_ttl,omitempty"` // Set the file TTL.
307313
Name string `json:"name,omitempty"` // Sets the object's Name.
308314
Metadata Metadata `json:"metadata,omitempty"` // Set the object's metadata.
309315
RemoveMetadata Metadata `json:"remove_metadata,omitempty"` // A list of metadata key/values to remove in the object. It is not an error for a provided key to not exist. If a provided key exists but doesn't match the provided value, it will not be removed.

0 commit comments

Comments
 (0)