amocrm/internal/models/getUserList.go
2024-04-20 22:02:13 +03:00

117 lines
2.8 KiB
Go

package models
type RequestGetListUsers struct {
Page int
Limit int
}
type ResponseGetListUsers struct {
TotalItems int `json:"_total_items"`
Links LinksSelf `json:"_links"`
Embedded EmbeddedGetListUsers `json:"_embedded"`
}
type EmbeddedGetListUsers struct {
Users []Users `json:"items"`
}
type SelfLink struct {
Href string `json:"href"`
}
type LinksSelf struct {
Self SelfLink `json:"self"`
}
type Users struct {
ID int32 `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
UUID string `json:"uuid"`
IsConfirmed bool `json:"is_confirmed"`
ConfirmLinkSentAt int `json:"confirm_link_sent_at"`
Lang string `json:"lang"`
FullName string `json:"full_name"`
Groups []Groups `json:"groups"`
Links SelfLink `json:"_links"`
Rights Rights `json:"_embedded"`
}
type Rights struct {
Leads `json:"leads"`
Contacts `json:"contacts"`
Companies `json:"companies"`
Tasks `json:"tasks"`
MailAccess bool `json:"mail_access"`
CatalogAccess bool `json:"catalog_access"`
StatusRights []StatusRights `json:"status_rights"`
IsAdmin bool `json:"is_admin"`
IsFree bool `json:"is_free"`
IsActive bool `json:"is_active"`
GroupID int `json:"group_id,omitempty"`
RoleID int `json:"role_id,omitempty"`
Role string `json:"role,omitempty"`
}
type Leads struct {
View string `json:"view"`
Edit string `json:"edit"`
Add string `json:"add"`
Delete string `json:"delete"`
Export string `json:"export"`
}
type Contacts struct {
View string `json:"view"`
Edit string `json:"edit"`
Add string `json:"add"`
Delete string `json:"delete"`
Export string `json:"export"`
}
type Companies struct {
View string `json:"view"`
Edit string `json:"edit"`
Add string `json:"add"`
Delete string `json:"delete"`
Export string `json:"export"`
}
type Tasks struct {
Edit string `json:"edit"`
Delete string `json:"delete"`
}
type StatusRights struct {
EntityType string `json:"entity_type"`
PipelineID int `json:"pipeline_id"`
StatusID int `json:"status_id"`
Rights RightsGetListUsers `json:"rights"`
}
type RightsGetListUsers struct {
View string `json:"view"`
Edit string `json:"edit"`
Delete string `json:"delete"`
}
type Roles struct {
ID int `json:"id"`
Name string `json:"name"`
Links SelfLink `json:"_links"`
}
type Groups struct {
ID int `json:"id"`
Name string `json:"name"`
}
//type Embedded struct {
// Roles []Roles `json:"roles"`
// Groups []Groups `json:"groups"`
//}
type Embedded struct {
Rights Rights `json:"rights"`
}