func (ref *NamespaceService) GetNamespacesFromAccounts(ctx context.Context, addrs []*Address, nsId *NamespaceId,
	pageSize int) ([]*NamespaceInfo, error) {
	if len(addrs) == 0 {
		return nil, ErrEmptyAddressesIds
	}
	url := net.NewUrl(namespacesFromAccountsRoute)
	if nsId != nil {
		url.AddParam("id", nsId.toHexString())
	}
	if pageSize > 0 {
		url.AddParam("pageSize", strconv.Itoa(pageSize))
	}
	dtos := namespaceInfoDTOs(make([]*namespaceInfoDTO, 0))
	resp, err := ref.client.DoNewRequest(ctx, http.MethodPost, url.Encode(), addresses(addrs), &dtos)
	if err != nil {
		return nil, err
	}
	if err = handleResponseStatusCode(resp, map[int]error{400: ErrInvalidRequest, 409: ErrArgumentNotValid}); err != nil {
		return nil, err
	}
	nsInfos, err := dtos.toStruct()
	if err != nil {
		return nil, err
	}
	if err = ref.buildNamespacesHierarchy(ctx, nsInfos); err != nil {
		return nil, err
	}
	return nsInfos, nil
}
GetNamespacesFromAccounts get required params addresses, other skipped if value is empty
@/account/namespaces
package sdk
import (
	"fmt"
	"github.com/proximax-storage/proximax-utils-go/net"
	"golang.org/x/net/context"
	"net/http"
	"strconv"
)
type NamespaceService service
func (ref *NamespaceService) GetNamespace(ctx context.Context, nsId *NamespaceId) (*NamespaceInfo, error) {
	if nsId == nil {
		return nil, ErrNilNamespaceId
	}
	nsInfoDTO := &namespaceInfoDTO{}
	url := net.NewUrl(fmt.Sprintf(namespaceRoute, nsId.toHexString()))
	resp, err := ref.client.DoNewRequest(ctx, http.MethodGet, url.Encode(), nil, nsInfoDTO)
	if err != nil {
		return nil, err
	}
	if err = handleResponseStatusCode(resp, map[int]error{404: ErrResourceNotFound, 409: ErrArgumentNotValid}); err != nil {
		return nil, err
	}
	nsInfo, err := nsInfoDTO.toStruct()
	if err != nil {
		return nil, err
	}
	if err = ref.buildNamespaceHierarchy(ctx, nsInfo); err != nil {
		return nil, err
	}
	return nsInfo, nil
}
func (ref *NamespaceService) GetNamespacesFromAccount(ctx context.Context, address *Address, nsId *NamespaceId,
	pageSize int) ([]*NamespaceInfo, error) {
	if address == nil {
		return nil, ErrNilAddress
	}
	url := net.NewUrl(fmt.Sprintf(namespacesFromAccountRoutes, address.Address))
	if nsId != nil {
		url.SetParam("id", nsId.toHexString())
	}
	if pageSize > 0 {
		url.SetParam("pageSize", strconv.Itoa(pageSize))
	}
	dtos := namespaceInfoDTOs(make([]*namespaceInfoDTO, 0))
	resp, err := ref.client.DoNewRequest(ctx, http.MethodGet, url.Encode(), nil, &dtos)
	if err != nil {
		return nil, err
	}
	if err = handleResponseStatusCode(resp, map[int]error{409: ErrArgumentNotValid}); err != nil {
		return nil, err
	}
	nsInfos, err := dtos.toStruct()
	if err != nil {
		return nil, err
	}
	if err = ref.buildNamespacesHierarchy(ctx, nsInfos); err != nil {
		return nil, err
	}
	return nsInfos, nil
}