amocrm/internal/models/userInfo.go

161 lines
7.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package models
type AmocrmUserInformation struct {
//ID аккаунта
ID int32 `json:"id" bson:"id"`
//Название аккаунта
Name string `json:"name" bson:"name"`
//Субдомен аккаунта
Subdomain string `json:"subdomain" bson:"subdomain"`
//ID текущего пользователя
CurrentUserID int `json:"current_user_id" bson:"current_user_id"`
//Страна, указанная в настройках аккаунта
Country string `json:"country" bson:"country"`
//Режим покупателей. Возможные варианты: unavailable (функционал недоступен), disabled (функцонал отключен), segments (сегментация), dynamic (deprecated), periodicity (периодические покупки)
CustomersMode string `json:"customers_mode" bson:"customers_mode"`
//Включен ли функционал “Неразобранного” в аккаунте
IsUnsortedOn bool `json:"is_unsorted_on" bson:"is_unsorted_on"`
//Включен ли функционал причин отказа
IsLossReasonEnabled bool `json:"is_loss_reason_enabled" bson:"is_loss_reason_enabled"`
//Включен ли функционал Типовых вопросов (доступен только на профессиональном тарифе)
IsHelpbotEnabled bool `json:"is_helpbot_enabled" bson:"is_helpbot_enabled"`
//Является ли данный аккаунт техническим
IsTechnicalAccount bool `json:"is_technical_account" bson:"is_technical_account"`
//Порядок отображения имен контактов (1 Имя, Фамилия; 2 Фамилия, Имя)
ContactNameDisplayOrder int `json:"contact_name_display_order" bson:"contact_name_display_order"`
//Требуется GET параметр with. Уникальный идентификатор аккаунта для работы с сервисом чатов amoJo
AmojoID string `json:"amojo_id" bson:"amojo_id"`
//Требуется GET параметр with. Адрес сервиса файлов для конкретного аккаунта
DriveUrl string `json:"drive_url" bson:"drive_url"`
//Требуется GET параметр with. Текущая версия amoCRM
Version int `json:"version" bson:"version"`
UUID string `json:"uuid" bson:"uuid"`
IsApiFilterEnabled bool `json:"is_api_filter_enabled" bson:"is_api_filter_enabled"`
Links struct {
Self struct {
Href string `json:"href" bson:"href"`
} `json:"self" bson:"self"`
} `json:"_links" bson:"_links"`
Embedded struct {
AmojoRights struct {
CanDirect bool `json:"can_direct" bson:"can_direct"`
CanCreateGroups bool `json:"can_create_groups" bson:"can_create_groups"`
} `json:"amojo_rights" bson:"amojo_rights"`
//Требуется GET параметр with. Массив объектов групп пользователей аккаунта
UsersGroups []struct {
ID int `json:"id" bson:"id"`
Name string `json:"name" bson:"name"`
UUID interface{} `json:"uuid" bson:"uuid"`
} `json:"users_groups" bson:"users_groups"`
TaskTypes []struct {
ID int `json:"id" bson:"id"`
Name string `json:"name" bson:"name"`
Color interface{} `json:"color" bson:"color"`
IconID interface{} `json:"icon_id" bson:"icon_id"`
Code string `json:"code" bson:"code"`
} `json:"task_types" bson:"task_types"`
// Требуется GET параметр with. Настройки названия сущностей
EntityNames struct {
Leads struct {
Ru struct {
Gender string `json:"gender" bson:"gender"`
PluralForm struct {
Dative string `json:"dative" bson:"dative"`
Default string `json:"default" bson:"default"`
Genitive string `json:"genitive" bson:"genitive"`
Accusative string `json:"accusative" bson:"accusative"`
Instrumental string `json:"instrumental" bson:"instrumental"`
Prepositional string `json:"prepositional" bson:"prepositional"`
} `json:"plural_form" bson:"plural_form"`
SingularForm struct {
Dative string `json:"dative" bson:"dative"`
Default string `json:"default" bson:"default"`
Genitive string `json:"genitive" bson:"genitive"`
Accusative string `json:"accusative" bson:"accusative"`
Instrumental string `json:"instrumental" bson:"instrumental"`
Prepositional string `json:"prepositional" bson:"prepositional"`
} `json:"singular_form" bson:"singular_form"`
} `json:"ru" bson:"ru"`
En struct {
SingularForm struct {
Default string `json:"default" bson:"default"`
} `json:"singular_form" bson:"singular_form"`
PluralForm struct {
Default string `json:"default" bson:"default"`
} `json:"plural_form" bson:"plural_form"`
Gender string `json:"gender" bson:"gender"`
} `json:"en" bson:"en"`
Es struct {
SingularForm struct {
Default string `json:"default" bson:"default"`
} `json:"singular_form" bson:"singular_form"`
PluralForm struct {
Default string `json:"default" bson:"default"`
} `json:"plural_form" bson:"plural_form"`
Gender string `json:"gender" bson:"gender"`
} `json:"es" bson:"es"`
} `json:"leads" bson:"leads"`
} `json:"entity_names" bson:"entity_names"`
DatetimeSettings struct {
DatePattern string `json:"date_pattern" bson:"date_pattern"`
ShortDatePattern string `json:"short_date_pattern" bson:"short_date_pattern"`
ShortTimePattern string `json:"short_time_pattern" bson:"short_time_pattern"`
DateFormant string `json:"date_formant" bson:"date_formant"`
TimeFormat string `json:"time_format" bson:"time_format"`
Timezone string `json:"timezone" bson:"timezone"`
TimezoneOffset string `json:"timezone_offset" bson:"timezone_offset"`
} `json:"datetime_settings" bson:"datetime_settings"`
} `json:"_embedded" bson:"_embedded"`
}
type LeadRights struct {
View string `json:"view"`
Edit string `json:"edit"`
Add string `json:"add"`
Delete string `json:"delete"`
Export string `json:"export"`
}
type ContactRights struct {
View string `json:"view"`
Edit string `json:"edit"`
Add string `json:"add"`
Delete string `json:"delete"`
Export string `json:"export"`
}
type CompanyRights struct {
View string `json:"view"`
Edit string `json:"edit"`
Add string `json:"add"`
Delete string `json:"delete"`
Export string `json:"export"`
}
type TaskRights struct {
Edit string `json:"edit"`
Delete string `json:"delete"`
}
type StatusRight struct {
EntityType string `json:"entity_type"`
PipelineID int `json:"pipeline_id"`
StatusID int `json:"status_id"`
Rights LeadRights `json:"rights"`
}
type OneUserInfo struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Lang string `json:"lang"`
Role *string `json:"role,omitempty"`
UUID *string `json:"uuid,omitempty"`
Rights Rights `json:"rights"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
} `json:"_links"`
}