-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLT-1317: Update APIs as per changes in palette-api-go (#120)
* remove V1UsersMeGet & add GetUsersInfo() * remove multiple APIs that are removed from palette-api-go
- Loading branch information
1 parent
1a96e77
commit beda3cc
Showing
8 changed files
with
78 additions
and
376 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package client | ||
|
||
import "errors" | ||
|
||
// GetTenantUID retrieves the tenant UID of the authenticated user. | ||
func (h *V1Client) GetTenantUID() (string, error) { | ||
resp, err := h.GetMe() | ||
resp, err := h.GetUsersInfo() | ||
if err != nil { | ||
return "", err | ||
} | ||
return resp.Status.Tenant.TenantUID, nil | ||
if resp == nil { | ||
return "", errors.New("empty response received from GetUsersInfo()") | ||
} | ||
return resp.TenantUID, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
module github.com/spectrocloud/palette-sdk-go | ||
|
||
go 1.22 | ||
go 1.22.5 | ||
|
||
require ( | ||
github.com/go-openapi/runtime v0.26.0 | ||
github.com/go-openapi/strfmt v0.21.7 | ||
github.com/go-openapi/runtime v0.28.0 | ||
github.com/go-openapi/strfmt v0.23.0 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/spectrocloud/gomi v1.14.0 | ||
github.com/spectrocloud/palette-api-go v0.2.3 | ||
github.com/stretchr/testify v1.8.4 | ||
github.com/spectrocloud/palette-api-go v0.2.6 | ||
github.com/stretchr/testify v1.9.0 | ||
) | ||
|
||
require ( | ||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/go-errors/errors v1.5.1 // indirect | ||
github.com/go-logr/logr v1.2.4 // indirect | ||
github.com/go-logr/logr v1.4.2 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/go-openapi/analysis v0.21.4 // indirect | ||
github.com/go-openapi/errors v0.20.4 // indirect | ||
github.com/go-openapi/jsonpointer v0.20.0 // indirect | ||
github.com/go-openapi/jsonreference v0.20.2 // indirect | ||
github.com/go-openapi/loads v0.21.2 // indirect | ||
github.com/go-openapi/spec v0.20.9 // indirect | ||
github.com/go-openapi/swag v0.22.4 // indirect | ||
github.com/go-openapi/validate v0.22.1 // indirect | ||
github.com/go-openapi/analysis v0.23.0 // indirect | ||
github.com/go-openapi/errors v0.22.0 // indirect | ||
github.com/go-openapi/jsonpointer v0.21.0 // indirect | ||
github.com/go-openapi/jsonreference v0.21.0 // indirect | ||
github.com/go-openapi/loads v0.22.0 // indirect | ||
github.com/go-openapi/spec v0.21.0 // indirect | ||
github.com/go-openapi/swag v0.23.0 // indirect | ||
github.com/go-openapi/validate v0.24.0 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/oklog/ulid v1.3.1 // indirect | ||
github.com/opentracing/opentracing-go v1.2.0 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/sirupsen/logrus v1.9.3 // indirect | ||
go.mongodb.org/mongo-driver v1.12.1 // indirect | ||
go.opentelemetry.io/otel v1.18.0 // indirect | ||
go.opentelemetry.io/otel/metric v1.18.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.18.0 // indirect | ||
golang.org/x/sys v0.12.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
go.mongodb.org/mongo-driver v1.16.0 // indirect | ||
go.opentelemetry.io/otel v1.28.0 // indirect | ||
go.opentelemetry.io/otel/metric v1.28.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.28.0 // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
golang.org/x/sys v0.22.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.