redmine

package module
v5.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 12 Imported by: 2

README

nxs-go-redmine

Introduction

Go client library for Redmine

Features
New in nxs-go-redmine v5
  • All implemented method updated to work with latest Redmine API version
  • All fields that may be omitted are now pointers
  • Replaced all IDs from int to int64
  • Includes for methods now are specified with named constants
  • Added tools to operate with filters and sorts
Who can use the tool

Developer teams or sysadmins who need to automate a business processes that works around Redmine.

Quickstart

Import
import "github.com/nixys/nxs-go-redmine/v5"
Initialize

To initialize this library you need to do:

  • Initialize context via call redmine.Init() function with specified values of Redmine endpoint and API key

After thar you be able to use all available methods to interact with Redmine API.

Example

In the example below will be printed a names for all active projects from Redmine

package main

import (
	"fmt"
	"os"

	redmine "github.com/nixys/nxs-go-redmine/v5"
)

func main() {

	// Get variables from environment for connect to Redmine server
	rdmnHost := os.Getenv("REDMINE_HOST")
	rdmnAPIKey := os.Getenv("REDMINE_API_KEY")
	if rdmnHost == "" || rdmnAPIKey == "" {
		fmt.Println("Init error: make sure environment variables `REDMINE_HOST` and `REDMINE_API_KEY` are defined")
		os.Exit(1)
	}

	r := redmine.Init(
		redmine.Settings{
			Endpoint: rdmnHost,
			APIKey:   rdmnAPIKey,
		},
	)

	fmt.Println("Init: success")

	// Get all active projects with additional 
	// fields (trackers, categories and modules)
	p, _, err := r.ProjectAllGet(
		redmine.ProjectAllGetRequest{
			Includes: []redmine.ProjectInclude{
				redmine.ProjectIncludeTrackers,
				redmine.ProjectIncludeIssueCategories,
				redmine.ProjectIncludeEnabledModules,
			},
			Filters: redmine.ProjectGetRequestFiltersInit().
				StatusSet(redmine.ProjectStatusActive),
		})
	if err != nil {
		fmt.Println("Projects get error:", err)
		os.Exit(1)
	}

	fmt.Println("Projects:")
	for _, e := range p.Projects {
		fmt.Println("-", e.Name)
	}
}

Run:

REDMINE_HOST="https://redmine.yourdomain.com" REDMINE_API_KEY="YOUR_API_KEY" go run main.go

For more examples see apps based on this library:

Roadmap

Following features are already in backlog for our development team and will be released soon:

  • Implement more Redmine API methods (let us know which one you want to see at first)
  • Improve error handling in the library

Feedback

For support and feedback please contact me:

License

nxs-go-redmine is released under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(v bool) *bool

func Int64Ptr

func Int64Ptr(v int64) *int64

func StringPtr

func StringPtr(v string) *string

Types

type AttachmentObject

type AttachmentObject struct {
	ID           int64  `json:"id"`
	FileName     string `json:"filename"`
	FileSize     string `json:"filesize"`
	ContentType  string `json:"content_type"`
	Description  string `json:"description"`
	ContentURL   string `json:"content_url"`
	ThumbnailURL string `json:"thumbnail_url"`
	Author       IDName `json:"author"`
	CreatedOn    string `json:"created_on"`
}

AttachmentObject struct used for attachments get operations

type AttachmentUploadObject

type AttachmentUploadObject struct {
	ID          *int64 `json:"id,omitempty"`
	Token       string `json:"token"`
	Filename    string `json:"filename"`     // This field fills in AttachmentUpload() function, not by Redmine. User can redefine this value manually
	ContentType string `json:"content_type"` // This field fills in AttachmentUpload() function, not by Redmine. User can redefine this value manually
}

AttachmentUploadObject struct used for attachments upload operations

type Context

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

Context struct used for store settings to communicate with Redmine API

func Init

func Init(s Settings) *Context

func (*Context) AttachmentDownload

func (r *Context) AttachmentDownload(id int64, dstPath string) (AttachmentObject, StatusCode, error)

func (*Context) AttachmentDownloadStream

func (r *Context) AttachmentDownloadStream(id int64) (io.ReadCloser, AttachmentObject, StatusCode, error)

func (*Context) AttachmentSingleGet

func (r *Context) AttachmentSingleGet(id int64) (AttachmentObject, StatusCode, error)

AttachmentSingleGet gets single attachment info

see: https://www.redmine.org/projects/redmine/wiki/Rest_Attachments#GET

func (*Context) AttachmentUpload

func (r *Context) AttachmentUpload(filePath string) (AttachmentUploadObject, StatusCode, error)

AttachmentUpload uploads file

see: https://www.redmine.org/projects/redmine/wiki/Rest_api#Attaching-files

func (*Context) AttachmentUploadStream

func (r *Context) AttachmentUploadStream(f io.Reader, fileName string) (AttachmentUploadObject, StatusCode, error)

AttachmentUploadStream uploads file as a stream.

func (*Context) CustomFieldAllGet

func (r *Context) CustomFieldAllGet() ([]CustomFieldObject, StatusCode, error)

CustomFieldAllGet gets info for all custom fields

see: https://www.redmine.org/projects/redmine/wiki/Rest_CustomFields#GET

func (*Context) Del

func (r *Context) Del(in interface{}, out interface{}, uri url.URL, statusExpected StatusCode) (StatusCode, error)

func (*Context) EnumerationDocumentCategoriesAllGet

func (r *Context) EnumerationDocumentCategoriesAllGet() ([]EnumerationDocumentCategoryObject, StatusCode, error)

EnumerationDocumentCategoriesAllGet gets info for all document category enumerations

see: https://www.redmine.org/projects/redmine/wiki/Rest_Enumerations#GET-3

func (*Context) EnumerationPrioritiesAllGet

func (r *Context) EnumerationPrioritiesAllGet() ([]EnumerationPriorityObject, StatusCode, error)

EnumerationPrioritiesAllGet gets info for all priority enumerations

see: https://www.redmine.org/projects/redmine/wiki/Rest_Enumerations#GET

func (*Context) EnumerationTimeEntryActivitiesAllGet

func (r *Context) EnumerationTimeEntryActivitiesAllGet() ([]EnumerationTimeEntryActivityObject, StatusCode, error)

EnumerationTimeEntryActivitiesAllGet gets info for all time entry activity enumerations

see: https://www.redmine.org/projects/redmine/wiki/Rest_Enumerations#GET-2

func (*Context) Get

func (r *Context) Get(out interface{}, uri url.URL, statusExpected StatusCode) (StatusCode, error)

func (*Context) GroupAddUser

func (r *Context) GroupAddUser(id int64, group GroupAddUserObject) (StatusCode, error)

GroupAddUser adds new user into group with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#POST-2

func (*Context) GroupAllGet

func (r *Context) GroupAllGet() (GroupResult, StatusCode, error)

GroupAllGet gets info for all groups

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#GET

func (*Context) GroupCreate

func (r *Context) GroupCreate(group GroupCreate) (GroupObject, StatusCode, error)

GroupCreate creates new group

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#POST

func (*Context) GroupDelete

func (r *Context) GroupDelete(id int64) (StatusCode, error)

GroupDelete deletes group with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#DELETE

func (*Context) GroupDeleteUser

func (r *Context) GroupDeleteUser(id int64, userID int64) (StatusCode, error)

GroupDeleteUser deletes user from group with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#DELETE-2

func (*Context) GroupMultiGet

func (r *Context) GroupMultiGet(request GroupMultiGetRequest) (GroupResult, StatusCode, error)

GroupMultiGet gets info for multiple groups

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#GET

func (*Context) GroupSingleGet

func (r *Context) GroupSingleGet(id int64, request GroupSingleGetRequest) (GroupObject, StatusCode, error)

GroupSingleGet gets single group info by specific ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#GET-2

func (*Context) GroupUpdate

func (r *Context) GroupUpdate(id int64, group GroupUpdate) (StatusCode, error)

GroupUpdate updates group with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Groups#PUT

func (*Context) IssueCreate

func (r *Context) IssueCreate(issue IssueCreate) (IssueObject, StatusCode, error)

IssueCreate creates new issue

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Creating-an-issue

func (*Context) IssueDelete

func (r *Context) IssueDelete(id int64) (StatusCode, error)

IssueDelete deletes issue with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Deleting-an-issue

func (*Context) IssueSingleGet

func (r *Context) IssueSingleGet(id int64, request IssueSingleGetRequest) (IssueObject, StatusCode, error)

IssueSingleGet gets single issue info

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Showing-an-issue

func (*Context) IssueStatusAllGet

func (r *Context) IssueStatusAllGet() ([]IssueStatusObject, StatusCode, error)

IssueStatusAllGet gets info for all issue statuses

see: https://www.redmine.org/projects/redmine/wiki/Rest_IssueStatuses#GET

func (*Context) IssueUpdate

func (r *Context) IssueUpdate(id int64, issue IssueUpdate) (StatusCode, error)

IssueUpdate updates issue with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Updating-a-project

func (*Context) IssueWatcherAdd

func (r *Context) IssueWatcherAdd(id int64, userID int64) (StatusCode, error)

IssueWatcherAdd adds watcher into issue with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Adding-a-watcher

func (*Context) IssueWatcherDelete

func (r *Context) IssueWatcherDelete(id int64, userID int64) (StatusCode, error)

IssueWatcherDelete deletes watcher from issue with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Removing-a-watcher

func (*Context) IssuesAllGet

func (r *Context) IssuesAllGet(request IssueAllGetRequest) (IssueResult, StatusCode, error)

IssuesAllGet gets info for all issues satisfying specified filters

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Listing-issues

func (*Context) IssuesMultiGet

func (r *Context) IssuesMultiGet(request IssueMultiGetRequest) (IssueResult, StatusCode, error)

IssuesMultiGet gets info for multiple issues satisfying specified filters

see: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Listing-issues

func (*Context) MembershipAdd

func (r *Context) MembershipAdd(projectID string, membership MembershipAdd) (MembershipObject, StatusCode, error)

MembershipAdd adds new member to project with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#POST

func (*Context) MembershipAllGet

func (r *Context) MembershipAllGet(projectID string) (MembershipResult, StatusCode, error)

MembershipAllGet gets info for all memberships for project with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#GET

func (*Context) MembershipDelete

func (r *Context) MembershipDelete(membershipID int64) (StatusCode, error)

MembershipDelete deletes project membership with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#DELETE

func (*Context) MembershipMultiGet

func (r *Context) MembershipMultiGet(projectID string, request MembershipMultiGetRequest) (MembershipResult, StatusCode, error)

MembershipMultiGet gets info for multiple memberships for project with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#GET

func (*Context) MembershipSingleGet

func (r *Context) MembershipSingleGet(membershipID int64) (MembershipObject, StatusCode, error)

MembershipSingleGet gets single project membership info with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#GET-2

func (*Context) MembershipUpdate

func (r *Context) MembershipUpdate(membershipID int64, membership MembershipUpdate) (StatusCode, error)

MembershipUpdate updates project membership with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#PUT

func (*Context) Post

func (r *Context) Post(in interface{}, out interface{}, uri url.URL, statusExpected StatusCode) (StatusCode, error)

func (*Context) ProjectAllGet

func (r *Context) ProjectAllGet(request ProjectAllGetRequest) (ProjectResult, StatusCode, error)

ProjectAllGet gets info for all projects

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Listing-projects

func (*Context) ProjectArchive

func (r *Context) ProjectArchive(id string) (StatusCode, error)

ProjectArchive archives a project (available since Redmine 5.0)

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Archiving-a-project

func (*Context) ProjectCreate

func (r *Context) ProjectCreate(project ProjectCreate) (ProjectObject, StatusCode, error)

ProjectCreate creates new project

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Creating-a-project

func (*Context) ProjectDelete

func (r *Context) ProjectDelete(id string) (StatusCode, error)

ProjectDelete deletes project with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Deleting-a-project

func (*Context) ProjectMultiGet

func (r *Context) ProjectMultiGet(request ProjectMultiGetRequest) (ProjectResult, StatusCode, error)

ProjectMultiGet gets info for multiple projects

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Listing-projects

func (*Context) ProjectSingleGet

func (r *Context) ProjectSingleGet(id string, request ProjectSingleGetRequest) (ProjectObject, StatusCode, error)

ProjectSingleGet gets single project info with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Showing-a-project

func (*Context) ProjectUnarchive

func (r *Context) ProjectUnarchive(id string) (StatusCode, error)

ProjectUnarchive unarchives a project (available since Redmine 5.0)

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Unarchiving-a-project

func (*Context) ProjectUpdate

func (r *Context) ProjectUpdate(id string, project ProjectUpdate) (StatusCode, error)

ProjectUpdate updates project with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Projects#Updating-a-project

func (*Context) Put

func (r *Context) Put(in interface{}, out interface{}, uri url.URL, statusExpected StatusCode) (StatusCode, error)

func (*Context) SetAPIKey

func (r *Context) SetAPIKey(apiKey string)

SetAPIKey is used to set Redmine API key

func (*Context) SetEndpoint

func (r *Context) SetEndpoint(endpoint string)

SetEndpoint is used to set Redmine endpoint

func (*Context) TimeEntryAllGet added in v5.1.0

func (r *Context) TimeEntryAllGet(request TimeEntryAllGetRequest) (TimeEntryResult, StatusCode, error)

TimeEntryAllGet gets info for all time entries satisfying specified filters

see: https://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries#Listing-time-entries

func (*Context) TimeEntryCreate added in v5.1.0

func (r *Context) TimeEntryCreate(timeEntry TimeEntryCreate) (TimeEntryObject, StatusCode, error)

TimeEntryCreate creates new time entry

see: https://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries#Creating-a-time-entry

func (*Context) TimeEntryDelete added in v5.1.0

func (r *Context) TimeEntryDelete(id int64) (StatusCode, error)

TimeEntryDelete deletes time entry with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries#Updating-a-time-entry

func (*Context) TimeEntrySingleGet added in v5.1.0

func (r *Context) TimeEntrySingleGet(id int64, request TimeEntrySingleGetRequest) (TimeEntryObject, StatusCode, error)

TimeEntrySingleGet gets single time entry info by specific ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries#Showing-a-time-entry

func (*Context) TimeEntryUpdate added in v5.1.0

func (r *Context) TimeEntryUpdate(id int64, timeEntry TimeEntryUpdate) (StatusCode, error)

TimeEntryUpdate updates time entry with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries#Updating-a-time-entry

func (*Context) TrackerAllGet

func (r *Context) TrackerAllGet() ([]TrackerObject, StatusCode, error)

TrackerAllGet gets info for all trackers

see: https://www.redmine.org/projects/redmine/wiki/Rest_Trackers#GET

func (*Context) UserAllGet

func (r *Context) UserAllGet(request UserAllGetRequest) (UserResult, StatusCode, error)

UserAllGet gets info for all users satisfying specified filters

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#GET

func (*Context) UserCreate

func (r *Context) UserCreate(user UserCreate) (UserObject, StatusCode, error)

UserCreate creates new user

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#POST

func (*Context) UserCurrentGet

func (r *Context) UserCurrentGet(request UserCurrentGetRequest) (UserObject, StatusCode, error)

UserCurrentGet gets current user info

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#GET-2

func (*Context) UserDelete

func (r *Context) UserDelete(id int64) (StatusCode, error)

UserDelete deletes user with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#DELETE

func (*Context) UserMultiGet

func (r *Context) UserMultiGet(request UserMultiGetRequest) (UserResult, StatusCode, error)

UserMultiGet gets info for multiple users satisfying specified filters

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#GET

func (*Context) UserSingleGet

func (r *Context) UserSingleGet(id int64, request UserSingleGetRequest) (UserObject, StatusCode, error)

UserSingleGet gets single user info by specific ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#GET-2

func (*Context) UserUpdate

func (r *Context) UserUpdate(id int64, user UserUpdate) (StatusCode, error)

UserUpdate updates user with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_Users#PUT

func (*Context) WikiAllGet

func (r *Context) WikiAllGet(projectID string) ([]WikiMultiObject, StatusCode, error)

WikiAllGet gets info for all wikies for project with specified ID

see: https://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Getting-the-pages-list-of-a-wiki

func (*Context) WikiCreate

func (r *Context) WikiCreate(projectID, wikiTitle string, wiki WikiCreate) (WikiObject, StatusCode, error)

WikiCreate creates new wiki

see: https://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Creating-or-updating-a-wiki-page

func (*Context) WikiDelete

func (r *Context) WikiDelete(projectID, wikiTitle string) (StatusCode, error)

WikiDelete deletes wiki with specified project ID and title

see: https://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Deleting-a-wiki-page

func (*Context) WikiSingleGet

func (r *Context) WikiSingleGet(projectID, wikiTitle string, request WikiSingleGetRequest) (WikiObject, StatusCode, error)

WikiSingleGet gets single wiki info by specific project ID and wiki title

see: https://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Getting-a-wiki-page

func (*Context) WikiSingleVersionGet

func (r *Context) WikiSingleVersionGet(projectID, wikiTitle string, version int64, request WikiSingleGetRequest) (WikiObject, StatusCode, error)

WikiSingleVersionGet gets single wiki info by specific project ID, wiki title and version

see: https://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Getting-an-old-version-of-a-wiki-page

func (*Context) WikiUpdate

func (r *Context) WikiUpdate(projectID, wikiTitle string, wiki WikiUpdate) (StatusCode, error)

WikiUpdate updates wiki page

see: https://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Creating-or-updating-a-wiki-page

type CustomFieldGetObject

type CustomFieldGetObject struct {
	ID       int64     `json:"id"`
	Name     string    `json:"name"`
	Multiple *bool     `json:"multiple"`
	Value    *[]string `json:"value"`
}

CustomFieldGetObject struct used for custom fields get operations in other methods

type CustomFieldObject

type CustomFieldObject struct {
	ID             int64                             `json:"id"`
	Name           string                            `json:"name"`
	CustomizedType string                            `json:"customized_type"`
	FieldFormat    string                            `json:"field_format"`
	Regexp         string                            `json:"regexp"`
	MinLength      int64                             `json:"min_length"`
	MaxLength      int64                             `json:"max_length"`
	IsRequired     bool                              `json:"is_required"`
	IsFilter       bool                              `json:"is_filter"`
	Searchable     bool                              `json:"searchable"`
	Multiple       bool                              `json:"multiple"`
	DefaultValue   *string                           `json:"default_value"`
	Visible        bool                              `json:"visible"`
	Trackers       []IDName                          `json:"trackers"`
	PossibleValues *[]CustomFieldPossibleValueObject `json:"possible_values"`
	Roles          []IDName                          `json:"roles"`
}

CustomFieldObject struct used for custom fields get operations

type CustomFieldPossibleValueObject

type CustomFieldPossibleValueObject struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

CustomFieldPossibleValueObject struct used for custom fields get operations

type CustomFieldUpdateObject

type CustomFieldUpdateObject struct {
	ID    int64       `json:"id"`
	Value interface{} `json:"value"` // can be a string or strings slice
}

CustomFieldUpdateObject struct used for custom fields insert and update operations in other methods

type EnumerationDocumentCategoryObject

type EnumerationDocumentCategoryObject struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	IsDefault bool   `json:"is_default"`
	Active    bool   `json:"active"`
}

EnumerationDocumentCategoryObject struct used for document categories get operations

type EnumerationPriorityObject

type EnumerationPriorityObject struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	IsDefault bool   `json:"is_default"`
	Active    bool   `json:"active"`
}

EnumerationPriorityObject struct used for priorities get operations

type EnumerationTimeEntryActivityObject

type EnumerationTimeEntryActivityObject struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	IsDefault bool   `json:"is_default"`
	Active    bool   `json:"active"`
}

EnumerationTimeEntryActivityObject struct used for time entry activities get operations

type GroupAddUserObject

type GroupAddUserObject struct {
	UserID int64 `json:"user_id"`
}

GroupAddUserObject struct used for add new user into group

type GroupCreate

type GroupCreate struct {
	Group GroupCreateObject `json:"group"`
}

GroupCreate struct used for groups create operations

type GroupCreateObject

type GroupCreateObject struct {
	Name    string   `json:"name"`
	UserIDs *[]int64 `json:"user_ids,omitempty"`
}

type GroupInclude

type GroupInclude string
const (
	GroupIncludeUsers       GroupInclude = "users"       // used only: get single user
	GroupIncludeMemberships GroupInclude = "memberships" // used only: get single user
)

func (GroupInclude) String

func (gi GroupInclude) String() string

type GroupMembershipObject

type GroupMembershipObject struct {
	ID      int64    `json:"id"`
	Project IDName   `json:"project"`
	Roles   []IDName `json:"roles"`
}

GroupMembershipObject struct used for groups get operations

type GroupMultiGetRequest

type GroupMultiGetRequest struct {
	Offset int64
	Limit  int64
}

GroupMultiGetRequest contains data for making request to get limited groups count

type GroupObject

type GroupObject struct {
	ID          int64                    `json:"id"`
	Name        string                   `json:"name"`
	Users       *[]IDName                `json:"users"`       // used only: get single user and include specified
	Memberships *[]GroupMembershipObject `json:"memberships"` // used only: get single user and include specified
}

GroupObject struct used for groups get operations

type GroupResult

type GroupResult struct {
	Groups     []GroupObject `json:"groups"`
	TotalCount int64         `json:"total_count"`
	Offset     int64         `json:"offset"`
	Limit      int64         `json:"limit"`
}

GroupResult stores groups requests processing result

type GroupSingleGetRequest

type GroupSingleGetRequest struct {
	Includes []GroupInclude
}

GroupSingleGetRequest contains data for making request to get specified group

type GroupUpdate

type GroupUpdate struct {
	Group GroupUpdateObject `json:"group"`
}

GroupUpdate struct used for groups update operations

type GroupUpdateObject

type GroupUpdateObject struct {
	Name    *string  `json:"name,omitempty"`
	UserIDs *[]int64 `json:"user_ids,omitempty"`
}

type IDName

type IDName struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

IDName used as embedded struct for other structs within package

type IssueAllGetRequest

type IssueAllGetRequest struct {
	Sort     *IssueGetRequestSort
	Includes []IssueInclude
	Filters  *IssueGetRequestFilters
}

IssueAllGetRequest contains data for making request to get all issues satisfying specified filters

type IssueChangesetObject

type IssueChangesetObject struct {
	Revision    string `json:"revision"`
	User        IDName `json:"user"`
	Comments    string `json:"comments"`
	CommittedOn string `json:"committed_on"`
}

IssueChangesetObject struct used for issues get operations

type IssueChildrenObject

type IssueChildrenObject struct {
	ID       int64                  `json:"id"`
	Tracker  IDName                 `json:"tracker"`
	Subject  string                 `json:"subject"`
	Children *[]IssueChildrenObject `json:"children"`
}

IssueChildrenObject struct used for issues get operations

type IssueCreate

type IssueCreate struct {
	Issue IssueCreateObject `json:"issue"`
}

IssueCreate struct used for issues create operations

type IssueCreateObject

type IssueCreateObject struct {
	ProjectID      int64                      `json:"project_id"`
	TrackerID      *int64                     `json:"tracker_id,omitempty"`
	StatusID       *int64                     `json:"status_id,omitempty"`
	PriorityID     *int64                     `json:"priority_id,omitempty"`
	Subject        string                     `json:"subject"`
	Description    *string                    `json:"description,omitempty"`
	StartDate      *string                    `json:"start_date,omitempty"`
	DueDate        *string                    `json:"due_date,omitempty"`
	CategoryID     *int64                     `json:"category_id,omitempty"`
	FixedVersionID *int64                     `json:"fixed_version_id,omitempty"`
	AssignedToID   *int64                     `json:"assigned_to_id,omitempty"`
	ParentIssueID  *int64                     `json:"parent_issue_id,omitempty"`
	CustomFields   *[]CustomFieldUpdateObject `json:"custom_fields,omitempty"`
	WatcherUserIDs *[]int64                   `json:"watcher_user_ids,omitempty"`
	IsPrivate      *bool                      `json:"is_private,omitempty"`
	EstimatedHours *float64                   `json:"estimated_hours,omitempty"`
	Uploads        *[]AttachmentUploadObject  `json:"uploads,omitempty"`
}

type IssueGetRequestFilters

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

IssueGetRequestFilters contains data for making issues get request

func IssueGetRequestFiltersInit

func IssueGetRequestFiltersInit() *IssueGetRequestFilters

func (*IssueGetRequestFilters) CustomFieldAdd

func (f *IssueGetRequestFilters) CustomFieldAdd(id int64, value string) *IssueGetRequestFilters

func (*IssueGetRequestFilters) FieldAdd

func (f *IssueGetRequestFilters) FieldAdd(field string, values ...string) *IssueGetRequestFilters

type IssueGetRequestSort

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

func IssueGetRequestSortInit

func IssueGetRequestSortInit() *IssueGetRequestSort

func (*IssueGetRequestSort) Set

func (s *IssueGetRequestSort) Set(field string, desc bool) *IssueGetRequestSort

type IssueInclude

type IssueInclude string
const (
	IssueIncludeChildren        IssueInclude = "children" // used only: get single user
	IssueIncludeAttachments     IssueInclude = "attachments"
	IssueIncludeRelations       IssueInclude = "relations"
	IssueIncludeChangesets      IssueInclude = "changesets"       // used only: get single user
	IssueIncludeJournals        IssueInclude = "journals"         // used only: get single user
	IssueIncludeWatchers        IssueInclude = "watchers"         // used only: get single user
	IssueIncludeAllowedStatuses IssueInclude = "allowed_statuses" // used only: get single user
)

func (IssueInclude) String

func (ii IssueInclude) String() string

type IssueJournalDetailObject

type IssueJournalDetailObject struct {
	Property string `json:"property"`
	Name     string `json:"name"`
	OldValue string `json:"old_value"`
	NewValue string `json:"new_value"`
}

IssueJournalDetailObject struct used for issues get operations

type IssueJournalObject

type IssueJournalObject struct {
	ID           int64                      `json:"id"`
	User         IDName                     `json:"user"`
	Notes        string                     `json:"notes"`
	CreatedOn    string                     `json:"created_on"`
	PrivateNotes bool                       `json:"private_notes"`
	Details      []IssueJournalDetailObject `json:"details"`
}

IssueJournalObject struct used for issues get operations

type IssueMultiGetRequest

type IssueMultiGetRequest struct {
	Sort     *IssueGetRequestSort
	Includes []IssueInclude
	Filters  *IssueGetRequestFilters
	Offset   int64
	Limit    int64
}

IssueMultiGetRequest contains data for making request to get limited issues count satisfying specified filters

type IssueObject

type IssueObject struct {
	ID                  int64                   `json:"id"`
	Project             IDName                  `json:"project"`
	Tracker             IDName                  `json:"tracker"`
	Status              IssueStatusObject       `json:"status"`
	Priority            IDName                  `json:"priority"`
	Author              IDName                  `json:"author"`
	AssignedTo          *IDName                 `json:"assigned_to"`
	Category            *IDName                 `json:"category"`
	FixedVersion        *IDName                 `json:"fixed_version"`
	Parent              *IssueParentObject      `json:"parent"`
	Subject             string                  `json:"subject"`
	Description         string                  `json:"description"`
	StartDate           *string                 `json:"start_date"`
	DueDate             *string                 `json:"due_date"`
	DoneRatio           int64                   `json:"done_ratio"`
	IsPrivate           int64                   `json:"is_private"`
	EstimatedHours      *float64                `json:"estimated_hours"`
	TotalEstimatedHours *float64                `json:"total_estimated_hours"`
	SpentHours          float64                 `json:"spent_hours"`
	TotalSpentHours     float64                 `json:"total_spent_hours"`
	CustomFields        []CustomFieldGetObject  `json:"custom_fields"`
	CreatedOn           string                  `json:"created_on"`
	UpdatedOn           string                  `json:"updated_on"`
	ClosedOn            string                  `json:"closed_on"`
	Children            *[]IssueChildrenObject  `json:"children"`         // used only: get single user and include specified
	Attachments         *[]AttachmentObject     `json:"attachments"`      // used only: include specified
	Relations           *[]IssueRelationObject  `json:"relations"`        // used only: include specified
	Changesets          *[]IssueChangesetObject `json:"changesets"`       // used only: get single user and include specified
	Journals            *[]IssueJournalObject   `json:"journals"`         // used only: get single user and include specified
	Watchers            *[]IDName               `json:"watchers"`         // used only: get single user and include specified
	AllowedStatuses     *[]IssueStatusObject    `json:"allowed_statuses"` // used only: get single user and include specified
}

IssueObject struct used for issues get operations

type IssueParentObject

type IssueParentObject struct {
	ID int64 `json:"id"`
}

IssueParentObject struct used for issues get operations

type IssueRelationObject

type IssueRelationObject struct {
	ID           int64  `json:"id"`
	IssueID      int64  `json:"issue_id"`
	IssueToID    int64  `json:"issue_to_id"`
	RelationType string `json:"relation_type"`
	Delay        *int64 `json:"delay"`
}

IssueRelationObject struct used for issues get operations

type IssueResult

type IssueResult struct {
	Issues     []IssueObject `json:"issues"`
	TotalCount int64         `json:"total_count"`
	Offset     int64         `json:"offset"`
	Limit      int64         `json:"limit"`
}

IssueResult stores issues requests processing result

type IssueSingleGetRequest

type IssueSingleGetRequest struct {
	Includes []IssueInclude
}

IssueSingleGetRequest contains data for making request to get specified issue

type IssueStatusObject

type IssueStatusObject struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	IsClosed bool   `json:"is_closed"`
}

IssueStatusObject struct used for issue_statuses get operations

type IssueUpdate

type IssueUpdate struct {
	Issue IssueUpdateObject `json:"issue"`
}

IssueUpdate struct used for issues update operations

type IssueUpdateObject

type IssueUpdateObject struct {
	ProjectID      *int64                     `json:"project_id,omitempty"`
	TrackerID      *int64                     `json:"tracker_id,omitempty"`
	StatusID       *int64                     `json:"status_id,omitempty"`
	PriorityID     *int64                     `json:"priority_id,omitempty"`
	Subject        *string                    `json:"subject,omitempty"`
	Description    *string                    `json:"description,omitempty"`
	StartDate      *string                    `json:"start_date,omitempty"`
	DueDate        *string                    `json:"due_date,omitempty"`
	CategoryID     *int64                     `json:"category_id,omitempty"`
	FixedVersionID *int64                     `json:"fixed_version_id,omitempty"`
	AssignedToID   *int64                     `json:"assigned_to_id,omitempty"`
	ParentIssueID  *int64                     `json:"parent_issue_id,omitempty"`
	CustomFields   *[]CustomFieldUpdateObject `json:"custom_fields,omitempty"`
	IsPrivate      *bool                      `json:"is_private,omitempty"`
	EstimatedHours *float64                   `json:"estimated_hours,omitempty"`
	Uploads        *[]AttachmentUploadObject  `json:"uploads,omitempty"`
	Notes          *string                    `json:"notes,omitempty"`
	PrivateNotes   *bool                      `json:"private_notes,omitempty"`
}

type MembershipAdd

type MembershipAdd struct {
	Membership MembershipAddObject `json:"membership"`
}

MembershipAdd struct used for project memberships add operations

type MembershipAddObject

type MembershipAddObject struct {
	UserID  int64   `json:"user_id"` // The numerical id of the user or group
	RoleIDs []int64 `json:"role_ids"`
}

type MembershipMultiGetRequest

type MembershipMultiGetRequest struct {
	Offset int64
	Limit  int64
}

MembershipMultiGetRequest contains data for making request to get limited memberships count

type MembershipObject

type MembershipObject struct {
	ID      int64                  `json:"id"`
	Project IDName                 `json:"project"`
	User    *IDName                `json:"user"`  // The membership owner can be either a user or a group
	Group   *IDName                `json:"group"` // The membership owner can be either a user or a group
	Roles   []MembershipRoleObject `json:"roles"`
}

MembershipObject struct used for project memberships get operations

type MembershipResult

type MembershipResult struct {
	Memberships []MembershipObject `json:"memberships"`
	TotalCount  int64              `json:"total_count"`
	Offset      int64              `json:"offset"`
	Limit       int64              `json:"limit"`
}

MembershipResult stores project memberships requests processing result

type MembershipRoleObject

type MembershipRoleObject struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	Inherited bool   `json:"inherited"`
}

MembershipRoleObject struct used for project memberships get operations

type MembershipUpdate

type MembershipUpdate struct {
	Membership MembershipUpdateObject `json:"membership"`
}

MembershipUpdate struct used for project memberships update operations

type MembershipUpdateObject

type MembershipUpdateObject struct {
	RoleIDs []int64 `json:"role_ids"`
}

type ProjectAllGetRequest

type ProjectAllGetRequest struct {
	Includes []ProjectInclude
	Filters  *ProjectGetRequestFilters
}

ProjectAllGetRequest contains data for making request to get all projects satisfying specified filters

type ProjectCreate

type ProjectCreate struct {
	Project ProjectCreateObject `json:"project"`
}

ProjectCreate struct used for projects create operations

type ProjectCreateObject

type ProjectCreateObject struct {
	Name                string                     `json:"name"`
	Identifier          string                     `json:"identifier"`
	Description         *string                    `json:"description,omitempty"`
	Homepage            *string                    `json:"homepage,omitempty"`
	IsPublic            *bool                      `json:"is_public,omitempty"`
	ParentID            *int64                     `json:"parent_id,omitempty"`
	InheritMembers      *bool                      `json:"inherit_members,omitempty"`
	DefaultAssignedToID *int64                     `json:"default_assigned_to_id,omitempty"`
	DefaultVersionID    *int64                     `json:"default_version_id,omitempty"`
	TrackerIDs          *[]int64                   `json:"tracker_ids,omitempty"`
	EnabledModuleNames  *[]string                  `json:"enabled_module_names,omitempty"`
	IssueCustomFieldIDs *[]int64                   `json:"issue_custom_field_ids,omitempty"`
	CustomFields        *[]CustomFieldUpdateObject `json:"custom_fields,omitempty"`
}

type ProjectGetRequestFilters

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

ProjectGetRequestFilters contains data for making projects get request

func ProjectGetRequestFiltersInit

func ProjectGetRequestFiltersInit() *ProjectGetRequestFilters

func (*ProjectGetRequestFilters) StatusSet

type ProjectInclude

type ProjectInclude string
const (
	ProjectIncludeTrackers            ProjectInclude = "trackers"
	ProjectIncludeIssueCategories     ProjectInclude = "issue_categories"
	ProjectIncludeEnabledModules      ProjectInclude = "enabled_modules"       // (since 2.6.0)
	ProjectIncludeTimeEntryActivities ProjectInclude = "time_entry_activities" // (since 3.4.0)
	ProjectIncludeIssueCustomFields   ProjectInclude = "issue_custom_fields"   // (since 4.2.0)
)

func (ProjectInclude) String

func (pi ProjectInclude) String() string

type ProjectMultiGetRequest

type ProjectMultiGetRequest struct {
	Includes []ProjectInclude
	Filters  *ProjectGetRequestFilters
	Offset   int64
	Limit    int64
}

ProjectMultiGetRequest contains data for making request to get limited projects count satisfying specified filters

type ProjectObject

type ProjectObject struct {
	ID                  int64                  `json:"id"`
	Name                string                 `json:"name"`
	Identifier          string                 `json:"identifier"`
	Description         string                 `json:"description"`
	Homepage            *string                `json:"homepage"` // used only: get single project
	Parent              IDName                 `json:"parent"`
	Status              ProjectStatus          `json:"status"`
	IsPublic            bool                   `json:"is_public"`
	InheritMembers      bool                   `json:"inherit_members"`
	DefaultVersion      *IDName                `json:"default_version"`  // used only: get single project and if set for project
	DefaultAssignee     *IDName                `json:"default_assignee"` // used only: get single project and if set for project
	CustomFields        []CustomFieldGetObject `json:"custom_fields"`
	Trackers            *[]IDName              `json:"trackers"`              // used only: include specified
	IssueCategories     *[]IDName              `json:"issue_categories"`      // used only: include specified
	TimeEntryActivities *[]IDName              `json:"time_entry_activities"` // used only: include specified
	EnabledModules      *[]IDName              `json:"enabled_modules"`       // used only: include specified
	IssueCustomFields   *[]IDName              `json:"issue_custom_fields"`   // used only: include specified
	CreatedOn           string                 `json:"created_on"`
	UpdatedOn           string                 `json:"updated_on"`
}

ProjectObject struct used for projects get operations

type ProjectResult

type ProjectResult struct {
	Projects   []ProjectObject `json:"projects"`
	TotalCount int64           `json:"total_count"`
	Offset     int64           `json:"offset"`
	Limit      int64           `json:"limit"`
}

ProjectResult stores projects requests processing result

type ProjectSingleGetRequest

type ProjectSingleGetRequest struct {
	Includes []ProjectInclude
}

ProjectSingleGetRequest contains data for making request to get specified project

type ProjectStatus

type ProjectStatus int64

ProjectStatus defines project status type

const (
	ProjectStatusActive   ProjectStatus = 1
	ProjectStatusClosed   ProjectStatus = 5
	ProjectStatusArchived ProjectStatus = 9
)

ProjectStatus const

func (ProjectStatus) String

func (p ProjectStatus) String() string

type ProjectUpdate

type ProjectUpdate struct {
	Project ProjectUpdateObject `json:"project"`
}

ProjectUpdate struct used for projects update operations

type ProjectUpdateObject

type ProjectUpdateObject struct {
	Name                *string                    `json:"name,omitempty"`
	Description         *string                    `json:"description,omitempty"`
	Homepage            *string                    `json:"homepage,omitempty"`
	IsPublic            *bool                      `json:"is_public,omitempty"`
	ParentID            *int64                     `json:"parent_id,omitempty"`
	InheritMembers      *bool                      `json:"inherit_members,omitempty"`
	DefaultAssignedToID *int64                     `json:"default_assigned_to_id,omitempty"`
	DefaultVersionID    *int64                     `json:"default_version_id,omitempty"`
	TrackerIDs          *[]int64                   `json:"tracker_ids,omitempty"`
	EnabledModuleNames  *[]string                  `json:"enabled_module_names,omitempty"`
	IssueCustomFieldIDs *[]int64                   `json:"issue_custom_field_ids,omitempty"`
	CustomFields        *[]CustomFieldUpdateObject `json:"custom_fields,omitempty"`
}

type Settings

type Settings struct {
	Endpoint string
	APIKey   string
}

type StatusCode

type StatusCode int64

type TimeEntryAllGetRequest added in v5.1.0

type TimeEntryAllGetRequest struct {
	Filters *TimeEntryGetRequestFilters
}

type TimeEntryCreate added in v5.1.0

type TimeEntryCreate struct {
	TimeEntry TimeEntryCreateObject `json:"time_entry"`
}

type TimeEntryCreateObject added in v5.1.0

type TimeEntryCreateObject struct {
	ProjectID  *string `json:"project_id,omitempty"`
	IssueID    *int64  `json:"issue_id,omitempty"`
	UserID     *int64  `json:"user_id,omitempty"`
	ActivityID int64   `json:"activity_id"`
	Hours      float64 `json:"hours"`
	Comments   string  `json:"comments"`
	SpentOn    *string `json:"spent_on,omitempty"`
}

type TimeEntryGetRequestFilters added in v5.1.0

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

func TimeEntryGetRequestFiltersInit added in v5.1.0

func TimeEntryGetRequestFiltersInit() *TimeEntryGetRequestFilters

func (*TimeEntryGetRequestFilters) ActivityIDSet added in v5.1.0

func (*TimeEntryGetRequestFilters) ProjectSet added in v5.1.0

func (*TimeEntryGetRequestFilters) SpentOnSet added in v5.1.0

func (*TimeEntryGetRequestFilters) UserIDSet added in v5.1.0

type TimeEntryIssueObject added in v5.1.0

type TimeEntryIssueObject struct {
	ID int64 `json:"id"`
}

type TimeEntryObject added in v5.1.0

type TimeEntryObject struct {
	ID        int64                `json:"id"`
	Project   IDName               `json:"project"`
	Issue     TimeEntryIssueObject `json:"issue"`
	User      IDName               `json:"user"`
	Activity  IDName               `json:"activity"`
	Hours     float64              `json:"hours"`
	Comments  string               `json:"comments"`
	SpentOn   string               `json:"spent_on"`
	CreatedOn string               `json:"created_on"`
	UpdatedOn string               `json:"updated_on"`
}

type TimeEntryResult added in v5.1.0

type TimeEntryResult struct {
	TimeEntries []TimeEntryObject `json:"time_entries"`
	TotalCount  int64             `json:"total_count"`
	Offset      int64             `json:"offset"`
	Limit       int64             `json:"limit"`
}

TimeEntryResult stores time entry requests processing result

type TimeEntrySingleGetRequest added in v5.1.0

type TimeEntrySingleGetRequest struct {
}

Empty struct (uses as placeholder)

type TimeEntryUpdate added in v5.1.0

type TimeEntryUpdate struct {
	TimeEntry TimeEntryUpdateObject `json:"time_entry"`
}

type TimeEntryUpdateObject added in v5.1.0

type TimeEntryUpdateObject struct {
	ProjectID  *string  `json:"project_id,omitempty"`
	IssueID    *int64   `json:"issue_id,omitempty"`
	UserID     *int64   `json:"user_id,omitempty"`
	ActivityID *int64   `json:"activity_id,omitempty"`
	Hours      *float64 `json:"hours,omitempty"`
	Comments   *string  `json:"comments,omitempty"`
	SpentOn    *string  `json:"spent_on,omitempty"`
}

type TrackerObject

type TrackerObject struct {
	ID                    int64    `json:"id"`
	Name                  string   `json:"name"`
	DefaultStatus         IDName   `json:"default_status"`          // (since 3.0)
	Description           *string  `json:"description"`             // (since 4.2.0)
	EnabledStandardFields []string `json:"enabled_standard_fields"` // (since 5.0.0)
}

TrackerObject struct used for trackers get operations

type UserAllGetRequest

type UserAllGetRequest struct {
	Filters *UserGetRequestFilters
}

UserAllGetRequest contains data for making request to get all users satisfying specified filters

type UserCreate

type UserCreate struct {
	User            UserCreateObject `json:"user"`
	SendInformation *bool            `json:"send_information,omitempty"`
}

UserCreate struct used for users create operations

type UserCreateObject

type UserCreateObject struct {
	Login            string                     `json:"login"`
	FirstName        string                     `json:"firstname"`
	LastName         string                     `json:"lastname"`
	Mail             string                     `json:"mail"`
	Password         *string                    `json:"password,omitempty"`
	AuthSourceID     *int64                     `json:"auth_source_id,omitempty"`
	MailNotification *string                    `json:"mail_notification,omitempty"`
	MustChangePasswd *bool                      `json:"must_change_passwd,omitempty"`
	GeneratePassword *bool                      `json:"generate_password,omitempty"`
	CustomFields     *[]CustomFieldUpdateObject `json:"custom_fields,omitempty"`
}

type UserCurrentGetRequest

type UserCurrentGetRequest struct {
	Includes []UserInclude
}

UserCurrentGetRequest contains data for making request to get current user

type UserGetRequestFilters

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

UserGetRequestFilters contains data for making users get request

func UserGetRequestFiltersInit

func UserGetRequestFiltersInit() *UserGetRequestFilters

func (*UserGetRequestFilters) GroupIDSet

func (*UserGetRequestFilters) NameSet

func (*UserGetRequestFilters) StatusSet

type UserInclude

type UserInclude string
const (
	UserIncludeGroups      UserInclude = "groups"
	UserIncludeMemberships UserInclude = "memberships"
)

func (UserInclude) String

func (ui UserInclude) String() string

type UserMembershipObject

type UserMembershipObject struct {
	ID      int64    `json:"id"`
	Project IDName   `json:"project"`
	Roles   []IDName `json:"roles"`
}

UserMembershipObject struct used for users get operations

type UserMultiGetRequest

type UserMultiGetRequest struct {
	Filters *UserGetRequestFilters
	Offset  int64
	Limit   int64
}

UserMultiGetRequest contains data for making request to get limited users count satisfying specified filters

type UserNotification

type UserNotification string

UserNotification defines user notification type

const (
	UserNotificationAll          UserNotification = "all"
	UserNotificationSelected     UserNotification = "selected"
	UserNotificationOnlyMyEvents UserNotification = "only_my_events"
	UserNotificationOnlyAssigned UserNotification = "only_assigned"
	UserNotificationOnlyOwner    UserNotification = "only_owner"
	UserNotificationOnlyNone     UserNotification = "none"
)

UserNotification const

func (UserNotification) String

func (u UserNotification) String() string

type UserObject

type UserObject struct {
	ID              int64                   `json:"id"`
	Login           string                  `json:"login"`
	Admin           bool                    `json:"admin"`
	FirstName       string                  `json:"firstname"`
	LastName        string                  `json:"lastname"`
	Mail            string                  `json:"mail"`
	CreatedOn       string                  `json:"created_on"`
	LastLoginOn     string                  `json:"last_login_on"`
	PasswdChangedOn string                  `json:"passwd_changed_on"`
	TwofaScheme     *string                 `json:"twofa_scheme"` // has nil value if 2FA not enabled and "totp" string value otherwise
	APIKey          *string                 `json:"api_key"`      // used only: get single user
	Status          *UserStatus             `json:"status"`       // used only: get single user
	CustomFields    []CustomFieldGetObject  `json:"custom_fields"`
	Groups          *[]IDName               `json:"groups"`      // used only: get single user and include specified
	Memberships     *[]UserMembershipObject `json:"memberships"` // used only: get single user and include specified
}

UserObject struct used for users get operations

type UserResult

type UserResult struct {
	Users      []UserObject `json:"users"`
	TotalCount int64        `json:"total_count"`
	Offset     int64        `json:"offset"`
	Limit      int64        `json:"limit"`
}

UserResult stores users requests processing result

type UserSingleGetRequest

type UserSingleGetRequest struct {
	Includes []UserInclude
}

UserSingleGetRequest contains data for making request to get specified user

type UserStatus

type UserStatus int64

UserStatus defines user status type

const (
	UserStatusAnonymous  UserStatus = 0
	UserStatusActive     UserStatus = 1
	UserStatusRegistered UserStatus = 2
	UserStatusLocked     UserStatus = 3
)

UserStatus const

func (UserStatus) String

func (u UserStatus) String() string

type UserUpdate

type UserUpdate struct {
	User            UserUpdateObject `json:"user"`
	SendInformation *bool            `json:"send_information,omitempty"`
}

UserUpdate struct used for users update operations

type UserUpdateObject

type UserUpdateObject struct {
	Login            *string                    `json:"login,omitempty"`
	FirstName        *string                    `json:"firstname,omitempty"`
	LastName         *string                    `json:"lastname,omitempty"`
	Mail             *string                    `json:"mail,omitempty"`
	Password         *string                    `json:"password,omitempty"`
	AuthSourceID     *int64                     `json:"auth_source_id,omitempty"`
	MailNotification *string                    `json:"mail_notification,omitempty"`
	MustChangePasswd *bool                      `json:"must_change_passwd,omitempty"`
	GeneratePassword *bool                      `json:"generate_password,omitempty"`
	CustomFields     *[]CustomFieldUpdateObject `json:"custom_fields,omitempty"`
}

type WikiCreate

type WikiCreate struct {
	WikiPage WikiCreateObject `json:"wiki_page"`
}

WikiCreate struct used for wiki create operations

type WikiCreateObject

type WikiCreateObject struct {
	Text     string                    `json:"text"`
	Comments *string                   `json:"comments,omitempty"`
	Uploads  *[]AttachmentUploadObject `json:"uploads,omitempty"`
}

type WikiInclude

type WikiInclude string
const (
	WikiIncludeAttachments WikiInclude = "attachments"
)

func (WikiInclude) String

func (wi WikiInclude) String() string

type WikiMultiObject

type WikiMultiObject struct {
	Title     string            `json:"title"`
	Parent    *WikiParentObject `json:"parent"`
	Version   int64             `json:"version"`
	CreatedOn string            `json:"created_on"`
	UpdatedOn string            `json:"updated_on"`
}

WikiMultiObject struct used for wikies all get operations

type WikiObject

type WikiObject struct {
	Title       string              `json:"title"`
	Parent      *WikiParentObject   `json:"parent"`
	Text        string              `json:"text"`
	Version     int64               `json:"version"`
	Author      IDName              `json:"author"`
	Comments    string              `json:"comments"`
	CreatedOn   string              `json:"created_on"`
	UpdatedOn   string              `json:"updated_on"`
	Attachments *[]AttachmentObject `json:"attachments"`
}

WikiObject struct used for wiki get operations

type WikiParentObject

type WikiParentObject struct {
	Title string `json:"title"`
}

WikiParentObject struct used for wikies get operations

type WikiSingleGetRequest

type WikiSingleGetRequest struct {
	Includes []WikiInclude
}

WikiSingleGetRequest contains data for making request to get specified wiki

type WikiUpdate

type WikiUpdate struct {
	WikiPage WikiUpdateObject `json:"wiki_page"`
}

WikiUpdate struct used for wiki update operations

type WikiUpdateObject

type WikiUpdateObject struct {
	Text     string                    `json:"text"`
	Comments *string                   `json:"comments,omitempty"`
	Version  *int64                    `json:"version,omitempty"`
	Uploads  *[]AttachmentUploadObject `json:"uploads,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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