client

package
v0.0.0-...-d945546 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusMovedPermanently      = "запрашиваемый ресурс находится по другому URL"
	StatusSeeOther              = "запрашиваемый ресурс находится по другому URL"
	StatusBadRequest            = "ошибка в структуре JSON передаваемого запроса"
	StatusUnauthorized          = "" /* 165-byte string literal not displayed */
	StatusForbidden             = "у вас нет прав на просмотр данного объекта"
	StatusNotFound              = "запрошенный ресурс не существует"
	StatusMethodNotAllowed      = "http-метод указан неверно для запрошенного ресурса"
	StatusConflict              = "указанный объект используется и не может быть удален"
	StatusGone                  = "версия API больше не поддерживается"
	StatusPreconditionFailed    = "" /* 127-byte string literal not displayed */
	StatusRequestEntityTooLarge = "" /* 254-byte string literal not displayed */
	StatusInternalServerError   = "при обработке запроса возникла непредвиденная ошибка"
	StatusBadGateway            = "сервис временно недоступен"
	StatusServiceUnavailable    = "сервис временно отключен"                                        // 503: Сервис временно отключен
	StatusGatewayTimeout        = "превышен таймаут обращения к сервису, повторите попытку позднее" // 504: Превышен таймаут обращения к сервису, повторите попытку позднее
)
View Source
const ApiEndpoint = "https://online.moysklad.ru/api/remap/1.2"

Variables

This section is empty.

Functions

func AccumulationDiscountClient

func AccumulationDiscountClient(client *JSONApiClient) *accumulationDiscountClient

func AssortmentClient

func AssortmentClient(client *JSONApiClient) *assortmentClient

func BonusProgramClient

func BonusProgramClient(client *JSONApiClient) *bonusProgramClient

func BonusTransactionClient

func BonusTransactionClient(client *JSONApiClient) *bonusTransactionClient

func BundleClient

func BundleClient(client *JSONApiClient) *bundleClient

func CashInClient

func CashInClient(client *JSONApiClient) *cashInClient

func CashOutClient

func CashOutClient(client *JSONApiClient) *cashOutClient

func CharacteristicsClient

func CharacteristicsClient(client *JSONApiClient) *characteristicsClient

func CommissionReportInClient

func CommissionReportInClient(client *JSONApiClient) *commissionReportInClient

func CommissionReportOutClient

func CommissionReportOutClient(client *JSONApiClient) *commissionReportOutClient

func CompanySettingsClient

func CompanySettingsClient(client *JSONApiClient) *companySettingsClient

func ConsignmentClient

func ConsignmentClient(client *JSONApiClient) *consignmentClient

func ContextClient

func ContextClient(client *JSONApiClient) *contextClient

func ContractClient

func ContractClient(client *JSONApiClient) *contractClient

func CounterPartyAdjustmentClient

func CounterPartyAdjustmentClient(client *JSONApiClient) *counterPartyAdjustmentClient

func CounterPartyClient

func CounterPartyClient(client *JSONApiClient) *counterPartyClient

func CountryClient

func CountryClient(client *JSONApiClient) *countryClient

func CurrencyClient

func CurrencyClient(client *JSONApiClient) *currencyClient

func CustomEntityClient

func CustomEntityClient(client *JSONApiClient) *customEntityClient

func CustomerOrderClient

func CustomerOrderClient(client *JSONApiClient) *customerOrderClient

func DemandClient

func DemandClient(client *JSONApiClient) *demandClient

func DiscountClient

func DiscountClient(client *JSONApiClient) *discountClient

func EmployeeClient

func EmployeeClient(client *JSONApiClient) *employeeClient

func EnterClient

func EnterClient(client *JSONApiClient) *enterClient

func ExpenseItemClient

func ExpenseItemClient(client *JSONApiClient) *expenseItemClient

func FactureInClient

func FactureInClient(client *JSONApiClient) *factureInClient

func FactureOutClient

func FactureOutClient(client *JSONApiClient) *factureOutClient

func FileRequest

func FileRequest(c *EntityBaseClient, data any, filename string) (f *os.File, err error)

func GetPath

func GetPath(entityType entity.MetaType) (path string)

func GroupClient

func GroupClient(client *JSONApiClient) *groupClient

func InternalOrderClient

func InternalOrderClient(client *JSONApiClient) *internalOrderClient

func InventoryClient

func InventoryClient(client *JSONApiClient) *inventoryClient

func InvoiceInClient

func InvoiceInClient(client *JSONApiClient) *invoiceInClient

func InvoiceOutClient

func InvoiceOutClient(client *JSONApiClient) *invoiceOutClient

func LossClient

func LossClient(client *JSONApiClient) *lossClient

func MetadataClient

func MetadataClient(client *JSONApiClient) *metadataClient

func MoveClient

func MoveClient(client *JSONApiClient) *moveClient

func OrganizationClient

func OrganizationClient(client *JSONApiClient) *organizationClient

func PaymentInClient

func PaymentInClient(client *JSONApiClient) *paymentInClient

func PaymentOutClient

func PaymentOutClient(client *JSONApiClient) *paymentOutClient

func PersonalDiscountClient

func PersonalDiscountClient(client *JSONApiClient) *personalDiscountClient

func PrepaymentClient

func PrepaymentClient(client *JSONApiClient) *prepaymentClient

func PrepaymentReturnClient

func PrepaymentReturnClient(client *JSONApiClient) *prepaymentReturnClient

func PriceListClient

func PriceListClient(client *JSONApiClient) *priceListClient

func PriceTypeClient

func PriceTypeClient(client *JSONApiClient) *priceTypeClient

func ProcessingClient

func ProcessingClient(client *JSONApiClient) *processingClient

func ProcessingOrderClient

func ProcessingOrderClient(client *JSONApiClient) *processingOrderClient

func ProcessingPlanClient

func ProcessingPlanClient(client *JSONApiClient) *processingPlanClient

func ProductClient

func ProductClient(client *JSONApiClient) *productClient

func ProductFolderClient

func ProductFolderClient(client *JSONApiClient) *productFolderClient

func ProjectClient

func ProjectClient(client *JSONApiClient) *projectClient

func PurchaseOrderClient

func PurchaseOrderClient(client *JSONApiClient) *purchaseOrderClient

func PurchaseReturnClient

func PurchaseReturnClient(client *JSONApiClient) *purchaseReturnClient

func RegionClient

func RegionClient(client *JSONApiClient) *regionClient

func ReportCounterpartyClient

func ReportCounterpartyClient(client *JSONApiClient) *reportCounterpartyClient

func ReportDashboardClient

func ReportDashboardClient(client *JSONApiClient) *reportDashboardClient

func ReportMoneyClient

func ReportMoneyClient(client *JSONApiClient) *reportMoneyClient

func ReportOrdersClient

func ReportOrdersClient(client *JSONApiClient) *reportOrdersClient

func ReportProfitClient

func ReportProfitClient(client *JSONApiClient) *reportProfitClient

func ReportSalesClient

func ReportSalesClient(client *JSONApiClient) *reportSalesClient

func ReportStockClient

func ReportStockClient(client *JSONApiClient) *reportStockClient

func ReportTurnoverClient

func ReportTurnoverClient(client *JSONApiClient) *reportTurnoverClient

func RetailDemandClient

func RetailDemandClient(client *JSONApiClient) *retailDemandClient

func RetailDrawerCashInClient

func RetailDrawerCashInClient(client *JSONApiClient) *retailDrawerCashInClient

func RetailDrawerCashOutClient

func RetailDrawerCashOutClient(client *JSONApiClient) *retailDrawerCashOutClient

func RetailSalesReturnClient

func RetailSalesReturnClient(client *JSONApiClient) *retailSalesReturnClient

func RetailShiftClient

func RetailShiftClient(client *JSONApiClient) *retailShiftClient

func RetailStoreClient

func RetailStoreClient(client *JSONApiClient) *retailStoreClient

func RoleClient

func RoleClient(client *JSONApiClient) *roleClient

func SalesChannelClient

func SalesChannelClient(client *JSONApiClient) *salesChannelClient

func SalesReturnClient

func SalesReturnClient(client *JSONApiClient) *salesReturnClient

func ServiceClient

func ServiceClient(client *JSONApiClient) *serviceClient

func SpecialPriceDiscountClient

func SpecialPriceDiscountClient(client *JSONApiClient) *specialPriceDiscountClient

func StatesClient

func StatesClient(client *JSONApiClient, entityType entity.MetaType) *statesClient

func StoreClient

func StoreClient(client *JSONApiClient) *storeClient

func SubscriptionClient

func SubscriptionClient(client *JSONApiClient) *subscriptionClient

func SupplyClient

func SupplyClient(client *JSONApiClient) *supplyClient

func TaskClient

func TaskClient(client *JSONApiClient) *taskClient

func TokenClient

func TokenClient(client *JSONApiClient) *tokenClient

func UnmarshalResponse

func UnmarshalResponse[T any](r *Response) (result T)

func UomClient

func UomClient(client *JSONApiClient) *uomClient

func UserSettingsClient

func UserSettingsClient(client *JSONApiClient) *userSettingsClient

func VariantClient

func VariantClient(client *JSONApiClient) *variantClient

func WebhookClient

func WebhookClient(client *JSONApiClient) *webhookClient

Types

type BulkDeleteResponseJSON

type BulkDeleteResponseJSON []struct {
	Info   string `json:"info"`
	Errors Errors `json:"errors"`
}

type EntityBaseClient

type EntityBaseClient struct {
	QueryParams params.QueryParams
	// contains filtered or unexported fields
}

func NewEntityClientBase

func NewEntityClientBase(c *JSONApiClient, entityType entity.MetaType) *EntityBaseClient

func (*EntityBaseClient) DoRequest

func (c *EntityBaseClient) DoRequest(method string, data any) (response *Response)

func (*EntityBaseClient) SetParams

func (c *EntityBaseClient) SetParams(params *params.QueryParams)

func (*EntityBaseClient) SubPath

func (c *EntityBaseClient) SubPath(subPath string)

type Error

type Error struct {
	ErrorText string `json:"error"`
	Code      int    `json:"code"`
	Parameter string `json:"parameter"`
	MoreInfo  string `json:"moreInfo"`
	Line      int    `json:"line"`
	Column    int    `json:"column"`
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() error

func (*Error) IsApiError

func (e *Error) IsApiError() bool

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(bytes []byte) (err error)

type Errors

type Errors []Error

type HasTemplate

HasTemplate Документы,по которым можно получить шаблон

type JSONApiClient

type JSONApiClient struct {
	// contains filtered or unexported fields
}

func NewJSONApiClientDefault

func NewJSONApiClientDefault() (client *JSONApiClient)

func (*JSONApiClient) Context

func (c *JSONApiClient) Context() *ctxClient

func (*JSONApiClient) DisableWebhookContent

func (c *JSONApiClient) DisableWebhookContent(value bool) *JSONApiClient

func (*JSONApiClient) Entity

func (c *JSONApiClient) Entity() *entityClient

func (*JSONApiClient) PrettyPrintJson

func (c *JSONApiClient) PrettyPrintJson(value bool) *JSONApiClient

func (*JSONApiClient) PricePrecision

func (c *JSONApiClient) PricePrecision(value bool) *JSONApiClient

func (*JSONApiClient) Report

func (c *JSONApiClient) Report() *reportClient

func (*JSONApiClient) SetAttempts

func (c *JSONApiClient) SetAttempts(attempts int) *JSONApiClient

func (*JSONApiClient) SetCredentials

func (c *JSONApiClient) SetCredentials(username, password string) *JSONApiClient

func (*JSONApiClient) SetTimeout

func (c *JSONApiClient) SetTimeout(timeout int) *JSONApiClient

func (*JSONApiClient) SetToken

func (c *JSONApiClient) SetToken(token string) *JSONApiClient

type MoneyPlotSeries

type MoneyPlotSeries struct {
	Credit float64                  `json:"credit"` // Доход
	Debit  float64                  `json:"debit"`  // Расход
	Series []MoneyPlotSeriesElement `json:"series"` // Массив показателей
	// contains filtered or unexported fields
}

type MoneyPlotSeriesElement

type MoneyPlotSeriesElement struct {
	Date    string  `json:"date"`    // Дата
	Credit  float64 `json:"credit"`  // Доход за период
	Debit   float64 `json:"debit"`   // Расход за период
	Balance float64 `json:"balance"` // Баланс (доход-расход)
}

type Response

type Response struct {
	TimeStart   time.Time `json:"-"`
	TimeElapsed float64   `json:"-"`
	StatusCode  int       `json:"-"`
	Body        []byte    `json:"-"`
	Errors      Errors    `json:"errors"`
}

func DeleteRequest

func DeleteRequest(c *EntityBaseClient) *Response

func GetRequest

func GetRequest[T any](c *EntityBaseClient) (T, *Response)

func PostRequest

func PostRequest[T any](c *EntityBaseClient, data any) (T, *Response)

func PutRequest

func PutRequest[T any](c *EntityBaseClient, data any) (T, *Response)

func (*Response) GetErrors

func (response *Response) GetErrors() Errors

func (*Response) GetErrorsInline

func (response *Response) GetErrorsInline() error

func (*Response) HasErrors

func (response *Response) HasErrors() bool

type Result

type Result[T any] struct {
	ResultContext
	entity.MetaArray[T]
}

Result Объект ответа

type ResultAssortment

type ResultAssortment struct {
	ResultContext
	entity.MetaArrayAssortment
}

ResultAssortment Объект ответа для получения ассортимента

type ResultContext

type ResultContext struct {
	Context struct {
		Employee entity.Meta `json:"employee"`
	} `json:"context"`
}

type SalesOrdersPlotSeries

type SalesOrdersPlotSeries struct {
	Series []SalesOrdersPlotSeriesElement `json:"series"` // Массив показателей
	// contains filtered or unexported fields
}

type SalesOrdersPlotSeriesElement

type SalesOrdersPlotSeriesElement struct {
	Date     string  `json:"date"`     // Дата
	Quantity int     `json:"quantity"` // Количество
	Sum      float64 `json:"sum"`      // Сумма
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL