You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decort-golang-sdk/pkg/cloudapi/locations/get_url.go

29 lines
554 B

package locations
import (
"context"
"github.com/rudecs/decort-sdk/opts"
"github.com/rudecs/decort-sdk/typed"
)
func (l Locations) GetUrl(ctx context.Context, options ...opts.DecortOpts) (string, error) {
url := "/locations/getUrl"
prefix := "/cloudapi"
option := opts.New(options)
if option != nil {
if option.IsAdmin {
prefix = "/" + option.AdminValue
}
}
url = prefix + url
res, err := l.client.DecortApiCall(ctx, typed.POST, url, nil)
if err != nil {
return "", err
}
return string(res), nil
}