-
Notifications
You must be signed in to change notification settings - Fork 4
/
state.go
38 lines (31 loc) · 1.65 KB
/
state.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package moysklad
import (
"github.com/google/uuid"
)
// State Статус документов.
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/dictionaries/#suschnosti-statusy-dokumentow
type State struct {
AccountID *uuid.UUID `json:"accountId,omitempty"` // ID учетной записи
Color *uint64 `json:"color,omitempty"` // Цвет Статуса
EntityType *string `json:"entityType,omitempty"` // Тип сущности, к которой относится Статус (ключевое слово в рамках JSON API)
ID *uuid.UUID `json:"id,omitempty"` // ID сущности
Meta *Meta `json:"meta,omitempty"` // Метаданные
Name *string `json:"name,omitempty"` // Наименование Статуса
StateType StateType `json:"stateType,omitempty"` // Тип Статуса
}
func (s State) String() string {
return Stringify(s)
}
// GetMeta удовлетворяет интерфейсу HasMeta
func (s State) GetMeta() *Meta {
return s.Meta
}
type States = Slice[State]
// StateType Тип статуса.
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/dictionaries/#suschnosti-statusy-dokumentow-statusy-atributy-suschnosti-tip-statusa
type StateType string
const (
StateTypeRegular StateType = "Regular" // Обычный (значение по умолчанию)
StateTypeSuccessful StateType = "Successful" // Финальный положительный
StateTypeUnsuccessful StateType = "Unsuccessful" // Финальный отрицательный
)