This commit is contained in:
2023-10-25 17:37:18 +03:00
parent b666789c7d
commit 4120cd2b1a
639 changed files with 2010 additions and 3224 deletions

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for create K8CI instance
// CreateRequest struct to create K8CI instance
type CreateRequest struct {
// Name of catalog item
// Required: true
@@ -69,9 +69,7 @@ type CreateRequest struct {
func (k K8CI) 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/k8ci/create"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for delete K8CI
// DeleteRequest struct to delete K8CI
type DeleteRequest struct {
// K8CI ID
// Required: true
@@ -23,9 +23,7 @@ type DeleteRequest struct {
func (k K8CI) 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/k8ci/delete"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for disable K8CI
// DisableRequest struct to disable K8CI
type DisableRequest struct {
// K8CI ID
// Required: true
@@ -19,9 +19,7 @@ type DisableRequest struct {
func (k K8CI) Disable(ctx context.Context, req DisableRequest) (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/k8ci/disable"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for enable K8CI
// EnableRequest struct to enable K8CI
type EnableRequest struct {
// K8CI ID
// Required: true
@@ -19,9 +19,7 @@ type EnableRequest struct {
func (k K8CI) Enable(ctx context.Context, req EnableRequest) (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/k8ci/enable"

View File

@@ -36,9 +36,7 @@ func (k K8CI) Get(ctx context.Context, req GetRequest) (*RecordK8CI, error) {
func (k K8CI) 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/k8ci/get"

View File

@@ -6,7 +6,7 @@ import (
"net/http"
)
// Request struct for get list information about deleted images
// ListDeletedRequest struct to get list information about deleted images
type ListDeletedRequest struct {
// Find by ID
// Required: false

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for restore K8CI
// RestoreRequest struct to restore K8CI
type RestoreRequest struct {
// K8CI ID
// Required: true
@@ -19,9 +19,7 @@ type RestoreRequest struct {
func (k K8CI) Restore(ctx context.Context, req RestoreRequest) (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/k8ci/restore"