Versions in this module Expand all Collapse all v1 v1.0.6 Jul 27, 2023 Changes in this version + type ActionType string + const ActionTypeFinished + const ActionTypeReopened + type AddCallDetailsRequest struct + CallStatus CallStatusType + DisconnectParty DisconnectPartyType + EndTime *time.Time + FileGUID string + Rating int + StartTime *time.Time + type AnnouncementComment struct + Attachments []*File + Author *Person + CreateDate time.Time + ID int + Text string + type AnnouncementCommentRequest struct + Attachments []*NewFile + Text string + func (r AnnouncementCommentRequest) Validate() error + type AnnouncementRequest struct + Attachments []*NewFile + Text string + func (r AnnouncementRequest) Validate() error + type AnnouncementResponse struct + Announcement *AnnouncementWithComments + type AnnouncementWithComments struct + Attachments []*File + Author *Person + Comments []*AnnouncementComment + CreateDate time.Time + ID int + Text string + type Approval struct + ApprovalChoice ChoiceType + Person *Person + Step int + type Attachment struct + AttachmentID int + GUID string + Name string + RootID int + URL string + func (a Attachment) Validate() error + type AuthResponse struct + AccessToken string + type CallEventType string + const CallEventTypeShow + type CallStatusType string + const CallStatusTypeAnswered + const CallStatusTypeBusy + const CallStatusTypeError + const CallStatusTypeNoAnswer + const CallStatusTypeOther + type CatalogHeader struct + Name string + Type CatalogHeaderType + type CatalogHeaderType string + const CatalogHeaderTypeText + const CatalogHeaderTypeWorkflow + type CatalogItem struct + Headers []string + ItemID int + ItemIDs []int + Rows [][]string + Values []string + type CatalogResponse struct + CatalogHeaders []*CatalogHeader + CatalogID int + Deleted bool + ExternalVersion int + Items []*CatalogItem + Name string + Supervisors []int + Version int + type CatalogsResponse struct + Catalogs []*CatalogResponse + type Channel struct + From *ChannelUser + To *ChannelUser + Type ChannelType + type ChannelType string + const ChannelTypeAmoCRM + const ChannelTypeEmail + const ChannelTypeFacebook + const ChannelTypeMobileApp + const ChannelTypeMoySklad + const ChannelTypeTelegram + const ChannelTypeVK + const ChannelTypeViber + const ChannelTypeWebWidget + const ChannelTypeZadarma + type ChannelUser struct + Email string + Name string + type CheckmarkType string + const CheckmarkTypeChecked + const CheckmarkTypeUnchecked + type ChoiceOption struct + ChoiceID int + ChoiceValue string + Deleted bool + Fields []*FormField + type ChoiceType string + const ChoiceTypeAcknowledged + const ChoiceTypeApproved + const ChoiceTypeRejected + const ChoiceTypeRevoked + const ChoiceTypeWaiting + type Client struct + func NewClient(login, securityKey string, opts ...Option) (*Client, error) + func (c *Client) AddCallDetails(callGUID string, req *AddCallDetailsRequest) error + func (c *Client) Announcement(announcementID int) (*AnnouncementResponse, error) + func (c *Client) Auth(login, securityKey string) (string, error) + func (c *Client) BlockMember(memberID int) (*Member, error) + func (c *Client) Catalog(catalogID int) (*CatalogResponse, error) + func (c *Client) Catalogs() (*CatalogsResponse, error) + func (c *Client) CommentAnnouncement(announcementID int, req *AnnouncementCommentRequest) (*AnnouncementResponse, error) + func (c *Client) CommentTask(taskID int, req *TaskCommentRequest) (*TaskResponse, error) + func (c *Client) Contacts(includeInactive bool) (*ContactsResponse, error) + func (c *Client) CreateAnnouncement(req *AnnouncementRequest) (*AnnouncementResponse, error) + func (c *Client) CreateCatalog(name string, headers []string, items []*CatalogItem) (*CatalogResponse, error) + func (c *Client) CreateMember(req *MemberRequest) (*Member, error) + func (c *Client) CreateRole(name string, members []int) (*Role, error) + func (c *Client) CreateTask(req *TaskRequest) (*TaskResponse, error) + func (c *Client) DownloadFile(fileID int) (*DownloadResponse, error) + func (c *Client) Form(formID int) (*FormResponse, error) + func (c *Client) Forms() (*FormsResponse, error) + func (c *Client) Inbox(itemCount int) (*TaskListResponse, error) + func (c *Client) Lists() (*ListsResponses, error) + func (c *Client) Members() (*MembersResponse, error) + func (c *Client) Profile() (*ProfileResponse, error) + func (c *Client) RegisterCall(req *RegisterCallRequest) (*RegisterCallResponse, error) + func (c *Client) RegisterCallEvent(callGUID string, eventType CallEventType, extension string) error + func (c *Client) Registry(formID int, req *RegistryRequest) (*FormRegisterResponse, error) + func (c *Client) Roles() (*RolesResponse, error) + func (c *Client) SyncCatalog(catalogID int, apply bool, headers []string, items []*CatalogItem) (*SyncCatalogResponse, error) + func (c *Client) Task(taskID int) (*TaskResponse, error) + func (c *Client) TaskList(listID, itemCount int, includeArchived bool) (*TaskListResponse, error) + func (c *Client) UpdateMember(memberID int, req *MemberRequest) (*Member, error) + func (c *Client) UpdateRole(roleID int, name string, add, remove []int, banned bool) (*Role, error) + func (c *Client) UploadFile(name string, file io.Reader) (*UploadResponse, error) + func (c *Client) WebhookHandler() (http.HandlerFunc, <-chan Event) + type ContactsResponse struct + Organizations []*Organization + type DisconnectPartyType string + const DisconnectPartyTypeAgent + const DisconnectPartyTypeClient + const DisconnectPartyTypeError + const DisconnectPartyTypeOther + type DownloadResponse struct + Filename string + RawFile []byte + type Error struct + Code ErrorCode + Description string + Message string + func (e Error) Error() string + type ErrorCode string + const ErrAccessDeniedCatalog + const ErrAccessDeniedCloseTask + const ErrAccessDeniedForm + const ErrAccessDeniedPerson + const ErrAccessDeniedProject + const ErrAccessDeniedReopenTask + const ErrAccessDeniedTask + const ErrAccountBlocked + const ErrAuthorizationError + const ErrBadMultipartContent + const ErrCanNotModifyDeletedCatalog + const ErrCanNotModifyFirstColumn + const ErrCannotAddExternalUser + const ErrCannotAddFormProject + const ErrCatalogDuplicateHeaders + const ErrCatalogDuplicateRows + const ErrCatalogHeadersItemsMismatch + const ErrCatalogIdentityMissing + const ErrCatalogItemIDMissing + const ErrCatalogItemIDNameMismatch + const ErrCatalogItemMaxLengthExceeded + const ErrDeletedField + const ErrDepartmentCatalogCanNotBeModified + const ErrDueMissing + const ErrDuplicateField + const ErrDurationIsTooLong + const ErrEitherDueDateOrDueCanBeSet + const ErrEmptyBody + const ErrEmptyCatalogHeaders + const ErrEmptyFile + const ErrExpiredToken + const ErrFieldIdentityMissing + const ErrFieldIsInTable + const ErrFilterTypeIsNotSupported + const ErrFormHasNoTask + const ErrFormIDMissing + const ErrFormTemplateCantBeRemovedFromTask + const ErrIncorrectParametersCount + const ErrInvalidCatalogID + const ErrInvalidCatalogItemID + const ErrInvalidCatalogItemName + const ErrInvalidCredentials + const ErrInvalidEmail + const ErrInvalidFieldID + const ErrInvalidFieldIDName + const ErrInvalidFieldName + const ErrInvalidJSON + const ErrInvalidPersonID + const ErrInvalidPersonIDEmail + const ErrInvalidStepNumber + const ErrInvalidTableRow + const ErrInvalidToken + const ErrInvalidValueFormat + const ErrNegativeDuration + const ErrNoFileInRequest + const ErrNonUniqueCatalogItemName + const ErrNonUniqueEmail + const ErrNonUniqueName + const ErrPersonIdentityMissing + const ErrRequiredFieldMissing + const ErrRequiredParameterMissing + const ErrRequiredTableFieldMissing + const ErrRevokedToken + const ErrScheduledDateInPast + const ErrServerError + const ErrStepFieldDoesNotExists + const ErrTaskLimitExceeded + const ErrTextMissing + const ErrTokenNotSpecified + const ErrTooLargeRequestLength + const ErrTooManyCatalogItems + const ErrTooManyComments + const ErrTooManyRequests + const ErrTooManyTaskSteps + const ErrTypeIsNotSupported + const ErrUnrecognizedAttachmentID + const ErrUnrecognizedCallGUID + const ErrUnrecognizedIntegrationGUID + const ErrUnsupportedAttachmentFormat + type Event struct + AccessToken string + Event string + Task *TaskWithComments + TaskID int + UserID int + type FieldType string + const FieldTypeAuthor + const FieldTypeCatalog + const FieldTypeCheckmark + const FieldTypeCreationDate + const FieldTypeDate + const FieldTypeDueDate + const FieldTypeDueDateTime + const FieldTypeEmail + const FieldTypeFile + const FieldTypeFlag + const FieldTypeFormLink + const FieldTypeMoney + const FieldTypeMultipleChoice + const FieldTypeNote + const FieldTypeNumber + const FieldTypePerson + const FieldTypePhone + const FieldTypeProject + const FieldTypeStatus + const FieldTypeStep + const FieldTypeTable + const FieldTypeText + const FieldTypeTime + const FieldTypeTitle + type File struct + ID int + MD5 string + Name string + RootID int + Size int + URL string + Version int + type FlagType string + const FlagTypeChecked + const FlagTypeNone + const FlagTypeUnchecked + type FormField struct + ID int + Info *FormFieldInfo + Name string + ParentID int + RowID int + Type FieldType + Value interface{} + func (f *FormField) UnmarshalJSON(b []byte) error + func (f FormField) Validate() error + type FormFieldInfo struct + CatalogID int + Code string + Columns []*FormField + DecimalPlaces int + Fields []*FormField + ImmutableStep int + MultipleChoice bool + Options []*ChoiceOption + RequiredStep int + type FormLink struct + Subject string + TaskIDs []int + type FormRegisterResponse struct + CSV string + Tasks []*Task + type FormResponse struct + DeletedOrClosed bool + Fields []*FormField + Folder []string + ID int + Name string + PrintForms []PrintForm + Steps map[int]string + type FormsResponse struct + Forms []*FormResponse + type IClient interface + AddCallDetails func(callGUID string, req *AddCallDetailsRequest) error + Announcement func(announcementID int) (*AnnouncementResponse, error) + Auth func(login, securityKey string) (string, error) + BlockMember func(memberID int) (*Member, error) + Catalog func(catalogID int) (*CatalogResponse, error) + Catalogs func() (*CatalogsResponse, error) + CommentAnnouncement func(announcementID int, req *AnnouncementCommentRequest) (*AnnouncementResponse, error) + CommentTask func(taskID int, req *TaskCommentRequest) (*TaskResponse, error) + Contacts func(includeInactive bool) (*ContactsResponse, error) + CreateAnnouncement func(req *AnnouncementRequest) (*AnnouncementResponse, error) + CreateCatalog func(name string, headers []string, items []*CatalogItem) (*CatalogResponse, error) + CreateMember func(req *MemberRequest) (*Member, error) + CreateRole func(name string, members []int) (*Role, error) + CreateTask func(req *TaskRequest) (*TaskResponse, error) + DownloadFile func(fileID int) (*DownloadResponse, error) + Form func(formID int) (*FormResponse, error) + Forms func() (*FormsResponse, error) + Inbox func(itemCount int) (*TaskListResponse, error) + Lists func() (*ListsResponses, error) + Members func() (*MembersResponse, error) + Profile func() (*ProfileResponse, error) + RegisterCall func(req *RegisterCallRequest) (*RegisterCallResponse, error) + RegisterCallEvent func(callGUID string, eventType CallEventType, extension string) error + Registry func(formID int, req *RegistryRequest) (*FormRegisterResponse, error) + Roles func() (*RolesResponse, error) + SyncCatalog func(catalogID int, apply bool, headers []string, items []*CatalogItem) (*SyncCatalogResponse, error) + Task func(taskID int) (*TaskResponse, error) + TaskList func(listID, itemCount int, includeArchived bool) (*TaskListResponse, error) + UpdateMember func(memberID int, req *MemberRequest) (*Member, error) + UpdateRole func(roleID int, name string, add, remove []int, banned bool) (*Role, error) + UploadFile func(name string, file io.Reader) (*UploadResponse, error) + WebhookHandler func() (http.HandlerFunc, <-chan Event) + type ListsResponses struct + Lists []*TaskList + type Logger interface + Error func(msg string, err error) + type Member struct + Banned bool + DepartmentID int + DepartmentName string + Email string + ExternalID string + FirstName string + ID int + LastName string + Phone string + Position string + Skype string + Type PersonType + type MemberRequest struct + DepartmentID int + Email string + FirstName string + LastName string + Phone string + Position string + Skype string + type MembersResponse struct + Members []*Member + type MultipleChoice struct + ChoiceID int + ChoiceIDs []int + ChoiceNames []string + Fields []*FormField + type NewFile struct + AttachmentID int + GUID string + Name string + RootID int + URL string + type Option func(*Client) + func WithBaseURL(baseURL string) Option + func WithEventBufferSize(size int) Option + func WithHTTPClient(hc *http.Client) Option + func WithLogger(l Logger) Option + func WithZapLogger(l *zap.Logger) Option + type Organization struct + DepartmentCatalogID int + ID int + Name string + Persons []*Person + Roles []*Role + type Person struct + DepartmentID int + DepartmentName string + Email string + FirstName string + ID int + LastName string + Type PersonType + func (p Person) Validate() error + type PersonType string + const PersonTypeBot + const PersonTypeRole + const PersonTypeUser + type PrintForm struct + ID int + Name string + type ProfileResponse struct + Email string + FirstName string + LastName string + Locale string + OrganizationID int + PersonID int + type RegisterCallRequest struct + CallGUID string + Extension string + From string + IntegrationGUID string + TaskID int + To string + func (r RegisterCallRequest) Validate() error + type RegisterCallResponse struct + CallGUID string + TaskID string + type RegistryRequest struct + ClosedAfter *time.Time + ClosedBefore *time.Time + CreatedAfter *time.Time + CreatedBefore *time.Time + Delimiter string + Encoding string + FieldFilters map[int]string + FieldIDs []int + Format string + IncludeArchived bool + ModifiedAfter *time.Time + ModifiedBefore *time.Time + SimpleFormat bool + Steps int + TaskIDs []int + func (r *RegistryRequest) MarshalJSON() ([]byte, error) + type Role struct + Banned bool + ExternalID int + ID int + MemberIDs []int + Name string + type RolesResponse struct + Roles []*Role + type StatusType string + const StatusTypeClosed + const StatusTypeOpen + type Subscriber struct + ApprovalChoice ChoiceType + Person *Person + type SyncCatalogResponse struct + Added []*CatalogItem + Apply bool + CatalogHeaders []*CatalogHeader + Deleted []*CatalogItem + Updated []*CatalogItem + type Table []*TableRow + type TableRow struct + Cells []*FormField + Delete bool + RowID int + type Task struct + Approvals [][]*Approval + Attachments []*File + CurrentStep int + Due *time.Time + DueDate string + Duration int + Fields []*FormField + FormID int + LastNoteID int + LinkedTaskIDs []int + ListIDs []int + ParentTaskID int + Participants []*Person + ScheduledDate string + ScheduledDatetimeUTC *time.Time + Subject string + Subscribers []*Subscriber + type TaskComment struct + Action ActionType + AddedListIDs []int + ApprovalChoice ChoiceType + ApprovalStep int + ApprovalsAdded [][]*Approval + ApprovalsRemoved [][]*Approval + ApprovalsRerequested [][]*Approval + Attachments []*File + Author *Person + CancelSchedule bool + ChangedStep int + Channel *Channel + CommentAsRoles []*Role + CreateDate time.Time + Due *time.Time + DueDate string + Duration int + FieldUpdates []*FormField + ID int + Mentions []int + ParticipantsAdded []*Person + ParticipantsRemoved []*Person + ReassignedTo *Person + RemovedListIDs []int + ReplyNoteID *int + ResetToStep int + ScheduledDate string + ScheduledDatetimeUTC *time.Time + SkipSatisfaction bool + SpentMinutes int + Subject string + SubscribersAdded []*Person + SubscribersRemoved []*Person + SubscribersRerequested []*Person + Text string + type TaskCommentRequest struct + Action ActionType + AddedListIDs []int + ApprovalChoice ChoiceType + ApprovalsAdded [][]*Person + ApprovalsRemoved [][]*Person + ApprovalsRerequested [][]*Person + Attachments []*Attachment + CancelSchedule bool + Channel *Channel + Due *time.Time + DueDate string + Duration int + FieldUpdates []*FormField + ParticipantsAdded []*Person + ParticipantsRemoved []*Person + ReassignTo *Person + RemovedListIDs []int + ScheduledDate string + ScheduledDatetimeUTC *time.Time + SpentMinutes int + Subject string + SubscribersAdded []*Person + SubscribersRemoved []*Person + SubscribersRerequested []*Person + Text string + func (r TaskCommentRequest) Validate() error + type TaskHeader struct + Author *Person + CloseDate *time.Time + CreateDate time.Time + DueDate string + ID int + LastModifiedDate *time.Time + Responsible *Person + Text string + type TaskList struct + Children []*TaskList + ID int + Name string + type TaskListResponse struct + HasMode bool + Tasks []*TaskHeader + type TaskRequest struct + Approvals [][]*Person + Attachments []*Attachment + Due *time.Time + DueDate string + Duration int + Fields []*FormField + FillDefaults bool + FormID int + ListIDs []int + ParentTaskID int + Participants []*Person + Responsible *Person + ScheduledDate string + ScheduledDatetimeUTC *time.Time + Subject string + Subscribers []*Person + Text string + func (r TaskRequest) Validate() error + type TaskResponse struct + Task *TaskWithComments + type TaskWithComments struct + Comments []*TaskComment + type Title struct + Checkmark CheckmarkType + Fields []*FormField + type UploadResponse struct + GUID string + MD5Hash string