Merge 'dev' into 'main'
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
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
|
||||
}
|
||||
package locations
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (l Locations) GetUrl(ctx context.Context) (string, error) {
|
||||
url := "/locations/getUrl"
|
||||
prefix := "/cloudapi"
|
||||
|
||||
url = prefix + url
|
||||
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, nil)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(res), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user