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 getting API list.
|
||||
// APIListRequest struct for getting API list.
|
||||
type APIListRequest struct {
|
||||
// ID of the user.
|
||||
// Required: true
|
||||
@@ -20,9 +20,7 @@ type APIListRequest struct {
|
||||
func (u User) APIList(ctx context.Context, req APIListRequest) (*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/user/apiList"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for joining user into apiaccess group.
|
||||
// APIAccessJoinRequest struct for joining user into apiaccess group.
|
||||
type APIAccessJoinRequest struct {
|
||||
// ID of the user whose membership will be updated.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type APIAccessJoinRequest struct {
|
||||
func (u User) APIAccessJoin(ctx context.Context, req APIAccessJoinRequest) (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/user/apiaccessJoin"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for leaving user from apiaccess group.
|
||||
// APIAccessLeaveRequest struct for leaving user from apiaccess group.
|
||||
type APIAccessLeaveRequest struct {
|
||||
// ID of the user whose membership will be updated.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type APIAccessLeaveRequest struct {
|
||||
func (u User) APIAccessLeave(ctx context.Context, req APIAccessLeaveRequest) (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/user/apiaccessLeave"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for showing list of dicts with information about
|
||||
// APIAccessListRequest struct for showing list of dicts with information about
|
||||
// apiaccess groups contains to the user.
|
||||
type APIAccessListRequest struct {
|
||||
// ID of the user to list API access groups for.
|
||||
@@ -20,9 +20,7 @@ type APIAccessListRequest struct {
|
||||
func (u User) APIAccessList(ctx context.Context, req APIAccessListRequest) (ListAPIAccess, 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/user/apiaccessList"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for creating a user.
|
||||
// CreateRequest struct for creating a user.
|
||||
type CreateRequest struct {
|
||||
// ID of user.
|
||||
// Required: true
|
||||
@@ -35,9 +35,7 @@ type CreateRequest struct {
|
||||
func (u User) Create(ctx context.Context, req CreateRequest) (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/user/create"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for deleting a user.
|
||||
// DeleteRequest struct for deleting a user.
|
||||
type DeleteRequest struct {
|
||||
// ID of user.
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type DeleteRequest struct {
|
||||
func (u User) 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/user/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for deleting a user using user's GUID.
|
||||
// DeleteByGUIDRequest struct for deleting a user using user's GUID.
|
||||
type DeleteByGUIDRequest struct {
|
||||
// GUID of user.
|
||||
// Required: true
|
||||
@@ -21,9 +21,7 @@ type DeleteByGUIDRequest struct {
|
||||
func (u User) DeleteByGUID(ctx context.Context, req DeleteByGUIDRequest) (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/user/deleteByGuid"
|
||||
|
||||
@@ -3,24 +3,22 @@ package user
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request struct for bulk delete a list of users.
|
||||
// DeleteUsersRequest struct for bulk delete a list of users.
|
||||
type DeleteUsersRequest struct {
|
||||
// List of user ids
|
||||
UserIDs string
|
||||
// Required: true
|
||||
UserIDs string `url:"userIds" json:"userIds" validate:"required"`
|
||||
}
|
||||
|
||||
// DeleteUsers bulk delete a list of users.
|
||||
func (u User) DeleteUsers(ctx context.Context, req DeleteUsersRequest) (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/user/deleteUsers"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (u User) Get(ctx context.Context, req GetRequest) (*ItemUser, error) {
|
||||
func (u User) 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/user/get"
|
||||
|
||||
@@ -4,11 +4,9 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting user's audits.
|
||||
// GetAuditRequest struct for getting user's audits.
|
||||
type GetAuditRequest struct {
|
||||
// Name of user (get audits for current user if set to empty).
|
||||
// Required: false
|
||||
@@ -23,15 +21,8 @@ type GetAuditRequest struct {
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// GetAudits gets user's audits.
|
||||
// GetAudit gets user's audits.
|
||||
func (u User) GetAudit(ctx context.Context, req GetAuditRequest) (ListAudits, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/user/getAudit"
|
||||
|
||||
res, err := u.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting a list of the matching usernames for a given string.
|
||||
// GetMatchingUsernamesRequest struct for getting a list of the matching usernames for a given string.
|
||||
type GetMatchingUsernamesRequest struct {
|
||||
// Regex of the usernames to searched for.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type GetMatchingUsernamesRequest struct {
|
||||
func (u User) GetMatchingUsernames(ctx context.Context, req GetMatchingUsernamesRequest) (ListMatchingUsernames, 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/user/getMatchingUsernames"
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ListRequest struct to get all non deleted user instances.
|
||||
@@ -50,13 +48,6 @@ func (u User) List(ctx context.Context, req ListRequest) (*ListUsers, error) {
|
||||
|
||||
// ListRaw gets all non deleted user instances as an array of bytes
|
||||
func (u User) 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/user/list"
|
||||
|
||||
res, err := u.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
Reference in New Issue
Block a user