Holiday Regions

List all possible holiday regions

SDK Method

holiday_region.GetSupported()

Return Values

Returns a *holiday_region.Iter and an error. Range over All() to receive files_sdk.HolidayRegion 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.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    holiday_region "github.com/Files-com/files-sdk-go/v3/holidayregion"
)

holidayRegionIterator, err := holiday_region.GetSupported(files_sdk.HolidayRegionGetSupportedParams{})
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 holidayRegion, err := range holidayRegionIterator.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(holidayRegion)
}

The HolidayRegion Object

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

AttributeDescription
Code
string
The code representing a region
Name
string
The name of the region