v1.6.6
This commit is contained in:
@@ -8,25 +8,16 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Reuqest struct for getting details of the specified group.
|
||||
// GetRequest struct to get details of the specified group.
|
||||
type GetRequest struct {
|
||||
// Group ID
|
||||
// Required: true
|
||||
GroupID string `url:"groupId" json:"groupId" validate:"required"`
|
||||
}
|
||||
|
||||
// Get gets details of the specified group.
|
||||
// Get gets details of the specified group as an ItemGroup struct
|
||||
func (g Group) Get(ctx context.Context, req GetRequest) (*ItemGroup, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/group/get"
|
||||
|
||||
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
res, err := g.GetRaw(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -40,3 +31,18 @@ func (g Group) Get(ctx context.Context, req GetRequest) (*ItemGroup, error) {
|
||||
|
||||
return &info, nil
|
||||
}
|
||||
|
||||
// GetRaw gets details of the specified group as an array of bytes
|
||||
func (g Group) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/group/get"
|
||||
|
||||
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user