v1.6.7
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for finding apiaccess groups.
|
||||
// APIFindRequest struct for finding apiaccess groups.
|
||||
type APIFindRequest struct {
|
||||
// API function to find
|
||||
// Example: cloudbroker/k8s/create
|
||||
@@ -20,9 +20,7 @@ type APIFindRequest struct {
|
||||
func (a APIAccess) APIFind(ctx context.Context, req APIFindRequest) ([]uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/apiFind"
|
||||
|
||||
@@ -9,7 +9,9 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for removing api from access group.
|
||||
type APIString string
|
||||
|
||||
// APIsExcludeRequest struct for removing api from access group.
|
||||
type APIsExcludeRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -17,7 +19,7 @@ type APIsExcludeRequest struct {
|
||||
|
||||
// APIs to remove from APIAccess group
|
||||
// Required: true
|
||||
APIs APIsEndpoints `url:"-" json:"-" validate:"required"`
|
||||
APIs APIString `url:"-" json:"apis" validate:"required"`
|
||||
}
|
||||
|
||||
type wrapperAPIsExcludeRequest struct {
|
||||
@@ -30,9 +32,7 @@ type wrapperAPIsExcludeRequest struct {
|
||||
func (a APIAccess) APIsExclude(ctx context.Context, req APIsExcludeRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/apisExclude"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for adding api to access group.
|
||||
// APIsIncludeRequest struct for adding api to access group.
|
||||
type APIsIncludeRequest struct {
|
||||
// APIAccess group ID.
|
||||
// Required: true
|
||||
@@ -16,7 +16,7 @@ type APIsIncludeRequest struct {
|
||||
|
||||
// APIs to add to APIAccess group.
|
||||
// Required: true
|
||||
APIs APIsEndpoints `url:"-" json:"-" validate:"required"`
|
||||
APIs APIString `url:"-" json:"apis" validate:"required"`
|
||||
}
|
||||
|
||||
type wrapperAPIsIncludeRequest struct {
|
||||
@@ -29,9 +29,7 @@ type wrapperAPIsIncludeRequest struct {
|
||||
func (a APIAccess) APIsInclude(ctx context.Context, req APIsIncludeRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/apisInclude"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for copying apiaccess group.
|
||||
// CopyRequest Request for copying apiaccess group.
|
||||
type CopyRequest struct {
|
||||
// ID of the API access group to make copy from
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type CopyRequest struct {
|
||||
func (a APIAccess) Copy(ctx context.Context, req CopyRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/copy"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for creating apiaccess group.
|
||||
// CreateRequest struct for creating apiaccess group.
|
||||
type CreateRequest struct {
|
||||
// Name of this apiaccess group.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type CreateRequest struct {
|
||||
func (a APIAccess) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/create"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for deleting apiaccess group.
|
||||
// DeleteRequest struct for deleting apiaccess group.
|
||||
type DeleteRequest struct {
|
||||
// APIAccess group ID.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DeleteRequest struct {
|
||||
func (a APIAccess) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for updating apiaccess group description.
|
||||
// DescUpdateRequest struct for updating apiaccess group description.
|
||||
type DescUpdateRequest struct {
|
||||
// APIAccess group ID.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DescUpdateRequest struct {
|
||||
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/descUpdate"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (a APIAccess) Get(ctx context.Context, req GetRequest) (*ItemAPIAccess, err
|
||||
func (a APIAccess) 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)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/get"
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ListRequest struct to get list of all non deleted apiaccess instances.
|
||||
@@ -62,13 +60,6 @@ func (a APIAccess) List(ctx context.Context, req ListRequest) (*ListAPIAccess, e
|
||||
|
||||
// ListRaw gets list of all non deleted apiaccess instances as an array of bytes
|
||||
func (a APIAccess) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/list"
|
||||
|
||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
@@ -4,11 +4,9 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting list of all deleted apiaccess instances.
|
||||
// ListDeletedRequest struct for getting list of all deleted apiaccess instances.
|
||||
type ListDeletedRequest struct {
|
||||
// Page number.
|
||||
// Required: false
|
||||
@@ -21,13 +19,6 @@ type ListDeletedRequest struct {
|
||||
|
||||
// ListDeleted gets list of all deleted apiaccess instances.
|
||||
func (a APIAccess) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListAPIAccess, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/listDeleted"
|
||||
|
||||
info := ListAPIAccess{}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Reqeust struct for setting default apiaccess group.
|
||||
// SetDefaultRequest struct for setting default apiaccess group.
|
||||
type SetDefaultRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type SetDefaultRequest struct {
|
||||
func (a APIAccess) SetDefault(ctx context.Context, req SetDefaultRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/setDefault"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for subtracting.
|
||||
// SubtractRequest struct for subtracting.
|
||||
type SubtractRequest struct {
|
||||
// ID of the API access group to subtract from. This group will contain the difference.
|
||||
MinuendID uint64 `url:"minuendId" json:"minuendId" validate:"required"`
|
||||
@@ -22,9 +22,7 @@ type SubtractRequest struct {
|
||||
func (a APIAccess) Subtruct(ctx context.Context, req SubtractRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/subtract"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for union.
|
||||
// UnionRequest struct for union.
|
||||
type UnionRequest struct {
|
||||
// Recipient apiaccess group ID
|
||||
// Required: true
|
||||
@@ -19,14 +19,12 @@ type UnionRequest struct {
|
||||
DonorID uint64 `url:"donorId" json:"donorId" validate:"required"`
|
||||
}
|
||||
|
||||
// Combines the API list of group #1 ("recipient") and group #2 ("donor"),
|
||||
// Union combines the API list of group #1 ("recipient") and group #2 ("donor"),
|
||||
// writing the result to group #1 and avoiding duplicates in the list
|
||||
func (a APIAccess) Union(ctx context.Context, req UnionRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/union"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for updating apis of apiaccess group.
|
||||
// UpdateRequest struct for updating apis of apiaccess group.
|
||||
type UpdateRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -30,9 +30,7 @@ type wrapperUpdateRequest struct {
|
||||
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/update"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting a list of users currently included in the specified group.
|
||||
// UserListRequest struct for getting a list of users currently included in the specified group.
|
||||
type UserListRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type UserListRequest struct {
|
||||
func (a APIAccess) UserList(ctx context.Context, req UserListRequest) ([]string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/userList"
|
||||
|
||||
Reference in New Issue
Block a user