Bundle Downloads

A BundleDownload is a record of the download action that happened in the bundle.

SDK Method

bundle_download.List()

Return Values

Returns a *bundle_download.Iter and an error. Range over All() to receive files_sdk.BundleDownload values and errors. Check each loop error before using its resource. Next() and Err() remain supported.

Authorization Requirement

Available to all authenticated keys or sessions.

BundleDownloadListParams Fields

FieldDescription
BundleId
int64
Bundle ID
BundleRegistrationId
int64
BundleRegistration ID

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    bundle_download "github.com/Files-com/files-sdk-go/v3/bundledownload"
)

bundleDownloadIterator, err := bundle_download.List(files_sdk.BundleDownloadListParams{BundleId: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

for bundleDownload, err := range bundleDownloadIterator.All() {
    if err != nil {
        var respErr files_sdk.ResponseError
        if errors.As(err, &respErr) {
            fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
        } else {
            fmt.Printf("Request failed: %v\n", err)
        }
        return
    }
    fmt.Println(bundleDownload)
}

The BundleDownload Object

Some of the methods above return a BundleDownload object. The attributes of this object are listed below.

AttributeDescription
BundleRegistration
BundleRegistration
DownloadMethod
string
Download method (file or full_zip)
Possible values: file, full_zip
Path
string
Download path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
WorkspaceId
int64
Workspace ID. 0 means the default workspace.
CreatedAt
date-time
Download date/time