freshservice

package
v0.0.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChangeStatusOpen           = 1
	ChangeStatusPlanning       = 2
	ChangeStatusApproval       = 3
	ChangeStatusPendingRelease = 4
	ChangeStatusPendingReview  = 5
	ChangeStatusClosed         = 6
	ChangePriorityLow          = 1
	ChangePriorityMedium       = 2
	ChangePriorityHigh         = 3
	ChangePriorityUrgent       = 4
	ChangeImpactLow            = 1
	ChangeImpactMedium         = 2
	ChangeImpactHigh           = 3
	ChangeTypeMinor            = 1
	ChangeTypeStandard         = 2
	ChangeTypeMajor            = 3
	ChangeTypeEmergency        = 4
	ChangeRiskLow              = 1
	ChangeRiskMedium           = 2
	ChangeRiskHigh             = 3
	ChangeRiskVeryHigh         = 4
)
View Source
const (
	ReleasePriorityLow      = 1
	ReleasePriorityMedium   = 2
	ReleasePriorityHigh     = 3
	ReleasePriorityUrgent   = 4
	ReleaseStatusOpen       = 1
	ReleaseStatusOnHold     = 2
	ReleaseStatusInProgress = 3
	ReleaseStatusIncomplete = 4
	ReleaseStatusCompleted  = 5
	ReleaseTypeMinor        = 1
	ReleaseTypeStandard     = 2
	ReleaseTypeMajor        = 3
	ReleaseTypeEmergency    = 4
)
View Source
const (
	TicketOpen          = 2
	TicketPending       = 3
	TicketResolved      = 4
	TicketClosed        = 5
	SourceEmail         = 1
	SourcePortal        = 2
	SourcePhone         = 3
	SourceChat          = 4
	SourceWidget        = 5
	SourceYammer        = 6
	SourceAwsCloudWatch = 7
	SourcePagerDuty     = 8
	SourceWalkUp        = 9
	SourceSlack         = 10
	PriorityLow         = 1
	PriorityMedium      = 2
	PriorityHigh        = 3
	PriorityUrgent      = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Actor represents a simple id/name object

type Address

type Address struct {
	Line1   string `json:"line1"`
	Line2   string `json:"line2"`
	City    string `json:"city"`
	State   string `json:"state"`
	Country string `json:"country"`
	ZipCode string `json:"zipcode"`
}

Address representation of a physical address

type Agent

type Agent struct {
	ID                    int                   `json:"id"`
	FirstName             string                `json:"first_name"`
	LastName              string                `json:"last_name"`
	Occasional            bool                  `json:"occasional"`
	JobTitle              string                `json:"job_title"`
	Email                 string                `json:"email"`
	WorkPhoneNumber       string                `json:"work_phone_number"`
	MobilePhoneNumber     string                `json:"mobile_phone_number"`
	DepartmentIDs         []int                 `json:"department_ids"`
	Active                bool                  `json:"active"`
	Address               string                `json:"address"`
	ReportingManagerID    int                   `json:"reporting_manager_id"`
	TimeZone              string                `json:"time_zone"`
	TimeFormat            string                `json:"time_format"`
	Language              string                `json:"language"`
	LocationID            int                   `json:"location_id"`
	BackgroundInformation string                `json:"background_information"`
	ScoreboardLevelID     int                   `json:"scoreboard_level_id"`
	MemberOf              []int                 `json:"member_of"`
	ObserverOf            []int                 `json:"observer_of"`
	Roles                 []AgentRoleAssignment `json:"roles"`
	LastLoginAt           time.Time             `json:"last_login_at"`
	LastActiveAt          time.Time             `json:"last_active_at"`
	HasLoggedIn           bool                  `json:"has_logged_in"`
	CreatedAt             time.Time             `json:"created_at"`
	UpdatedAt             time.Time             `json:"updated_at"`
}

Agent represents a FreshService Agent

type AgentRole

type AgentRole struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Default     bool      `json:"default"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

AgentRole represents a FreshService AgentRole

type AgentRoleAssignment

type AgentRoleAssignment struct {
	RoleID          int    `json:"role_id"`
	AssignmentScope string `json:"assignment_scope"`
	Groups          []int  `json:"groups"`
}

AgentRoleAssignment represents a Role Assignment on an Agent

type AgentRoles

type AgentRoles struct {
	Collection []AgentRole `json:"roles"`
}

AgentRoles contains Collection an array of AgentRole

type AgentService

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

AgentService API Docs: https://api.freshservice.com/#agents https://api.freshservice.com/#agent-roles https://api.freshservice.com/#agent-groups

func (*AgentService) CreateAgent

func (s *AgentService) CreateAgent(newAgent *CreateAgentModel) (*Agent, *http.Response, error)

CreateAgent will create and return a new Agent based on CreateAgentModel

func (*AgentService) DeactivateAgent

func (s *AgentService) DeactivateAgent(id int) (bool, *http.Response, error)

DeactivateAgent will deactivate the Agent matching the id

func (*AgentService) DeleteAgent

func (s *AgentService) DeleteAgent(id int) (bool, *http.Response, error)

DeleteAgent will completely remove an Agent from FreshService matching id (along with their requested Tickets)

func (*AgentService) GetAgent

func (s *AgentService) GetAgent(id int) (*Agent, *http.Response, error)

GetAgent will return a single Agent by id

func (*AgentService) GetAgentRole

func (s *AgentService) GetAgentRole(id int) (*AgentRole, *http.Response, error)

GetAgentRole will return a single AgentRole by id

func (*AgentService) ListAgentRoles

func (s *AgentService) ListAgentRoles(opt ListAgentRolesOptions) (*AgentRoles, *http.Response, error)

ListAgentRoles will return paginated/filtered AgentRoles using ListAgentRolesOptions

func (*AgentService) ListAgents

func (s *AgentService) ListAgents(opt *ListAgentsOptions) (*Agents, *http.Response, error)

ListAgents will return paginated/filtered Agents using ListAgentsOptions

func (*AgentService) ReactivateAgent

func (s *AgentService) ReactivateAgent(id int) (*Agent, *http.Response, error)

ReactivateAgent will reactivate a deactivated Agent matching the id

func (*AgentService) UpdateAgent

func (s *AgentService) UpdateAgent(id int, agent *UpdateAgentModel) (*Agent, *http.Response, error)

UpdateAgent will update and return an Agent matching id based on UpdateAgentModel

type Agents

type Agents struct {
	Collection []Agent `json:"agents"`
}

Agents contains Collection an array of Agent

type Announcement

type Announcement struct {
	ID               int       `json:"id"`
	CreatedBy        int       `json:"created_by"`
	State            string    `json:"state"`
	Title            string    `json:"title"`
	Body             string    `json:"body"`
	BodyHtml         string    `json:"body_html"`
	VisibleFrom      time.Time `json:"visible_from"`
	VisibleTo        time.Time `json:"visible_to"`
	Visibility       string    `json:"visibility"`
	Departments      []int     `json:"departments"`
	Groups           []int     `json:"groups"`
	IsRead           bool      `json:"is_read"`
	SendEmail        bool      `json:"send_email"`
	AdditionalEmails []string  `json:"additional_emails"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

Announcement represents a FreshService Announcement

type AnnouncementService

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

AnnouncementService API Docs: https://api.freshservice.com/#announcements

func (*AnnouncementService) CreateAnnouncement

func (s *AnnouncementService) CreateAnnouncement(newAnnouncement *CreateAnnouncementModel) (*Announcement, *http.Response, error)

CreateAnnouncement will create and return a new Announcement based on CreateAnnouncementModel

func (*AnnouncementService) DeleteAnnouncement

func (s *AnnouncementService) DeleteAnnouncement(id int) (bool, *http.Response, error)

DeleteAnnouncement irrecoverably removes an Announcement from FreshService matching the id

func (*AnnouncementService) GetAnnouncement

func (s *AnnouncementService) GetAnnouncement(id int) (*Announcement, *http.Response, error)

GetAnnouncement will return a single Announcement by id

func (*AnnouncementService) ListAnnouncements

ListAnnouncements will return paginated/filtered Announcements using ListAnnouncementsOptions

func (*AnnouncementService) UpdateAnnouncement

func (s *AnnouncementService) UpdateAnnouncement(id int, announcement *UpdateAnnouncementModel) (*Announcement, *http.Response, error)

UpdateAnnouncement will update and return the Announcement matching the id based on UpdateAnnouncementModel

type Announcements

type Announcements struct {
	Collection []Announcement `json:"announcements"`
}

Announcements contains collection of Announcement

type Applicable

type Applicable struct {
	TicketType        []string `json:"ticket_type"`
	ServiceItems      []int    `json:"service_items"`
	ServiceCategories []int    `json:"service_categories"`
	DepartmentIDs     []int    `json:"department_id"`
	GroupIDs          []int    `json:"group_id"`
	Category          string   `json:"category"`
	SubCategory       string   `json:"sub_category"`
	ItemCategory      string   `json:"item_category"`
	Source            []int    `json:"source"`
}

type Application

type Application struct {
	ID                int       `json:"id"`
	Name              string    `json:"name"`
	Description       string    `json:"description"`
	ApplicationType   string    `json:"application_type"`
	Status            string    `json:"status"`
	PublisherID       int       `json:"publisher_id"`
	ManagedByID       int       `json:"managed_by_id"`
	Notes             string    `json:"notes"`
	Category          string    `json:"category"`
	Sources           []string  `json:"sources"`
	UserCount         int       `json:"user_count"`
	InstallationCount int       `json:"installation_count"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

Application represents an Application (Software) registered in FreshService

type Applications

type Applications struct {
	Collection []Application `json:"applications"`
}

Applications contains Collection an array of Application

type ApprovalSettings

type ApprovalSettings struct {
	ApprovalType int   `json:"approval_type"`
	ApproverIDs  []int `json:"approver_ids"`
}

type Asset

type Asset struct {
	ID           int       `json:"id"`
	DisplayID    int       `json:"display_id"`
	Name         string    `json:"name"`
	Description  string    `json:"description"`
	AssetTypeID  int       `json:"asset_type_id"`
	AssetTag     string    `json:"asset_tag"`
	Impact       string    `json:"impact"`
	AuthorType   string    `json:"author_type"`
	UsageType    string    `json:"usage_type"`
	UserID       int       `json:"user_id"`
	LocationID   int       `json:"location_id"`
	DepartmentID int       `json:"department_id"`
	AgentID      int       `json:"agent_id"`
	GroupID      int       `json:"group_id"`
	AssignedOn   time.Time `json:"assigned_on"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

Asset represents a FreshService Asset

type AssetComponent

type AssetComponent struct {
	ID            int         `json:"id"`
	ComponentType string      `json:"component_type"`
	ComponentData interface{} `json:"component_data"`
	CreatedAt     time.Time   `json:"created_at"`
	UpdatedAt     time.Time   `json:"updated_at"`
}

AssetComponent represents each component of an Asset

type AssetComponents

type AssetComponents struct {
	Collection []AssetComponent `json:"components"`
}

AssetComponents contains Collection an array of AssetComponent

type AssetContract

type AssetContract struct {
	ID             int    `json:"id"`
	ContractID     string `json:"contract_id"`
	ContractType   string `json:"contract_type"`
	ContractName   string `json:"contract_name"`
	ContractStatus string `json:"contract_status"`
}

AssetContract represents each contract link of an Asset

type AssetContracts

type AssetContracts struct {
	Collection []AssetContract `json:"contracts"`
}

AssetContracts contains Collection an array of AssetContract

type AssetService

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

AssetService API Docs: https://api.freshservice.com/#assets https://api.freshservice.com/#asset-types

func (*AssetService) CreateAsset

func (s *AssetService) CreateAsset(newAsset *CreateAssetModel) (*Asset, *http.Response, error)

CreateAsset will create and return a new Asset based on CreateAssetModel

func (*AssetService) CreateAssetType

func (s *AssetService) CreateAssetType(newAssetType CreateAssetTypeModel) (*AssetType, *http.Response, error)

CreateAssetType creates and returns a new AssetType based on CreateAssetTypeModel

func (*AssetService) DeleteAsset

func (s *AssetService) DeleteAsset(displayId int) (bool, *http.Response, error)

DeleteAsset irrecoverably removes an Asset from FreshService matching the displayId

func (*AssetService) DeleteAssetType

func (s *AssetService) DeleteAssetType(id int) (bool, *http.Response, error)

DeleteAssetType irrecoverably deletes an AssetType from FreshService matching the id

func (*AssetService) GetAsset

func (s *AssetService) GetAsset(displayId int) (*Asset, *http.Response, error)

GetAsset will return a single Asset by displayId

func (*AssetService) GetAssetType

func (s *AssetService) GetAssetType(id int) (*AssetType, *http.Response, error)

GetAssetType returns an AssetType by id

func (*AssetService) ListAssetComponents

func (s *AssetService) ListAssetComponents(displayId int) (*AssetComponents, *http.Response, error)

ListAssetComponents will return all AssetComponents for a given Asset by displayId

func (*AssetService) ListAssetContracts

func (s *AssetService) ListAssetContracts(displayId int) (*AssetContracts, *http.Response, error)

ListAssetContracts will return all AssetContracts for a given Asset by displayId

func (*AssetService) ListAssetTypes

func (s *AssetService) ListAssetTypes(opt *ListAssetTypesOptions) (*AssetTypes, *http.Response, error)

ListAssetTypes will return paginated/filtered AssetTypes using ListAssetTypesOptions

func (*AssetService) ListAssets

func (s *AssetService) ListAssets(opt *ListAssetsOptions) (*Assets, *http.Response, error)

ListAssets will return paginated/filtered Assets using ListAssetsOptions

func (*AssetService) RestoreAsset

func (s *AssetService) RestoreAsset(displayId int) (bool, *http.Response, error)

RestoreAsset will restore a previously Trashed Asset by displayId

func (*AssetService) TrashAsset

func (s *AssetService) TrashAsset(displayId int) (bool, *http.Response, error)

TrashAsset will trash the Asset matching the displayId (non-permanent delete)

func (*AssetService) UpdateAsset

func (s *AssetService) UpdateAsset(displayId int, asset *UpdateAssetModel) (*Asset, *http.Response, error)

UpdateAsset will update and return an Asset matching displayId based on UpdateAssetModel

func (*AssetService) UpdateAssetType

func (s *AssetService) UpdateAssetType(id int, updatedAssetType UpdateAssetTypeModel) (*AssetType, *http.Response, error)

UpdateAssetType updates and returns an AssetType matching id based on UpdateAssetTypeModel

type AssetType

type AssetType struct {
	ID                int       `json:"id"`
	Name              string    `json:"name"`
	Description       string    `json:"description"`
	ParentAssetTypeID int       `json:"parent_asset_type_id"`
	Visible           bool      `json:"visible"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

AssetType represents a FreshService AssetType

type AssetTypes

type AssetTypes struct {
	Collection []AssetType `json:"asset_types"`
}

AssetTypes contains Collection an array of AssetType

type Assets

type Assets struct {
	Collection []Asset `json:"assets"`
}

Assets contains Collection an array of Asset

type AssociatedAssets

type AssociatedAssets struct {
	Collection []Asset `json:"associated_assets"`
}

AssociatedAssets contains Collection an array of Asset

type BusinessHour

type BusinessHour struct {
	ID               int                `json:"id"`
	Name             string             `json:"name"`
	Description      string             `json:"description"`
	IsDefault        bool               `json:"is_default"`
	TimeZone         string             `json:"time_zone"`
	ListOfHolidays   []Holiday          `json:"list_of_holidays"`
	ServiceDeskHours map[string]Workday `json:"service_desk_hours"`
	CreatedAt        time.Time          `json:"created_at"`
	UpdatedAt        time.Time          `json:"updated_at"`
}

BusinessHour represents the BusinessHour configuration in the FreshService instance

type BusinessHours

type BusinessHours struct {
	Collection []BusinessHour `json:"business_hours"`
}

BusinessHours contains Collection an array of BusinessHour

type BusinessHoursService

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

BusinessHoursService API Docs: https://api.freshservice.com/#business-hours

func (*BusinessHoursService) GetBusinessHours

func (s *BusinessHoursService) GetBusinessHours(id int) (*BusinessHour, *http.Response, error)

GetBusinessHours will return a single BusinessHour configuration by id

func (*BusinessHoursService) ListBusinessHours

ListBusinessHours will return paginated/filtered BusinessHours using ListBusinessHoursOptions

type Change

type Change struct {
	ID               int       `json:"id"`
	AgentID          int       `json:"agent_id"`
	Description      string    `json:"description"`
	DescriptionText  string    `json:"description_text"`
	RequesterID      int       `json:"requester_id"`
	GroupID          int       `json:"group_id"`
	Priority         int       `json:"priority"`
	Impact           int       `json:"impact"`
	Status           int       `json:"status"`
	Risk             int       `json:"risk"`
	ChangeType       int       `json:"change_type"`
	ApprovalStatus   int       `json:"approval_status"`
	PlannedStartDate time.Time `json:"planned_start_date"`
	PlannedEndDate   time.Time `json:"planned_end_date"`
	Subject          string    `json:"subject"`
	DepartmentID     int       `json:"department_id"`
	Category         string    `json:"category"`
	SubCategory      string    `json:"sub_category"`
	ItemCategory     string    `json:"item_category"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

Change represents a Change request on FreshService

type ChangeService

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

ChangeService API Docs: https://api.freshservice.com/#changes

func (*ChangeService) CreateChange

func (s *ChangeService) CreateChange(newChange *CreateChangeModel) (*Change, *http.Response, error)

CreateChange will create and return a new Change based on CreateChangeModel

func (*ChangeService) CreateChangeNote

func (s *ChangeService) CreateChangeNote(changeId int, note *UpsertNoteModel) (*Note, *http.Response, error)

CreateChangeNote will create and return a new Note based on UpsertNoteModel

func (*ChangeService) DeleteChange

func (s *ChangeService) DeleteChange(id int) (bool, *http.Response, error)

DeleteChange will trash a Change from FreshService (Can be restored by RestoreChange)

func (*ChangeService) DeleteChangeNote

func (s *ChangeService) DeleteChangeNote(changeId int, changeNoteId int) (bool, *http.Response, error)

DeleteChangeNote will completely remove a Note from a Change

func (*ChangeService) GetChange

func (s *ChangeService) GetChange(id int) (*Change, *http.Response, error)

GetChange will return a single Change by id

func (*ChangeService) GetChangeNote

func (s *ChangeService) GetChangeNote(changeId int, changeNoteId int) (*Note, *http.Response, error)

GetChangeNote will return a single Note by id

func (*ChangeService) ListChangeNotes

func (s *ChangeService) ListChangeNotes(changeId int) (*Notes, *http.Response, error)

ListChangeNotes will return Notes for a specific Change

func (*ChangeService) ListChanges

func (s *ChangeService) ListChanges(opt *ListChangesOptions) (*Changes, *http.Response, error)

ListChanges will return paginated/filtered Change using ListChangesOptions

func (*ChangeService) RestoreChange

func (s *ChangeService) RestoreChange(id int) (bool, *http.Response, error)

RestoreChange will restore a previously trashed (deleted) Change

func (*ChangeService) UpdateChange

func (s *ChangeService) UpdateChange(id int, ticket *UpdateChangeModel) (*Change, *http.Response, error)

UpdateChange will update and return a Change matching id based on UpdateChangeModel

func (*ChangeService) UpdateChangeNote

func (s *ChangeService) UpdateChangeNote(changeId int, changeNoteId int, note *UpsertNoteModel) (*Note, *http.Response, error)

UpdateChangeNote will update and return a Note matching id based on UpsertNoteModel

type Changes

type Changes struct {
	Collection []Change `json:"changes"`
}

Changes contains Collection an array of Change

type Client

type Client struct {
	UserAgent string
	// Add services
	Agents                 *AgentService
	Announcements          *AnnouncementService
	Assets                 *AssetService
	BusinessHours          *BusinessHoursService
	Changes                *ChangeService
	Contracts              *ContractService
	Departments            *DepartmentService
	Locations              *LocationService
	Problems               *ProblemService
	Products               *ProductService
	PurchaseOrders         *PurchaseOrderService
	Releases               *ReleaseService
	Requesters             *RequesterService
	Services               *ServiceCatalogService
	ServiceLevelAgreements *SLAPoliciesService
	Software               *SoftwareService
	Solutions              *SolutionService
	Tickets                *TicketService
	Vendors                *VendorService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, subDomain string, apiKey string) (*Client, error)

NewClient generates a new API client, requires the subdomain of your FreshService instance as well as an API key ctx is optional and will default to context.Background() if nil is passed.

func (*Client) Delete

func (c *Client) Delete(path string) (bool, *http.Response, error)

func (*Client) Get

func (c *Client) Get(path string, out interface{}) (*http.Response, error)

func (*Client) List

func (c *Client) List(path string, opt interface{}, out interface{}) (*http.Response, error)

func (*Client) Post

func (c *Client) Post(path string, body interface{}, out interface{}) (*http.Response, error)

func (*Client) Put

func (c *Client) Put(path string, body interface{}, out interface{}) (*http.Response, error)

type Contract

type Contract struct {
	ID              int              `json:"id"`
	Name            string           `json:"name"`
	Description     string           `json:"description"`
	VendorID        int              `json:"vendor_id"`
	AutoRenew       bool             `json:"auto_renew"`
	NotifyExpiry    bool             `json:"notify_expiry"`
	NotifyBefore    int              `json:"notify_before"`
	ApproverID      int              `json:"approver_id"`
	StartDate       time.Time        `json:"start_date"`
	EndDate         time.Time        `json:"end_date"`
	Cost            float32          `json:"cost"`
	Status          string           `json:"status"`
	ContractNumber  string           `json:"contract_number"`
	ContractTypeID  int              `json:"contract_type_id"`
	VisibleToID     int              `json:"visible_to_id"`
	NotifyTo        []string         `json:"notify_to"`
	ExpiryNotified  bool             `json:"expiry_notified"`
	RequesterID     int              `json:"requester_id"`
	DelegateeID     int              `json:"delegatee_id"`
	CreatedAt       time.Time        `json:"created_at"`
	UpdatedAt       time.Time        `json:"updated_at"`
	SoftwareID      int              `json:"software_id"`
	LicenseType     string           `json:"license_type"`
	BillingCycle    string           `json:"billing_cycle"`
	LicenseKey      string           `json:"license_key"`
	ItemCostDetails []ItemCostDetail `json:"item_cost_details"`
}

Contract represents a Contract in the FreshService instance.

type ContractService

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

ContractService API Docs: https://api.freshservice.com/#contracts

func (*ContractService) ApproveContract

func (s *ContractService) ApproveContract(id int) (bool, *http.Response, error)

ApproveContract allows for a Contract to be Approved

func (*ContractService) CreateContract

func (s *ContractService) CreateContract(contract *CreateContractModel) (*Contract, *http.Response, error)

CreateContract will create and return a new Contract based on CreateContractModel

func (*ContractService) GetContract

func (s *ContractService) GetContract(id int) (*Contract, *http.Response, error)

GetContract will return a single Contract by id

func (*ContractService) ListContractAssociatedAssets

func (s *ContractService) ListContractAssociatedAssets(id int) (*AssociatedAssets, *http.Response, error)

func (*ContractService) ListContractTypes

func (s *ContractService) ListContractTypes() (*ContractTypes, *http.Response, error)

ListContractTypes will return ContractTypes

func (*ContractService) ListContracts

func (s *ContractService) ListContracts(opt *ListContractsOptions) (*Contracts, *http.Response, error)

ListContracts will return paginated/filtered Contracts using ListContractsOptions

func (*ContractService) RejectContract

func (s *ContractService) RejectContract(id int) (bool, *http.Response, error)

RejectContract rejects the Contract that was submitted for approval

func (*ContractService) SubmitContractApproval

func (s *ContractService) SubmitContractApproval(id int) (bool, *http.Response, error)

SubmitContractApproval allows for a Contract to be submitted for approval

func (*ContractService) UpdateContract

func (s *ContractService) UpdateContract(id int, contract *UpdateContractModel) (*Contract, *http.Response, error)

UpdateContract will update and return a Contract matching id based on UpdateContractModel

type ContractType

type ContractType struct {
	ID            int       `json:"id"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	NeedsApproval bool      `json:"needs_approval"`
	IsDefault     bool      `json:"is_default"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

ContractType represents a type of Contract

type ContractTypes

type ContractTypes struct {
	Collection []ContractType `json:"contract_types"`
}

ContractTypes contains Collection an array of ContractType

type Contracts

type Contracts struct {
	Collection []Contract `json:"contracts"`
}

Contracts contains Collection an array of Contract

type Conversation

type Conversation struct {
	ID           int                `json:"id"`
	Attachments  []TicketAttachment `json:"attachments"`
	Body         string             `json:"body"`
	BodyText     string             `json:"body_text"`
	Incoming     bool               `json:"incoming"`
	ToEmails     []string           `json:"to_emails"`
	Private      bool               `json:"private"`
	Source       int                `json:"source"`
	SupportEmail string             `json:"support_email"`
	TicketID     int                `json:"ticket_id"`
	UserID       int                `json:"user_id"`
	CreatedAt    time.Time          `json:"created_at"`
	UpdatedAt    time.Time          `json:"updated_at"`
}

Conversation represents a Conversation / Discussion on a Ticket

type Conversations

type Conversations struct {
	Collection []Conversation `json:"conversations"`
}

Conversations contains Collection an array of Conversation

type CreateAgentModel

type CreateAgentModel struct {
	FirstName             string                `json:"first_name"`
	LastName              string                `json:"last_name"`
	Occasional            bool                  `json:"occasional"`
	JobTitle              string                `json:"job_title"`
	Email                 string                `json:"email"`
	WorkPhoneNumber       string                `json:"work_phone_number"`
	MobilePhoneNumber     string                `json:"mobile_phone_number"`
	DepartmentIDs         []int                 `json:"department_ids"`
	Address               string                `json:"address"`
	ReportingManagerID    int                   `json:"reporting_manager_id"`
	TimeZone              string                `json:"time_zone"`
	TimeFormat            string                `json:"time_format"`
	Language              string                `json:"language"`
	LocationID            int                   `json:"location_id"`
	BackgroundInformation string                `json:"background_information"`
	ScoreboardLevelID     int                   `json:"scoreboard_level_id"`
	MemberOf              []int                 `json:"member_of"`
	ObserverOf            []int                 `json:"observer_of"`
	Roles                 []AgentRoleAssignment `json:"roles"`
}

CreateAgentModel is a data struct for creating a new Agent

type CreateAnnouncementModel

type CreateAnnouncementModel struct {
	Title            string    `json:"title"`
	BodyHtml         string    `json:"body_html"`
	VisibleFrom      time.Time `json:"visible_from"`
	VisibleTo        time.Time `json:"visible_to"`
	Visibility       string    `json:"visibility"`
	Departments      []int     `json:"departments"`
	Groups           []int     `json:"groups"`
	SendEmail        bool      `json:"send_email"`
	AdditionalEmails []string  `json:"additional_emails"`
}

CreateAnnouncementModel is the data structure required to create an Announcement

type CreateApplicationModel

type CreateApplicationModel struct {
	Name            string   `json:"name"`
	Description     string   `json:"description"`
	ApplicationType string   `json:"application_type"`
	Status          string   `json:"status"`
	PublisherID     int      `json:"publisher_id"`
	ManagedByID     int      `json:"managed_by_id"`
	Notes           string   `json:"notes"`
	Category        string   `json:"category"`
	Sources         []string `json:"sources"`
}

CreateApplicationModel is a data struct for creating a new Application

type CreateAssetModel

type CreateAssetModel struct {
	Name         string    `json:"name"`
	Description  string    `json:"description"`
	AssetTypeID  int       `json:"asset_type_id"`
	AssetTag     string    `json:"asset_tag"`
	Impact       string    `json:"impact"`
	UsageType    string    `json:"usage_type"`
	UserID       int       `json:"user_id"`
	LocationID   int       `json:"location_id"`
	DepartmentID int       `json:"department_id"`
	AgentID      int       `json:"agent_id"`
	GroupID      int       `json:"group_id"`
	AssignedOn   time.Time `json:"assigned_on"`
}

CreateAssetModel is the data structure required to create a new Asset

type CreateAssetTypeModel

type CreateAssetTypeModel struct {
	Name              string `json:"name"`
	Description       string `json:"description"`
	ParentAssetTypeID int    `json:"parent_asset_type_id"`
}

CreateAssetTypeModel is the data structure required to create a new AssetType

type CreateChangeModel

type CreateChangeModel struct {
	AgentID          int       `json:"agent_id"`
	Description      string    `json:"description"`
	Subject          string    `json:"subject"`
	GroupID          int       `json:"group_id"`
	Priority         int       `json:"priority"`
	Impact           int       `json:"impact"`
	Status           int       `json:"status"`
	Risk             int       `json:"risk"`
	ChangeType       int       `json:"change_type"`
	ApprovalStatus   int       `json:"approval_status"`
	PlannedStartDate time.Time `json:"planned_start_date"`
	PlannedEndDate   time.Time `json:"planned_end_date"`
	DepartmentID     int       `json:"department_id"`
}

CreateChangeModel is a data struct for creating a new Change

type CreateContractModel

type CreateContractModel struct {
	Name           string    `json:"name"`
	Description    string    `json:"description,omitempty"`
	VendorID       int       `json:"vendor_id"`
	AutoRenew      bool      `json:"auto_renew,omitempty"`
	NotifyExpiry   bool      `json:"notify_expiry,omitempty"`
	NotifyBefore   int       `json:"notify_before,omitempty"`
	ApproverID     int       `json:"approver_id"`
	StartDate      time.Time `json:"start_date"`
	EndDate        time.Time `json:"end_date"`
	Cost           float32   `json:"cost"`
	ContractNumber string    `json:"contract_number"`
	ContractTypeID int       `json:"contract_type_id"`
	VisibleToID    int       `json:"visible_to_id"`
	NotifyTo       []string  `json:"notify_to,omitempty"`
	SoftwareID     int       `json:"software_id,omitempty"`
	LicenseType    string    `json:"license_type,omitempty"`
	BillingCycle   string    `json:"billing_cycle,omitempty"`
	LicenseKey     string    `json:"license_key,omitempty"`
}

CreateContractModel is the data structure required to create a new Contract

type CreateDepartmentModel

type CreateDepartmentModel struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	HeadUserId  int      `json:"head_user_id"`
	PrimeUserId int      `json:"prime_user_id"`
	Domains     []string `json:"domains"`
}

CreateDepartmentModel is the data structure required to create a new Department

type CreateInstallationModel

type CreateInstallationModel struct {
	InstallationMachineID int       `json:"installation_machine_id"`
	InstallationPath      string    `json:"installation_path"`
	Version               string    `json:"version"`
	InstallationDate      time.Time `json:"installation_date"`
}

type CreateLocationModel

type CreateLocationModel struct {
	Name             string  `json:"name"`
	ParentLocationID int     `json:"parent_location_id"`
	PrimaryContactID int     `json:"primary_contact_id"`
	Address          Address `json:"address"`
}

CreateLocationModel is a data struct for creating a new Location

type CreateProblemModel

type CreateProblemModel struct {
	AgentID        int             `json:"agent_id"`
	GroupID        int             `json:"group_id"`
	Description    string          `json:"description"`
	Priority       int             `json:"priority"`
	Status         int             `json:"status"`
	Impact         int             `json:"impact"`
	Subject        string          `json:"subject"`
	DueBy          time.Time       `json:"due_by"`
	DepartmentID   int             `json:"department_id"`
	Category       string          `json:"category"`
	SubCategory    string          `json:"sub_category"`
	ItemCategory   string          `json:"item_category"`
	AnalysisFields ProblemAnalysis `json:"analysis_fields,omitempty"`
}

CreateProblemModel is the data structure required to create a new Problem

type CreateProductModel

type CreateProductModel struct {
	Name               string `json:"name"`
	Description        string `json:"description"`
	AssetTypeID        int    `json:"asset_type_id"`
	Manufacturer       string `json:"manufacturer"`
	Status             string `json:"status"`
	ModeOfProcurement  string `json:"mode_of_procurement"`
	DepreciationTypeID int    `json:"depreciation_type_id"`
	DescriptionText    string `json:"description_text"`
}

CreateProductModel is a data struct for creating a new Product

type CreatePurchaseOrderModel

type CreatePurchaseOrderModel struct {
	VendorID              int            `json:"vendor_id"`
	Name                  string         `json:"name"`
	PurchaseOrderNumber   string         `json:"po_number"`
	VendorDetails         string         `json:"vendor_details"`
	ExpectedDeliveryDate  time.Time      `json:"expected_delivery_date"`
	ShippingAddress       string         `json:"shipping_address"`
	BillingAddress        string         `json:"billing_address"`
	BillingSameAsShipping bool           `json:"billing_same_as_shipping"`
	CurrencyCode          string         `json:"currency_code"`
	ConversionRate        float32        `json:"conversion_rate"`
	DepartmentID          int            `json:"department_id"`
	DiscountPercentage    float32        `json:"discount_percentage"`
	TaxPercentage         float32        `json:"tax_percentage"`
	ShoppingCost          float32        `json:"shopping_cost"`
	PurchaseItems         []PurchaseItem `json:"purchase_items"`
}

CreatePurchaseOrderModel is a data struct for creating a new PurchaseOrder

type CreateReleaseModel

type CreateReleaseModel struct {
	AgentID          int       `json:"agent_id"`
	GroupID          int       `json:"group_id"`
	Priority         int       `json:"priority"`
	Status           int       `json:"status"`
	ReleaseType      int       `json:"release_type"`
	Subject          string    `json:"subject"`
	Description      string    `json:"description"`
	PlannedStartDate time.Time `json:"planned_start_date"`
	PlannedEndDate   time.Time `json:"planned_end_date"`
	DepartmentID     int       `json:"department_id"`
	Category         string    `json:"category"`
	SubCategory      string    `json:"sub_category"`
	ItemCategory     string    `json:"item_category"`
}

CreateReleaseModel is a data struct for creating a new Release

type CreateRequesterModel

type CreateRequesterModel struct {
	FirstName             string   `json:"first_name"`
	LastName              string   `json:"last_name"`
	JobTitle              string   `json:"job_title"`
	Email                 string   `json:"primary_email"`
	AdditionalEmails      []string `json:"secondary_emails"`
	WorkPhoneNumber       string   `json:"work_phone_number"`
	MobilePhoneNumber     string   `json:"mobile_phone_number"`
	DepartmentIDs         []int    `json:"department_ids"`
	Address               string   `json:"address"`
	ReportingManagerID    int      `json:"reporting_manager_id"`
	TimeZone              string   `json:"time_zone"`
	TimeFormat            string   `json:"time_format"`
	Language              string   `json:"language"`
	LocationID            int      `json:"location_id"`
	BackgroundInformation string   `json:"background_information"`
}

CreateRequesterModel is a data struct for creating a new Requester

type CreateSolutionArticleModel

type CreateSolutionArticleModel struct {
	Title       string    `json:"title"`
	Description string    `json:"description"`
	ArticleType int       `json:"article_type"`
	FolderID    int       `json:"folder_id"`
	Status      int       `json:"status"`
	Tags        []string  `json:"tags"`
	Keywords    []string  `json:"keywords"`
	ReviewDate  time.Time `json:"review_date"`
}

CreateSolutionArticleModel is a data struct for creating a new SolutionArticle

type CreateSolutionCategoryModel

type CreateSolutionCategoryModel struct {
	Name             string `json:"name"`
	Description      string `json:"description"`
	VisibleInPortals []int  `json:"visible_in_portals"`
}

CreateSolutionCategoryModel is the data structure required to create a new SolutionCategory

type CreateSolutionFolderModel

type CreateSolutionFolderModel struct {
	Name              string           `json:"name"`
	Description       string           `json:"description"`
	CategoryID        int              `json:"category_id"`
	Visibility        int              `json:"visibility"`
	DepartmentIDs     []int            `json:"department_ids,omitempty"`
	GroupIDs          []int            `json:"group_ids,omitempty"`
	RequesterGroupIDs []int            `json:"requester_group_ids,omitempty"`
	ManageByGroupIDs  []int            `json:"manage_by_group_ids"`
	ApprovalSettings  ApprovalSettings `json:"approval_settings,omitempty"`
}

CreateSolutionFolderModel is a data struct for creating a new SolutionFolder

type CreateTaskModel

type CreateTaskModel struct {
	DueDate      time.Time `json:"due_date"`
	NotifyBefore int       `json:"notify_before"`
	Title        string    `json:"title"`
	Description  string    `json:"description"`
}

CreateTaskModel is the data structure required to create a new Task

type CreateTicketModel

type CreateTicketModel struct {
	Attachments        []TicketAttachment `json:"attachments"`
	CcEmails           []string           `json:"cc_emails"`
	DepartmentID       int                `json:"department_id"`
	Description        string             `json:"description"`
	DueBy              time.Time          `json:"due_by"`
	Email              string             `json:"email"`
	EmailConfigID      int                `json:"email_config_id"`
	FirstResponseDueBy time.Time          `json:"fr_due_by"`
	GroupID            int                `json:"group_id"`
	Name               string             `json:"name"`
	Phone              string             `json:"phone"`
	Priority           int                `json:"priority"`
	Category           string             `json:"category"`
	SubCategory        string             `json:"sub_category"`
	ItemCategory       string             `json:"item_category"`
	RequesterID        int                `json:"requester_id"`
	ResponderID        int                `json:"responder_id"`
	Source             int                `json:"source"`
	Status             int                `json:"status"`
	Subject            string             `json:"subject"`
	Tags               []string           `json:"tags"`
	Type               string             `json:"type"`
	Urgency            int                `json:"urgency"`
	Impact             int                `json:"impact"`
}

CreateTicketModel is a data struct for creating a new Ticket

type CreateTimeEntryModel

type CreateTimeEntryModel struct {
	AgentID   int    `json:"agent_id"`
	Note      string `json:"note"`
	TimeSpent string `json:"time_spent"`
}

CreateTimeEntryModel is a data structure for creating TimeEntry

type CreateVendorModel

type CreateVendorModel struct {
	Name             string        `json:"name"`
	Description      string        `json:"description"`
	PrimaryContactID int           `json:"primary_contact_id"`
	Address          VendorAddress `json:"address"`
}

CreateVendorModel is the data structure required to create a new Vendor

type Department

type Department struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	HeadUserId  int       `json:"head_user_id"`
	PrimeUserId int       `json:"prime_user_id"`
	Domains     []string  `json:"domains"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

Department represents a FreshService Department (Company/Team)

type DepartmentService

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

DepartmentService API Docs: https://api.freshservice.com/#departments

func (*DepartmentService) CreateDepartment

func (s *DepartmentService) CreateDepartment(newDepartment *CreateDepartmentModel) (*Department, *http.Response, error)

CreateDepartment will create and return a new Department based on CreateDepartmentModel

func (*DepartmentService) DeleteDepartment

func (s *DepartmentService) DeleteDepartment(id int) (bool, *http.Response, error)

DeleteDepartment will completely remove a Department from FreshService matching id

func (*DepartmentService) GetDepartment

func (s *DepartmentService) GetDepartment(id int) (*Department, *http.Response, error)

GetDepartment will return a single Department by id

func (*DepartmentService) ListDepartments

func (s *DepartmentService) ListDepartments(opt *ListDepartmentsOptions) (*Departments, *http.Response, error)

ListDepartments will return paginated/filtered Departments using ListDepartmentsOptions

func (*DepartmentService) UpdateDepartment

func (s *DepartmentService) UpdateDepartment(id int, department *UpdateDepartmentModel) (*Department, *http.Response, error)

UpdateDepartment will update and return a Department matching id based on UpdateDepartmentModel

type Departments

type Departments struct {
	Collection []Department `json:"departments"`
}

Departments contains Collection an array of Department

type Description

type Description struct {
	Description     string `json:"description"`
	DescriptionText string `json:"description_text"`
}

Description represents a Description/DescriptionText pairing.

type Escalation

type Escalation struct {
	Response   EscalationDetails   `json:"response"`
	Resolution []EscalationDetails `json:"resolution"`
}

type EscalationDetails

type EscalationDetails struct {
	Level          string `json:"level"`
	EscalationWhen string `json:"escalation_when"`
	EscalationTime int    `json:"escalation_time"`
	AgentIDs       []int  `json:"agent_ids"`
	GroupIDs       []int  `json:"group_ids"`
}

type Holiday

type Holiday struct {
	HolidayDate string `json:"holiday_date"`
	HolidayName string `json:"holiday_name"`
}

Holiday is a data struct representing a configured holiday

type ItemCostDetail

type ItemCostDetail struct {
	ID           int       `json:"id"`
	ItemName     string    `json:"item_name"`
	PricingModel string    `json:"pricing_model"`
	Cost         float32   `json:"cost"`
	Count        int       `json:"count"`
	Comments     string    `json:"comments"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

ItemCostDetail represents a line-item cost for a Contract

type ListAgentRolesOptions

type ListAgentRolesOptions struct {
	ListOptions
}

ListAgentRolesOptions represents pagination/filtering for AgentRoles

type ListAgentsOptions

type ListAgentsOptions struct {
	ListOptions
	Email  *string `json:"email,omitempty" url:"email,omitempty"`
	Active *bool   `json:"active,omitempty" url:"active,omitempty"`
	State  *string `json:"state,omitempty" url:"state,omitempty"`
}

ListAgentsOptions represents filters/pagination for Agents

type ListAnnouncementsOptions

type ListAnnouncementsOptions struct {
	ListOptions
	State string `json:"state,omitempty" url:"state,omitempty"`
}

ListAnnouncementsOptions represents filters/pagination for Announcements

type ListApplicationsOptions

type ListApplicationsOptions struct {
	ListOptions
}

ListApplicationsOptions represents filters/pagination for Applications

type ListAssetTypesOptions

type ListAssetTypesOptions struct {
	ListOptions
}

ListAssetTypesOptions represents filters/pagination for AssetTypes

type ListAssetsOptions

type ListAssetsOptions struct {
	ListOptions
}

ListAssetsOptions represents filters/pagination for Assets

type ListBusinessHoursOptions

type ListBusinessHoursOptions struct {
	ListOptions
}

ListBusinessHoursOptions represents filters/pagination for BusinessHour

type ListChangesOptions

type ListChangesOptions struct {
	ListOptions
	Filter       *string    `json:"filter,omitempty" url:"filter,omitempty"`
	RequesterID  *int       `json:"requester_id,omitempty" url:"requester_id,omitempty"`
	UpdatedSince *time.Time `json:"updated_since,omitempty" url:"updated_since,omitempty"`
}

ListChangesOptions represents filters/pagination for Changes

type ListContractsOptions

type ListContractsOptions struct {
	ListOptions
}

ListContractsOptions is for filtering/pagination of Contracts

type ListConversationsOptions

type ListConversationsOptions struct {
	ListOptions
}

ListConversationsOptions represents filters/pagination for Conversations

type ListDepartmentsOptions

type ListDepartmentsOptions struct {
	ListOptions
}

ListDepartmentsOptions represents filters/pagination for Departments

type ListLocationsOptions

type ListLocationsOptions struct {
	ListOptions
}

ListLocationsOptions represents filters/pagination for Locations

type ListOptions

type ListOptions struct {
	Page    int `json:"page,omitempty" url:"page,omitempty"`
	PerPage int `json:"per_page,omitempty" url:"per_page,omitempty"`
}

ListOptions defines basic options for pagination, etc

type ListProblemsOptions

type ListProblemsOptions struct {
	ListOptions
}

ListProblemsOptions represents filters/pagination for Problems

type ListProductsOptions

type ListProductsOptions struct {
	ListOptions
}

ListProductsOptions represents filters/pagination for Products

type ListPurchaseOrdersOptions

type ListPurchaseOrdersOptions struct {
	ListOptions
}

ListPurchaseOrdersOptions represents filters/pagination for PurchaseOrders

type ListReleasesOptions

type ListReleasesOptions struct {
	ListOptions
	FilterName *string `json:"filter_name,omitempty" url:"filter_name,omitempty"`
}

ListReleasesOptions represents filters/pagination for Releases

type ListRequestersOptions

type ListRequestersOptions struct {
	ListOptions
	Email         *string `json:"email,omitempty" url:"email,omitempty"`
	IncludeAgents *bool   `json:"include_agents,omitempty" url:"include_agents,omitempty"`
}

ListRequestersOptions represents filters/pagination for Requesters

type ListSoftwareUsersOptions

type ListSoftwareUsersOptions struct {
	ListOptions
}

ListSoftwareUsersOptions represents filters/pagination for SoftwareUsers

type ListSolutionArticlesOptions

type ListSolutionArticlesOptions struct {
	ListOptions
	FolderID int `json:"folder_id,omitempty" url:"folder_id,omitempty"`
}

ListSolutionArticlesOptions represents filters/pagination for SolutionArticles

type ListSolutionCategoriesOptions

type ListSolutionCategoriesOptions struct {
	ListOptions
}

ListSolutionCategoriesOptions represents filters/pagination for SolutionCategories

type ListSolutionFoldersOptions

type ListSolutionFoldersOptions struct {
	ListOptions
	CategoryID int `json:"category_id,omitempty" url:"category_id,omitempty"`
}

ListSolutionFoldersOptions represents filters/pagination for SolutionFolders

type ListTasksOptions

type ListTasksOptions struct {
	ListOptions
}

ListTasksOptions represents filters/pagination for Tasks

type ListTicketsOptions

type ListTicketsOptions struct {
	ListOptions
	Email        *string    `json:"email,omitempty" url:"email,omitempty"`
	RequesterID  *int       `json:"requester_id,omitempty" url:"requester_id,omitempty"`
	UpdatedSince *time.Time `json:"updated_since,omitempty" url:"updated_since,omitempty"`
	Type         *string    `json:"type,omitempty" url:"type,omitempty"`
}

ListTicketsOptions represents filters/pagination for Tickets

type ListVendorsOptions

type ListVendorsOptions struct {
	ListOptions
}

ListVendorsOptions represents filters/pagination for Vendors

type Location

type Location struct {
	ID               int       `json:"id"`
	Name             string    `json:"name"`
	ParentLocationID int       `json:"parent_location_id"`
	PrimaryContactID int       `json:"primary_contact_id"`
	Address          Address   `json:"address"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

Location represents a FreshService Location (Physical Location)

type LocationService

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

LocationService API Docs: https://api.freshservice.com/#locations

func (*LocationService) CreateLocation

func (s *LocationService) CreateLocation(newLocation *CreateLocationModel) (*Location, *http.Response, error)

CreateLocation will create and return a new Location based on CreateLocationModel

func (*LocationService) DeleteLocation

func (s *LocationService) DeleteLocation(id int) (bool, *http.Response, error)

DeleteLocation will completely remove a Location from FreshService matching id

func (*LocationService) GetLocation

func (s *LocationService) GetLocation(id int) (*Location, *http.Response, error)

GetLocation will return a Location by id

func (*LocationService) ListLocations

func (s *LocationService) ListLocations(opt *ListLocationsOptions) (*Locations, *http.Response, error)

ListLocations will return paginated/filtered Locations using ListLocationsOptions

func (*LocationService) UpdateLocation

func (s *LocationService) UpdateLocation(id int, location *UpdateLocationModel) (*Location, *http.Response, error)

UpdateLocation will update and return a Location matching id based UpdateLocationModel

type Locations

type Locations struct {
	Collection []Location `json:"locations"`
}

Locations contains Collection an array of Location

type Note

type Note struct {
	ID           int       `json:"id"`
	UserID       int       `json:"user_id"`
	Body         string    `json:"body"`
	BodyText     string    `json:"body_text"`
	NotifyEmails []string  `json:"notify_emails"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

Note represents a Note attached to a Change

type Notes

type Notes struct {
	Collection []Note `json:"notes"`
}

Notes contains Collection an array of Note

type Policies

type Policies struct {
	Collection []Policy `json:"sla_policies"`
}

Policies contains Collection an array of Policy

type Policy

type Policy struct {
	ID          int         `json:"id"`
	Name        string      `json:"name"`
	Position    int         `json:"position"`
	IsDefault   bool        `json:"is_default"`
	Active      bool        `json:"active"`
	Deleted     bool        `json:"deleted"`
	Description string      `json:"description"`
	Targets     []SLATarget `json:"sla_targets"`
	Applicable  Applicable  `json:"applicable_to"`
	Escalation  Escalation  `json:"escalation"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
}

Policy represents an SLA Policy in FreshService

type Problem

type Problem struct {
	ID               int             `json:"id"`
	AgentID          int             `json:"agent_id"`
	RequesterID      int             `json:"requester_id"`
	GroupID          int             `json:"group_id"`
	Description      string          `json:"description"`
	DescriptionText  string          `json:"description_text"`
	Priority         int             `json:"priority"`
	Status           int             `json:"status"`
	Impact           int             `json:"impact"`
	KnownError       bool            `json:"known_error"`
	Subject          string          `json:"subject"`
	DueBy            time.Time       `json:"due_by"`
	DepartmentID     int             `json:"department_id"`
	Category         string          `json:"category"`
	SubCategory      string          `json:"sub_category"`
	ItemCategory     string          `json:"item_category"`
	AssociatedChange int             `json:"associated_change"`
	AnalysisFields   ProblemAnalysis `json:"analysis_fields,omitempty"`
	CreatedAt        time.Time       `json:"created_at"`
	UpdatedAt        time.Time       `json:"updated_at"`
}

Problem represents a FreshService Problem

type ProblemAnalysis

type ProblemAnalysis struct {
	ProblemCause   Description `json:"problem_cause,omitempty"`
	ProblemSymptom Description `json:"problem_symptom,omitempty"`
	ProblemImpact  Description `json:"problem_impact,omitempty"`
}

ProblemAnalysis is a data structure

type ProblemService

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

ProblemService API Docs: https://api.freshservice.com/#problems

func (*ProblemService) CreateProblem

func (s *ProblemService) CreateProblem(problem *CreateProblemModel) (*Problem, *http.Response, error)

CreateProblem will create and return a new Problem based on CreateProblemModel

func (*ProblemService) CreateProblemNote

func (s *ProblemService) CreateProblemNote(problemId int, note *UpsertNoteModel) (*Note, *http.Response, error)

CreateProblemNote will create and return a new Note based on UpsertNoteModel

func (*ProblemService) CreateTask

func (s *ProblemService) CreateTask(problemId int, newTask *CreateTaskModel) (*Task, *http.Response, error)

CreateTask will create and return a new Task based on CreateTaskModel

func (*ProblemService) CreateTimeEntry

func (s *ProblemService) CreateTimeEntry(problemId int, timeEntry *CreateTimeEntryModel) (*TimeEntry, *http.Response, error)

CreateTimeEntry will create and return a new TimeEntry for the corresponding Problem by problemId based on CreateTimeEntryModel

func (*ProblemService) DeleteProblem

func (s *ProblemService) DeleteProblem(id int) (bool, *http.Response, error)

DeleteProblem will delete a Problem matching the id (non-permanent delete)

func (*ProblemService) DeleteProblemNote

func (s *ProblemService) DeleteProblemNote(problemId int, problemNoteId int) (bool, *http.Response, error)

DeleteProblemNote will completely remove a Note from a Problem

func (*ProblemService) DeleteTask

func (s *ProblemService) DeleteTask(problemId int, taskId int) (bool, *http.Response, error)

DeleteTask deletes the Task on a Problem with the given ID

func (*ProblemService) DeleteTimeEntry

func (s *ProblemService) DeleteTimeEntry(problemId int, timeEntryId int) (bool, *http.Response, error)

DeleteTimeEntry will completely remove a TimeEntry from a Problem

func (*ProblemService) GetProblem

func (s *ProblemService) GetProblem(id int) (*Problem, *http.Response, error)

GetProblem will return a single Problem by id

func (*ProblemService) GetProblemNote

func (s *ProblemService) GetProblemNote(problemId int, problemNoteId int) (*Note, *http.Response, error)

GetProblemNote will return a single Note by id

func (*ProblemService) GetTask

func (s *ProblemService) GetTask(problemId int, taskId int) (*Task, *http.Response, error)

GetTask will return a single Task from a Problem by the id

func (*ProblemService) GetTimeEntry

func (s *ProblemService) GetTimeEntry(problemId int, timeEntryId int) (*TimeEntry, *http.Response, error)

GetTimeEntry will return a single TimeEntry for the specified Problem

func (*ProblemService) ListProblemNotes

func (s *ProblemService) ListProblemNotes(problemId int) (*Notes, *http.Response, error)

ListProblemNotes will return Notes for a specific Problem

func (*ProblemService) ListProblems

func (s *ProblemService) ListProblems(opt *ListProblemsOptions) (*Problems, *http.Response, error)

ListProblems will return paginated/filtered Problems using ListProblemsOptions

func (*ProblemService) ListTasks

func (s *ProblemService) ListTasks(problemId int, opt *ListTasksOptions) (*Tasks, *http.Response, error)

ListTasks will return paginated/filtered Tasks using ListTasksOptions

func (*ProblemService) ListTimeEntries

func (s *ProblemService) ListTimeEntries(problemId int) (*TimeEntries, *http.Response, error)

ListTimeEntries will return TimeEntries for the specified Problem

func (*ProblemService) RestoreProblem

func (s *ProblemService) RestoreProblem(id int) (bool, *http.Response, error)

RestoreProblem will restore a previously deleted Problem by id

func (*ProblemService) UpdateProblem

func (s *ProblemService) UpdateProblem(id int, problem *UpdateProblemModel) (*Problem, *http.Response, error)

UpdateProblem will update and return a Problem matching id based on UpdateProblemModel

func (*ProblemService) UpdateProblemNote

func (s *ProblemService) UpdateProblemNote(problemId int, problemNoteId int, note *UpsertNoteModel) (*Note, *http.Response, error)

UpdateProblemNote will update and return a Note matching id based on UpsertNoteModel

func (*ProblemService) UpdateTask

func (s *ProblemService) UpdateTask(problemId int, taskId int, task *UpdateTaskModel) (*Task, *http.Response, error)

UpdateTask will update and return a Task matching id based on UpdateTaskModel

type Problems

type Problems struct {
	Collection []Problem `json:"problems"`
}

Problems contains Collection an array of Problem

type Product

type Product struct {
	ID                 int       `json:"id"`
	Name               string    `json:"name"`
	Description        string    `json:"description"`
	AssetTypeID        int       `json:"asset_type_id"`
	Manufacturer       string    `json:"manufacturer"`
	Status             string    `json:"status"`
	ModeOfProcurement  string    `json:"mode_of_procurement"`
	DepreciationTypeID int       `json:"depreciation_type_id"`
	DescriptionText    string    `json:"description_text"`
	CreatedAt          time.Time `json:"created_at"`
	UpdatedAt          time.Time `json:"updated_at"`
}

Product represents a FreshService Product

type ProductService

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

ProductService API Docs: https://api.freshservice.com/#products

func (*ProductService) CreateProduct

func (s *ProductService) CreateProduct(newProduct *CreateProductModel) (*Product, *http.Response, error)

CreateProduct will create and return a new Product based on CreateProductModel

func (*ProductService) DeleteProduct

func (s *ProductService) DeleteProduct(id int) (bool, *http.Response, error)

DeleteProduct will completely remove a Product from FreshService matching id

func (*ProductService) GetProduct

func (s *ProductService) GetProduct(id int) (*Product, *http.Response, error)

GetProduct will return a Product by id

func (*ProductService) ListProducts

func (s *ProductService) ListProducts(opt *ListProductsOptions) (*Products, *http.Response, error)

ListProducts will return paginated/filtered Products using ListProductsOptions

func (*ProductService) UpdateProduct

func (s *ProductService) UpdateProduct(id int, product *UpdateLocationModel) (*Product, *http.Response, error)

UpdateProduct will update and return a Product matching id based UpdateProductModel

type Products

type Products struct {
	Collection []Product `json:"products"`
}

Products contains Collection an array of Product

type PurchaseItem

type PurchaseItem struct {
	ItemType      int     `json:"item_type"`
	ItemName      string  `json:"item_name"`
	Description   string  `json:"description"`
	Cost          float32 `json:"cost"`
	Quantity      int     `json:"quantity"`
	TaxPercentage float32 `json:"tax_percentage"`
}

PurchaseItem represents a line item on a PurchaseOrder

type PurchaseOrder

type PurchaseOrder struct {
	ID                    int            `json:"id"`
	VendorID              int            `json:"vendor_id"`
	Name                  string         `json:"name"`
	PurchaseOrderNumber   string         `json:"po_number"`
	VendorDetails         string         `json:"vendor_details"`
	ExpectedDeliveryDate  time.Time      `json:"expected_delivery_date"`
	CreatedBy             int            `json:"created_by"`
	Status                int            `json:"status"`
	ShippingAddress       string         `json:"shipping_address"`
	BillingAddress        string         `json:"billing_address"`
	BillingSameAsShipping bool           `json:"billing_same_as_shipping"`
	CurrencyCode          string         `json:"currency_code"`
	ConversionRate        float32        `json:"conversion_rate"`
	DepartmentID          int            `json:"department_id"`
	DiscountPercentage    float32        `json:"discount_percentage"`
	TaxPercentage         float32        `json:"tax_percentage"`
	ShoppingCost          float32        `json:"shopping_cost"`
	PurchaseItems         []PurchaseItem `json:"purchase_items"`
	CreatedAt             time.Time      `json:"created_at"`
	UpdatedAt             time.Time      `json:"updated_at"`
}

PurchaseOrder represents a PurchaseOrder in FreshService

type PurchaseOrderService

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

PurchaseOrderService API Docs: https://api.freshservice.com/#purchase-order

func (*PurchaseOrderService) CreatePurchaseOrder

func (s *PurchaseOrderService) CreatePurchaseOrder(newPurchaseOrder *CreatePurchaseOrderModel) (*PurchaseOrder, *http.Response, error)

CreatePurchaseOrder will create and return a new PurchaseOrder based on CreatePurchaseOrderModel

func (*PurchaseOrderService) DeletePurchaseOrder

func (s *PurchaseOrderService) DeletePurchaseOrder(id int) (bool, *http.Response, error)

DeletePurchaseOrder will completely remove an PurchaseOrder from FreshService

func (*PurchaseOrderService) GetPurchaseOrder

func (s *PurchaseOrderService) GetPurchaseOrder(id int) (*PurchaseOrder, *http.Response, error)

GetPurchaseOrder will return a single PurchaseOrder by id

func (*PurchaseOrderService) ListPurchaseOrders

ListPurchaseOrders will return paginated/filtered PurchaseOrders using ListPurchaseOrdersOptions

func (*PurchaseOrderService) UpdatePurchaseOrder

func (s *PurchaseOrderService) UpdatePurchaseOrder(id int, purchaseOrder *UpdatePurchaseOrderModel) (*PurchaseOrder, *http.Response, error)

UpdatePurchaseOrder will update and return an PurchaseOrder matching id based on UpdatePurchaseOrderModel

type PurchaseOrders

type PurchaseOrders struct {
	Collection []PurchaseOrder `json:"purchase_orders"`
}

PurchaseOrders contains Collection an array of PurchaseOrder

type Release

type Release struct {
	ID                int       `json:"id"`
	AgentID           int       `json:"agent_id"`
	GroupID           int       `json:"group_id"`
	Priority          int       `json:"priority"`
	Status            int       `json:"status"`
	ReleaseType       int       `json:"release_type"`
	Subject           string    `json:"subject"`
	Description       string    `json:"description"`
	PlannedStartDate  time.Time `json:"planned_start_date"`
	PlannedEndDate    time.Time `json:"planned_end_date"`
	WorkStartDate     time.Time `json:"work_start_date"`
	WorkEndDate       time.Time `json:"work_end_date"`
	DepartmentID      int       `json:"department_id"`
	Category          string    `json:"category"`
	SubCategory       string    `json:"sub_category"`
	ItemCategory      string    `json:"item_category"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
	AssociatedAssets  []int     `json:"associated_assets"`
	AssociatedChanges []int     `json:"associated_changes"`
}

Release represents a Release in FreshService

type ReleaseService

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

ReleaseService API Docs: https://api.freshservice.com/#releases

func (*ReleaseService) CreateRelease

func (s *ReleaseService) CreateRelease(newRelease *CreateReleaseModel) (*Release, *http.Response, error)

CreateRelease will create and return a new Release based on CreateReleaseModel

func (*ReleaseService) CreateReleaseNote

func (s *ReleaseService) CreateReleaseNote(releaseId int, note *UpsertNoteModel) (*Note, *http.Response, error)

CreateReleaseNote will create and return a new Note based on UpsertNoteModel

func (*ReleaseService) CreateTask

func (s *ReleaseService) CreateTask(releaseId int, newTask *CreateTaskModel) (*Task, *http.Response, error)

CreateTask will create and return a new Task based on CreateTaskModel

func (*ReleaseService) CreateTimeEntry

func (s *ReleaseService) CreateTimeEntry(releaseId int, timeEntry *CreateTimeEntryModel) (*TimeEntry, *http.Response, error)

CreateTimeEntry will create and return a new TimeEntry for the corresponding Release by releaseId based on CreateTimeEntryModel

func (*ReleaseService) DeleteRelease

func (s *ReleaseService) DeleteRelease(id int) (bool, *http.Response, error)

DeleteRelease will delete a Release from FreshService (Can be restored by RestoreRelease)

func (*ReleaseService) DeleteReleaseNote

func (s *ReleaseService) DeleteReleaseNote(releaseId int, releaseNoteId int) (bool, *http.Response, error)

DeleteReleaseNote will completely remove a Note from a Release

func (*ReleaseService) DeleteTask

func (s *ReleaseService) DeleteTask(releaseId int, taskId int) (bool, *http.Response, error)

DeleteTask deletes the Task on a Release with the given ID

func (*ReleaseService) DeleteTimeEntry

func (s *ReleaseService) DeleteTimeEntry(releaseId int, timeEntryId int) (bool, *http.Response, error)

DeleteTimeEntry will completely remove a TimeEntry from a Release

func (*ReleaseService) GetRelease

func (s *ReleaseService) GetRelease(id int) (*Release, *http.Response, error)

GetRelease will return a single Release by id

func (*ReleaseService) GetReleaseNote

func (s *ReleaseService) GetReleaseNote(releaseId int, releaseNoteId int) (*Note, *http.Response, error)

GetReleaseNote will return a single Note by id

func (*ReleaseService) GetTask

func (s *ReleaseService) GetTask(releaseId int, taskId int) (*Task, *http.Response, error)

GetTask will return a single Task from a Release by the id

func (*ReleaseService) GetTimeEntry

func (s *ReleaseService) GetTimeEntry(releaseId int, timeEntryId int) (*TimeEntry, *http.Response, error)

GetTimeEntry will return a single TimeEntry for the specified Release

func (*ReleaseService) ListReleaseNotes

func (s *ReleaseService) ListReleaseNotes(releaseId int) (*Notes, *http.Response, error)

ListReleaseNotes will return Notes for a specific Release

func (*ReleaseService) ListReleases

func (s *ReleaseService) ListReleases(opt *ListReleasesOptions) (*Releases, *http.Response, error)

ListReleases will return paginated/filtered Release using ListReleasesOptions

func (*ReleaseService) ListTasks

func (s *ReleaseService) ListTasks(releaseId int, opt *ListTasksOptions) (*Tasks, *http.Response, error)

ListTasks will return paginated/filtered Tasks using ListTasksOptions

func (*ReleaseService) ListTimeEntries

func (s *ReleaseService) ListTimeEntries(releaseId int) (*TimeEntries, *http.Response, error)

ListTimeEntries will return TimeEntries for the specified Release

func (*ReleaseService) RestoreRelease

func (s *ReleaseService) RestoreRelease(id int) (bool, *http.Response, error)

RestoreRelease will restore a previously trashed (deleted) Release

func (*ReleaseService) UpdateRelease

func (s *ReleaseService) UpdateRelease(id int, ticket *UpdateReleaseModel) (*Release, *http.Response, error)

UpdateRelease will update and return a Release matching id based on UpdateReleaseModel

func (*ReleaseService) UpdateReleaseNote

func (s *ReleaseService) UpdateReleaseNote(releaseId int, releaseNoteId int, note *UpsertNoteModel) (*Note, *http.Response, error)

UpdateReleaseNote will update and return a Note matching id based on UpsertNoteModel

func (*ReleaseService) UpdateTask

func (s *ReleaseService) UpdateTask(releaseId int, taskId int, task *UpdateTaskModel) (*Task, *http.Response, error)

UpdateTask will update and return a Task matching id based on UpdateTaskModel

type Releases

type Releases struct {
	Collection []Release `json:"releases"`
}

Releases contains Collection an array of Release

type Requester

type Requester struct {
	ID                    int       `json:"id"`
	FirstName             string    `json:"first_name"`
	LastName              string    `json:"last_name"`
	JobTitle              string    `json:"job_title"`
	Email                 string    `json:"primary_email"`
	AdditionalEmails      []string  `json:"secondary_emails"`
	WorkPhoneNumber       string    `json:"work_phone_number"`
	MobilePhoneNumber     string    `json:"mobile_phone_number"`
	DepartmentIDs         []int     `json:"department_ids"`
	Active                bool      `json:"active"`
	Address               string    `json:"address"`
	ReportingManagerID    int       `json:"reporting_manager_id"`
	TimeZone              string    `json:"time_zone"`
	TimeFormat            string    `json:"time_format"`
	Language              string    `json:"language"`
	LocationID            int       `json:"location_id"`
	BackgroundInformation string    `json:"background_information"`
	HasLoggedIn           bool      `json:"has_logged_in"`
	IsAgent               bool      `json:"is_agent"`
	CreatedAt             time.Time `json:"created_at"`
	UpdatedAt             time.Time `json:"updated_at"`
}

Requester represents a FreshService Requester (User)

type RequesterService

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

RequesterService API Docs: https://api.freshservice.com/#requesters https://api.freshservice.com/#requester-groups

func (*RequesterService) CreateRequester

func (s *RequesterService) CreateRequester(newRequester *CreateRequesterModel) (*Requester, *http.Response, error)

CreateRequester will create and return a new Requester based on CreateRequesterModel

func (*RequesterService) DeactivateRequester

func (s *RequesterService) DeactivateRequester(id int) (bool, *http.Response, error)

DeactivateRequester will deactivate the Requester matching the id

func (*RequesterService) DeleteRequester

func (s *RequesterService) DeleteRequester(id int) (bool, *http.Response, error)

DeleteRequester will completely remove a Requester from FreshService matching id (along with their requested Tickets)

func (*RequesterService) GetRequester

func (s *RequesterService) GetRequester(id int) (*Requester, *http.Response, error)

GetRequester will return a single Requester by id

func (*RequesterService) ListRequesters

func (s *RequesterService) ListRequesters(opt *ListRequestersOptions) (*Requesters, *http.Response, error)

ListRequesters will return paginated/filtered Requesters using ListRequestersOptions

func (*RequesterService) ReactivateRequester

func (s *RequesterService) ReactivateRequester(id int) (*Requester, *http.Response, error)

ReactivateRequester will reactivate a deactivated Requester matching the id

func (*RequesterService) UpdateRequester

func (s *RequesterService) UpdateRequester(id int, requester *UpdateRequesterModel) (*Requester, *http.Response, error)

UpdateRequester will update and return an Requester matching id based on UpdateRequesterModel

type Requesters

type Requesters struct {
	Collection []Requester `json:"requesters"`
}

Requesters contains Collection an array of Requester

type SLAPoliciesService

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

SLAPoliciesService API Docs: https://api.freshservice.com/#sla-policies

func (*SLAPoliciesService) ListPolicies

func (s *SLAPoliciesService) ListPolicies() (*Policies, *http.Response, error)

ListPolicies will return SLA Policies

type SLATarget

type SLATarget struct {
	Priority          int  `json:"priority"`
	EscalationEnabled bool `json:"escalation_enabled"`
	RespondWithin     int  `json:"respond_within"`
	ResolveWithin     int  `json:"resolve_within"`
	BusinessHours     bool `json:"business_hours"`
}

type ServiceCatalogService

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

ServiceCatalogService API Docs: https://api.freshservice.com/#service-catalog

func (*ServiceCatalogService) GetServiceItem

func (s *ServiceCatalogService) GetServiceItem(displayId int) (*ServiceItem, *http.Response, error)

GetServiceItem will return a ServiceItem by displayId

func (*ServiceCatalogService) ListServiceItems

func (s *ServiceCatalogService) ListServiceItems() (*ServiceItems, *http.Response, error)

ListServiceItems will return ServiceItems

func (*ServiceCatalogService) SearchServiceItems

func (s *ServiceCatalogService) SearchServiceItems(search *ServiceItemSearch) (*ServiceItems, *http.Response, error)

SearchServiceItems will return paginated/filtered ServiceItems based on ServiceItemSearch

type ServiceCategories

type ServiceCategories struct {
	Collection []ServiceCategory `json:"service_categories"`
}

ServiceCategories contains Collection an array of ServiceCategory

type ServiceCategory

type ServiceCategory struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Position    int       `json:"position"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

ServiceCategory represents a ServiceCategory in FreshService

type ServiceItem

type ServiceItem struct {
	ID                     int       `json:"id"`
	Name                   string    `json:"name"`
	DeliveryTime           int       `json:"delivery_time"`
	DisplayID              int       `json:"display_id"`
	CategoryID             int       `json:"category_id"`
	ProductID              int       `json:"product_id"`
	Quantity               int       `json:"quantity"`
	Deleted                bool      `json:"deleted"`
	GroupVisibility        int       `json:"group_visibility"`
	ItemType               int       `json:"item_type"`
	CITypeID               int       `json:"ci_type_id"`
	CostVisibility         bool      `json:"cost_visibility"`
	DeliveryTimeVisibility bool      `json:"delivery_time_visibility"`
	Botified               bool      `json:"botified"`
	Visibility             int       `json:"visibility"`
	AllowAttachments       bool      `json:"allow_attachments"`
	AllowQuantity          bool      `json:"allow_quantity"`
	IsBundle               bool      `json:"is_bundle"`
	CreateChild            bool      `json:"create_child"`
	Description            string    `json:"description"`
	ShortDescription       string    `json:"short_description"`
	Cost                   float32   `json:"cost"`
	CreatedAt              time.Time `json:"created_at"`
	UpdatedAt              time.Time `json:"updated_at"`
}

ServiceItem represents a ServiceItem from the ServiceCatalog in FreshService

type ServiceItemSearch

type ServiceItemSearch struct {
	ListOptions
	SearchTerm string `json:"search_term,omitempty" url:"search_term,omitempty"`
	UserEmail  string `json:"user_email,omitempty" url:"user_email,omitempty"`
}

type ServiceItems

type ServiceItems struct {
	Collection []ServiceItem `json:"service_items"`
}

ServiceItems contains Collection an array of ServiceItem

type SoftwareInstallation

type SoftwareInstallation struct {
	ID                    int       `json:"id"`
	InstallationMachineID int       `json:"installation_machine_id"`
	InstallationPath      string    `json:"installation_path"`
	Version               string    `json:"version"`
	UserID                int       `json:"user_id"`
	DepartmentID          int       `json:"department_id"`
	InstallationDate      time.Time `json:"installation_date"`
	CreatedAt             time.Time `json:"created_at"`
	UpdatedAt             time.Time `json:"updated_at"`
}

SoftwareInstallation represents a binding between an Application and a Device in FreshService

type SoftwareInstallations

type SoftwareInstallations struct {
	Collection []SoftwareInstallation `json:"installations"`
}

SoftwareInstallations contains Collection an array of SoftwareInstallation

type SoftwareService

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

SoftwareService API Docs: https://api.freshservice.com/#software

func (*SoftwareService) AddInstallation

func (s *SoftwareService) AddInstallation(applicationId int, installation *CreateInstallationModel) (*SoftwareInstallation, *http.Response, error)

AddInstallation allows for adding a Device to an Application as a SoftwareInstallation

func (*SoftwareService) BulkAddUsers

func (s *SoftwareService) BulkAddUsers(applicationId int, userBindings *SoftwareUserBindings) (*SoftwareUsers, *http.Response, error)

BulkAddUsers allows for adding many SoftwareUser records to an Application as a bulk operation, returns SoftwareUsers

func (*SoftwareService) BulkUpdateUsers

func (s *SoftwareService) BulkUpdateUsers(applicationId int, userBindings *SoftwareUserBindings) (*SoftwareUsers, *http.Response, error)

BulkUpdateUsers allows for updating many SoftwareUser records of an Application as a bulk operation, returns SoftwareUsers

func (*SoftwareService) CreateApplication

func (s *SoftwareService) CreateApplication(newApplication *CreateApplicationModel) (*Application, *http.Response, error)

CreateApplication will create and return a new Application based on CreateApplicationModel

func (*SoftwareService) DeleteApplication

func (s *SoftwareService) DeleteApplication(id int) (bool, *http.Response, error)

DeleteApplication will completely remove an Application from FreshService matching id

func (*SoftwareService) DeleteInstallations

func (s *SoftwareService) DeleteInstallations(applicationId int, deviceIds []string) (bool, *http.Response, error)

DeleteInstallations allows for bulk removal of Devices from Application

func (*SoftwareService) DeleteUsers

func (s *SoftwareService) DeleteUsers(applicationId int, userIds []string) (bool, *http.Response, error)

DeleteUsers allows for bulk removal of Users (Requesters or Agent)

func (*SoftwareService) GetApplication

func (s *SoftwareService) GetApplication(id int) (*Application, *http.Response, error)

GetApplication will return an Application by id

func (*SoftwareService) GetSoftwareUser

func (s *SoftwareService) GetSoftwareUser(applicationId int, id int) (*SoftwareUser, *http.Response, error)

GetSoftwareUser will return an SoftwareUser by id

func (*SoftwareService) ListApplications

func (s *SoftwareService) ListApplications(opt *ListApplicationsOptions) (*Applications, *http.Response, error)

ListApplications will return paginated/filtered Applications using ListApplicationsOptions

func (*SoftwareService) ListInstallations

func (s *SoftwareService) ListInstallations(applicationId int) (*SoftwareInstallations, *http.Response, error)

ListInstallations will return SoftwareInstallations for a specific Application

func (*SoftwareService) ListSoftwareUsers

func (s *SoftwareService) ListSoftwareUsers(applicationId int, opt *ListSoftwareUsersOptions) (*SoftwareUsers, *http.Response, error)

ListSoftwareUsers will return paginated/filtered SoftwareUsers using ListSoftwareUsersOptions

func (*SoftwareService) UpdateApplication

func (s *SoftwareService) UpdateApplication(id int, application *UpdateLocationModel) (*Application, *http.Response, error)

UpdateApplication will update and return a Application matching id based UpdateApplicationModel

type SoftwareUser

type SoftwareUser struct {
	ID            int       `json:"id"`
	UserID        int       `json:"user_id"`
	LicenseID     int       `json:"license_id"`
	AllocatedDate time.Time `json:"allocated_date"`
	FirstUsed     time.Time `json:"first_used"`
	LastUsed      time.Time `json:"last_used"`
	Sources       []string  `json:"sources"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

SoftwareUser represents a binding between a User (Requester or Agent) and an Application

type SoftwareUserBindingModel

type SoftwareUserBindingModel struct {
	UserID        int       `json:"user_id"`
	LicenseID     int       `json:"license_id"`
	AllocatedDate time.Time `json:"allocated_date"`
	FirstUsed     time.Time `json:"first_used"`
	LastUsed      time.Time `json:"last_used"`
	Sources       []string  `json:"sources"`
}

type SoftwareUserBindings

type SoftwareUserBindings struct {
	Collection []SoftwareUserBindingModel `json:"application_users"`
}

SoftwareUserBindings contains Collection an array of SoftwareUserBindingModel

type SoftwareUsers

type SoftwareUsers struct {
	Collection []SoftwareUser `json:"application_users"`
}

SoftwareUsers contains Collection an array of SoftwareUser

type SolutionArticle

type SolutionArticle struct {
	ID             int       `json:"id"`
	Title          string    `json:"title"`
	Description    string    `json:"description"`
	Position       int       `json:"position"`
	ArticleType    int       `json:"article_type"`
	FolderID       int       `json:"folder_id"`
	CategoryID     int       `json:"category_id"`
	Status         int       `json:"status"`
	ApprovalStatus int       `json:"approval_status"`
	ThumbsUp       int       `json:"thumbs_up"`
	ThumbsDown     int       `json:"thumbs_down"`
	AgentID        int       `json:"agent_id"`
	Views          int       `json:"views"`
	Tags           []string  `json:"tags"`
	Keywords       []string  `json:"keywords"`
	Url            string    `json:"url"`
	ReviewDate     time.Time `json:"review_date"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

SolutionArticle represents a FreshService SolutionArticle

type SolutionArticles

type SolutionArticles struct {
	Collection []SolutionArticle `json:"articles"`
}

SolutionArticles contains Collection an array of SolutionArticle

type SolutionCategories

type SolutionCategories struct {
	Collection []SolutionCategory `json:"categories"`
}

SolutionCategories contains Collection an array of SolutionCategory

type SolutionCategory

type SolutionCategory struct {
	ID               int       `json:"id"`
	Name             string    `json:"name"`
	Description      string    `json:"description"`
	Position         int       `json:"position"`
	DefaultCategory  bool      `json:"default_category"`
	VisibleInPortals []int     `json:"visible_in_portals"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

SolutionCategory represents a FreshService SolutionCategory

type SolutionFolder

type SolutionFolder struct {
	ID                int              `json:"id"`
	Name              string           `json:"name"`
	Description       string           `json:"description"`
	Position          int              `json:"position"`
	DefaultFolder     bool             `json:"default_folder"`
	CategoryID        int              `json:"category_id"`
	Visibility        int              `json:"visibility"`
	DepartmentIDs     []int            `json:"department_ids"`
	GroupIDs          []int            `json:"group_ids"`
	RequesterGroupIDs []int            `json:"requester_group_ids"`
	ManageByGroupIDs  []int            `json:"manage_by_group_ids"`
	ApprovalSettings  ApprovalSettings `json:"approval_settings"`
	CreatedAt         time.Time        `json:"created_at"`
	UpdatedAt         time.Time        `json:"updated_at"`
}

SolutionFolder represents a FreshService SolutionFolder

type SolutionFolders

type SolutionFolders struct {
	Collection []SolutionFolder `json:"folders"`
}

SolutionFolders contains Collection an array of SolutionFolder

type SolutionService

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

SolutionService API Docs: https://api.freshservice.com/#solution-category https://api.freshservice.com/#solution-folder https://api.freshservice.com/#solution-article

func (*SolutionService) CreateSolutionArticle

func (s *SolutionService) CreateSolutionArticle(solutionArticle *CreateSolutionArticleModel) (*SolutionArticle, *http.Response, error)

CreateSolutionArticle will create and return a new SolutionArticle based on CreateSolutionArticleModel

func (*SolutionService) CreateSolutionCategory

func (s *SolutionService) CreateSolutionCategory(solutionCategory *CreateSolutionCategoryModel) (*SolutionCategory, *http.Response, error)

CreateSolutionCategory will create and return a new SolutionCategory based on CreateSolutionCategoryModel

func (*SolutionService) CreateSolutionFolder

func (s *SolutionService) CreateSolutionFolder(solutionFolder *CreateSolutionFolderModel) (*SolutionFolder, *http.Response, error)

CreateSolutionFolder will create and return a new SolutionFolder based on CreateSolutionFolderModel

func (*SolutionService) DeleteSolutionArticle

func (s *SolutionService) DeleteSolutionArticle(id int) (bool, *http.Response, error)

DeleteSolutionArticle will completely remove a SolutionArticle from FreshService matching id

func (*SolutionService) DeleteSolutionCategory

func (s *SolutionService) DeleteSolutionCategory(id int) (bool, *http.Response, error)

DeleteSolutionCategory will completely remove a SolutionCategory from FreshService matching id

func (*SolutionService) DeleteSolutionFolder

func (s *SolutionService) DeleteSolutionFolder(id int) (bool, *http.Response, error)

DeleteSolutionFolder will completely remove a SolutionFolder from FreshService matching id

func (*SolutionService) GetSolutionArticle

func (s *SolutionService) GetSolutionArticle(id int) (*SolutionArticle, *http.Response, error)

GetSolutionArticle will return a SolutionArticle by id

func (*SolutionService) GetSolutionCategory

func (s *SolutionService) GetSolutionCategory(id int) (*SolutionCategory, *http.Response, error)

GetSolutionCategory will return a single SolutionCategory by id

func (*SolutionService) GetSolutionFolder

func (s *SolutionService) GetSolutionFolder(id int) (*SolutionFolder, *http.Response, error)

GetSolutionFolder will return a SolutionFolder by id

func (*SolutionService) ListSolutionArticles

func (s *SolutionService) ListSolutionArticles(opt *ListSolutionArticlesOptions) (*SolutionArticles, *http.Response, error)

ListSolutionArticles will return paginated/filtered SolutionArticles using ListSolutionArticlesOptions

func (*SolutionService) ListSolutionCategories

ListSolutionCategories will return paginated/filtered SolutionCategories using ListSolutionCategoriesOptions

func (*SolutionService) ListSolutionFolders

func (s *SolutionService) ListSolutionFolders(opt *ListSolutionFoldersOptions) (*SolutionFolders, *http.Response, error)

ListSolutionFolders will return paginated/filtered SolutionFolders using ListSolutionFoldersOptions

func (*SolutionService) SendSolutionArticleForApproval

func (s *SolutionService) SendSolutionArticleForApproval(id int) (*SolutionArticle, *http.Response, error)

SendSolutionArticleForApproval sends the SolutionArticle matching id for approval

func (*SolutionService) UpdateSolutionArticle

func (s *SolutionService) UpdateSolutionArticle(id int, solutionArticle *UpdateSolutionArticleModel) (*SolutionArticle, *http.Response, error)

UpdateSolutionArticle will update and return a SolutionArticle matching id based UpdateSolutionArticleModel

func (*SolutionService) UpdateSolutionCategory

func (s *SolutionService) UpdateSolutionCategory(id int, solutionCategory *UpdateSolutionCategoryModel) (*SolutionCategory, *http.Response, error)

UpdateSolutionCategory will update and return a SolutionCategory matching id based on UpdateSolutionCategoryModel

func (*SolutionService) UpdateSolutionFolder

func (s *SolutionService) UpdateSolutionFolder(id int, solutionFolder *UpdateSolutionFolderModel) (*SolutionFolder, *http.Response, error)

UpdateSolutionFolder will update and return a SolutionFolder matching id based UpdateSolutionFolderModel

type Task

type Task struct {
	ID           int       `json:"id"`
	AgentID      int       `json:"agent_id"`
	Status       int       `json:"status"`
	DueDate      time.Time `json:"due_date"`
	NotifyBefore int       `json:"notify_before"`
	Title        string    `json:"title"`
	Description  string    `json:"description"`
	GroupID      int       `json:"group_id"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	ClosedAt     time.Time `json:"closed_at"`
}

Task represents a Task on a FreshService Ticket

type Tasks

type Tasks struct {
	Collection []Task `json:"tasks"`
}

Tasks contains Collection an array of Task

type Ticket

type Ticket struct {
	ID                     int                `json:"id"`
	Attachments            []TicketAttachment `json:"attachments"`
	CcEmails               []string           `json:"cc_emails"`
	DepartmentID           int                `json:"department_id"`
	Deleted                bool               `json:"deleted"`
	Description            string             `json:"description"`
	DescriptionText        string             `json:"description_text"`
	DueBy                  time.Time          `json:"due_by"`
	Email                  string             `json:"email"`
	EmailConfigID          int                `json:"email_config_id"`
	FirstResponseDueBy     time.Time          `json:"fr_due_by"`
	FirstResponseEscalated bool               `json:"fr_escalated"`
	ForwardEmails          []string           `json:"fwd_emails"`
	GroupID                int                `json:"group_id"`
	IsEscalated            bool               `json:"is_escalated"`
	Name                   string             `json:"name"`
	Phone                  string             `json:"phone"`
	Priority               int                `json:"priority"`
	Category               string             `json:"category"`
	SubCategory            string             `json:"sub_category"`
	ItemCategory           string             `json:"item_category"`
	ReplyCcEmails          []string           `json:"reply_cc_emails"`
	RequesterID            int                `json:"requester_id"`
	ResponderID            int                `json:"responder_id"`
	Source                 int                `json:"source"`
	Spam                   bool               `json:"spam"`
	Status                 int                `json:"status"`
	Subject                string             `json:"subject"`
	Tags                   []string           `json:"tags"`
	ToEmails               []string           `json:"to_emails"`
	Type                   string             `json:"type"`
	Urgency                int                `json:"urgency"`
	Impact                 int                `json:"impact"`
	CreatedAt              time.Time          `json:"created_at"`
	UpdatedAt              time.Time          `json:"updated_at"`
}

Ticket represents a FreshService Ticket

type TicketActivities

type TicketActivities struct {
	Collection []TicketActivity `json:"activities"`
}

TicketActivities contains Collection an array of TicketActivity

type TicketActivity

type TicketActivity struct {
	Actor       Actor     `json:"actor"`
	Content     string    `json:"content"`
	SubContents string    `json:"sub_contents"`
	CreatedAt   time.Time `json:"created_at"`
}

TicketActivity represents an Audit Item on a Ticket

type TicketAttachment

type TicketAttachment struct {
	Name          string    `json:"name"`
	Size          int       `json:"size"`
	ContentType   string    `json:"content_type"`
	AttachmentUrl string    `json:"attachment_url"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

TicketAttachment represents an Attachment on a Ticket

type TicketService

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

TicketService API Docs: https://api.freshservice.com/#tickets

func (*TicketService) CreateTask

func (s *TicketService) CreateTask(ticketId int, newTask *CreateTaskModel) (*Task, *http.Response, error)

CreateTask will create and return a new Task based on CreateTaskModel

func (*TicketService) CreateTicket

func (s *TicketService) CreateTicket(newTicket *CreateAgentModel) (*Ticket, *http.Response, error)

CreateTicket will create and return a new Ticket based on CreateTicketModel

func (*TicketService) CreateTimeEntry

func (s *TicketService) CreateTimeEntry(ticketId int, timeEntry *CreateTimeEntryModel) (*TimeEntry, *http.Response, error)

CreateTimeEntry will create and return a new TimeEntry for the corresponding Ticket by ticketId based on CreateTimeEntryModel

func (*TicketService) DeleteAttachment

func (s *TicketService) DeleteAttachment(ticketId int, attachmentId int) (bool, *http.Response, error)

DeleteAttachment will remove a TicketAttachment from a Ticket

func (*TicketService) DeleteTask

func (s *TicketService) DeleteTask(ticketId int, taskId int) (bool, *http.Response, error)

DeleteTask deletes the Task on a Ticket with the given ID

func (*TicketService) DeleteTicket

func (s *TicketService) DeleteTicket(id int) (bool, *http.Response, error)

DeleteTicket will trash a Ticket from FreshService (Can be restored by RestoreTicket)

func (*TicketService) DeleteTimeEntry

func (s *TicketService) DeleteTimeEntry(ticketId int, timeEntryId int) (bool, *http.Response, error)

DeleteTimeEntry will completely remove a TimeEntry from a Ticket

func (*TicketService) GetAudit

func (s *TicketService) GetAudit(ticketId int) (*TicketActivities, *http.Response, error)

GetAudit returns TicketActivities for a specific Ticket

func (*TicketService) GetTask

func (s *TicketService) GetTask(ticketId int, taskId int) (*Task, *http.Response, error)

GetTask will return a single Task from a Ticket by the id

func (*TicketService) GetTicket

func (s *TicketService) GetTicket(id int) (*Ticket, *http.Response, error)

GetTicket will return a single Ticket by id

func (*TicketService) GetTimeEntry

func (s *TicketService) GetTimeEntry(ticketId int, timeEntryId int) (*TimeEntry, *http.Response, error)

GetTimeEntry will return a single TimeEntry for the specified Ticket

func (*TicketService) ListConversations

func (s *TicketService) ListConversations(ticketId int, opt *ListConversationsOptions) (*Conversations, *http.Response, error)

ListConversations will return paginated/filtered Conversation using ListConversationsOptions

func (*TicketService) ListTasks

func (s *TicketService) ListTasks(ticketId int, opt *ListTasksOptions) (*Tasks, *http.Response, error)

ListTasks will return paginated/filtered Tasks using ListTasksOptions

func (*TicketService) ListTickets

func (s *TicketService) ListTickets(opt *ListTicketsOptions) (*Tickets, *http.Response, error)

ListTickets will return paginated/filtered Ticket using ListTicketsOptions

func (*TicketService) ListTimeEntries

func (s *TicketService) ListTimeEntries(ticketId int) (*TimeEntries, *http.Response, error)

ListTimeEntries will return TimeEntries for the specified Ticket

func (*TicketService) RestoreTicket

func (s *TicketService) RestoreTicket(id int) (bool, *http.Response, error)

RestoreTicket will restore a previously trashed (deleted) Ticket

func (*TicketService) UpdateTask

func (s *TicketService) UpdateTask(ticketId int, taskId int, task *UpdateTaskModel) (*Task, *http.Response, error)

UpdateTask will update and return a Task matching id based on UpdateTaskModel

func (*TicketService) UpdateTicket

func (s *TicketService) UpdateTicket(id int, ticket *UpdateTicketModel) (*Ticket, *http.Response, error)

UpdateTicket will update and return a Ticket matching id based on UpdateTicketModel

type Tickets

type Tickets struct {
	Collection []Ticket `json:"tickets"`
}

Tickets contains Collection an array of Ticket

type TimeEntries

type TimeEntries struct {
	Collection []TimeEntry `json:"time_entries"`
}

TimeEntries contains Collection an array of TimeEntry

type TimeEntry

type TimeEntry struct {
	ID           int       `json:"id"`
	StartTime    time.Time `json:"start_time"`
	ExecutedAt   time.Time `json:"executed_at"`
	TimerRunning bool      `json:"timer_running"`
	Billable     bool      `json:"billable"`
	TimeSpent    string    `json:"time_spent"`
	TaskID       int       `json:"task_id"`
	AgentID      int       `json:"agent_id"`
	Note         string    `json:"note"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

TimeEntry represents a TimeEntry associated to a Task / Ticket

type UpdateAgentModel

type UpdateAgentModel struct {
	Occasional            bool                  `json:"occasional"`
	Email                 string                `json:"email"`
	DepartmentIDs         []int                 `json:"department_ids"`
	Address               string                `json:"address"`
	ReportingManagerID    int                   `json:"reporting_manager_id"`
	TimeZone              string                `json:"time_zone"`
	TimeFormat            string                `json:"time_format"`
	Language              string                `json:"language"`
	LocationID            int                   `json:"location_id"`
	BackgroundInformation string                `json:"background_information"`
	ScoreboardLevelID     int                   `json:"scoreboard_level_id"`
	MemberOf              []int                 `json:"member_of"`
	ObserverOf            []int                 `json:"observer_of"`
	Roles                 []AgentRoleAssignment `json:"roles"`
}

UpdateAgentModel ris the data struct required to update an Agent

type UpdateAnnouncementModel

type UpdateAnnouncementModel struct {
	Title            string    `json:"title"`
	BodyHtml         string    `json:"body_html"`
	VisibleFrom      time.Time `json:"visible_from"`
	VisibleTo        time.Time `json:"visible_to"`
	Visibility       string    `json:"visibility"`
	Departments      []int     `json:"departments"`
	Groups           []int     `json:"groups"`
	SendEmail        bool      `json:"send_email"`
	AdditionalEmails []string  `json:"additional_emails"`
}

UpdateAnnouncementModel is the data structure required to update an Announcement

type UpdateApplicationModel

type UpdateApplicationModel struct {
	Name            string   `json:"name"`
	Description     string   `json:"description"`
	ApplicationType string   `json:"application_type"`
	Status          string   `json:"status"`
	PublisherID     int      `json:"publisher_id"`
	ManagedByID     int      `json:"managed_by_id"`
	Notes           string   `json:"notes"`
	Category        string   `json:"category"`
	Sources         []string `json:"sources"`
}

UpdateApplicationModel is a data struct for updating an Application

type UpdateAssetModel

type UpdateAssetModel struct {
	Name         string    `json:"name"`
	Description  string    `json:"description"`
	AssetTypeID  int       `json:"asset_type_id"`
	AssetTag     string    `json:"asset_tag"`
	Impact       string    `json:"impact"`
	UsageType    string    `json:"usage_type"`
	UserID       int       `json:"user_id"`
	LocationID   int       `json:"location_id"`
	DepartmentID int       `json:"department_id"`
	AgentID      int       `json:"agent_id"`
	GroupID      int       `json:"group_id"`
	AssignedOn   time.Time `json:"assigned_on"`
}

UpdateAssetModel is the data structure required to update an Asset

type UpdateAssetTypeModel

type UpdateAssetTypeModel struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Visible     bool   `json:"visible"`
}

UpdateAssetTypeModel is the data structure required to update an AssetType

type UpdateChangeModel

type UpdateChangeModel struct {
	AgentID          int       `json:"agent_id"`
	Description      string    `json:"description"`
	DescriptionText  string    `json:"description_text"`
	RequesterID      int       `json:"requester_id"`
	GroupID          int       `json:"group_id"`
	Priority         int       `json:"priority"`
	Impact           int       `json:"impact"`
	Status           int       `json:"status"`
	Risk             int       `json:"risk"`
	ChangeType       int       `json:"change_type"`
	ApprovalStatus   int       `json:"approval_status"`
	PlannedStartDate time.Time `json:"planned_start_date"`
	PlannedEndDate   time.Time `json:"planned_end_date"`
	Subject          string    `json:"subject"`
	DepartmentID     int       `json:"department_id"`
	Category         string    `json:"category"`
	SubCategory      string    `json:"sub_category"`
	ItemCategory     string    `json:"item_category"`
}

UpdateChangeModel is a data struct for updating a Change

type UpdateContractModel

type UpdateContractModel struct {
	Name           string    `json:"name"`
	Description    string    `json:"description,omitempty"`
	VendorID       int       `json:"vendor_id"`
	AutoRenew      bool      `json:"auto_renew,omitempty"`
	NotifyExpiry   bool      `json:"notify_expiry,omitempty"`
	NotifyBefore   int       `json:"notify_before,omitempty"`
	ApproverID     int       `json:"approver_id"`
	StartDate      time.Time `json:"start_date"`
	EndDate        time.Time `json:"end_date"`
	Cost           float32   `json:"cost"`
	ContractNumber string    `json:"contract_number"`
	ContractTypeID int       `json:"contract_type_id"`
	VisibleToID    int       `json:"visible_to_id"`
	NotifyTo       []string  `json:"notify_to,omitempty"`
	SoftwareID     int       `json:"software_id,omitempty"`
	LicenseType    string    `json:"license_type,omitempty"`
	BillingCycle   string    `json:"billing_cycle,omitempty"`
	LicenseKey     string    `json:"license_key,omitempty"`
}

UpdateContractModel is the data structure required to update a Contract

type UpdateDepartmentModel

type UpdateDepartmentModel struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	HeadUserId  int      `json:"head_user_id"`
	PrimeUserId int      `json:"prime_user_id"`
	Domains     []string `json:"domains"`
}

UpdateDepartmentModel is the data structure for updating a Department

type UpdateLocationModel

type UpdateLocationModel struct {
	Name             string  `json:"name"`
	ParentLocationID int     `json:"parent_location_id"`
	PrimaryContactID int     `json:"primary_contact_id"`
	Address          Address `json:"address"`
}

UpdateLocationModel is a data struct for updating a Location

type UpdateProblemModel

type UpdateProblemModel struct {
	AgentID        int             `json:"agent_id"`
	GroupID        int             `json:"group_id"`
	Description    string          `json:"description"`
	Priority       int             `json:"priority"`
	Status         int             `json:"status"`
	Impact         int             `json:"impact"`
	Subject        string          `json:"subject"`
	DueBy          time.Time       `json:"due_by"`
	DepartmentID   int             `json:"department_id"`
	Category       string          `json:"category"`
	SubCategory    string          `json:"sub_category"`
	ItemCategory   string          `json:"item_category"`
	AnalysisFields ProblemAnalysis `json:"analysis_fields,omitempty"`
}

UpdateProblemModel is the data structure required for updating a Problem

type UpdateProductModel

type UpdateProductModel struct {
	Name               string `json:"name"`
	Description        string `json:"description"`
	AssetTypeID        int    `json:"asset_type_id"`
	Manufacturer       string `json:"manufacturer"`
	Status             string `json:"status"`
	ModeOfProcurement  string `json:"mode_of_procurement"`
	DepreciationTypeID int    `json:"depreciation_type_id"`
	DescriptionText    string `json:"description_text"`
}

UpdateProductModel is a data struct for updating a Product

type UpdatePurchaseOrderModel

type UpdatePurchaseOrderModel struct {
	VendorID              int            `json:"vendor_id"`
	Name                  string         `json:"name"`
	PurchaseOrderNumber   string         `json:"po_number"`
	VendorDetails         string         `json:"vendor_details"`
	ExpectedDeliveryDate  time.Time      `json:"expected_delivery_date"`
	ShippingAddress       string         `json:"shipping_address"`
	BillingAddress        string         `json:"billing_address"`
	BillingSameAsShipping bool           `json:"billing_same_as_shipping"`
	CurrencyCode          string         `json:"currency_code"`
	ConversionRate        float32        `json:"conversion_rate"`
	DepartmentID          int            `json:"department_id"`
	DiscountPercentage    float32        `json:"discount_percentage"`
	TaxPercentage         float32        `json:"tax_percentage"`
	ShoppingCost          float32        `json:"shopping_cost"`
	PurchaseItems         []PurchaseItem `json:"purchase_items"`
}

UpdatePurchaseOrderModel is a data struct for updating a PurchaseOrder

type UpdateReleaseModel

type UpdateReleaseModel struct {
	AgentID          int       `json:"agent_id"`
	GroupID          int       `json:"group_id"`
	Priority         int       `json:"priority"`
	Status           int       `json:"status"`
	ReleaseType      int       `json:"release_type"`
	Subject          string    `json:"subject"`
	Description      string    `json:"description"`
	PlannedStartDate time.Time `json:"planned_start_date"`
	PlannedEndDate   time.Time `json:"planned_end_date"`
	WorkStartDate    time.Time `json:"work_start_date"`
	WorkEndDate      time.Time `json:"work_end_date"`
	DepartmentID     int       `json:"department_id"`
	Category         string    `json:"category"`
	SubCategory      string    `json:"sub_category"`
	ItemCategory     string    `json:"item_category"`
}

UpdateReleaseModel is a data struct for updating a Release

type UpdateRequesterModel

type UpdateRequesterModel struct {
	FirstName             string   `json:"first_name"`
	LastName              string   `json:"last_name"`
	JobTitle              string   `json:"job_title"`
	Email                 string   `json:"primary_email"`
	AdditionalEmails      []string `json:"secondary_emails"`
	WorkPhoneNumber       string   `json:"work_phone_number"`
	MobilePhoneNumber     string   `json:"mobile_phone_number"`
	DepartmentIDs         []int    `json:"department_ids"`
	Address               string   `json:"address"`
	ReportingManagerID    int      `json:"reporting_manager_id"`
	TimeZone              string   `json:"time_zone"`
	TimeFormat            string   `json:"time_format"`
	Language              string   `json:"language"`
	LocationID            int      `json:"location_id"`
	BackgroundInformation string   `json:"background_information"`
}

UpdateRequesterModel is a data struct for updating a Requester

type UpdateSolutionArticleModel

type UpdateSolutionArticleModel struct {
	Title       string    `json:"title,omitempty"`
	Description string    `json:"description,omitempty"`
	ArticleType int       `json:"article_type,omitempty"`
	FolderID    int       `json:"folder_id,omitempty"`
	Status      int       `json:"status,omitempty"`
	Tags        []string  `json:"tags,omitempty"`
	Keywords    []string  `json:"keywords,omitempty"`
	ReviewDate  time.Time `json:"review_date,omitempty"`
}

UpdateSolutionArticleModel is a data struct for updating a SolutionArticle

type UpdateSolutionCategoryModel

type UpdateSolutionCategoryModel struct {
	Name             string `json:"name"`
	Description      string `json:"description"`
	VisibleInPortals []int  `json:"visible_in_portals"`
}

UpdateSolutionCategoryModel is the data structure for updating a SolutionCategory

type UpdateSolutionFolderModel

type UpdateSolutionFolderModel struct {
	Name              string           `json:"name"`
	Description       string           `json:"description"`
	Visibility        int              `json:"visibility"`
	DepartmentIDs     []int            `json:"department_ids,omitempty"`
	GroupIDs          []int            `json:"group_ids,omitempty"`
	RequesterGroupIDs []int            `json:"requester_group_ids,omitempty"`
	ManageByGroupIDs  []int            `json:"manage_by_group_ids"`
	ApprovalSettings  ApprovalSettings `json:"approval_settings,omitempty"`
}

UpdateSolutionFolderModel is a data struct for updating a SolutionFolder

type UpdateTaskModel

type UpdateTaskModel struct {
	AgentID      int       `json:"agent_id"`
	Status       int       `json:"status"`
	DueDate      time.Time `json:"due_date"`
	NotifyBefore int       `json:"notify_before"`
	Title        string    `json:"title"`
	Description  string    `json:"description"`
	GroupID      int       `json:"group_id"`
}

UpdateTaskModel is the data structure for updating an existing Task

type UpdateTicketModel

type UpdateTicketModel struct {
	Attachments        []TicketAttachment `json:"attachments"`
	DepartmentID       int                `json:"department_id"`
	Description        string             `json:"description"`
	DueBy              time.Time          `json:"due_by"`
	Email              string             `json:"email"`
	EmailConfigID      int                `json:"email_config_id"`
	FirstResponseDueBy time.Time          `json:"fr_due_by"`
	GroupID            int                `json:"group_id"`
	Name               string             `json:"name"`
	Phone              string             `json:"phone"`
	Priority           int                `json:"priority"`
	Category           string             `json:"category"`
	SubCategory        string             `json:"sub_category"`
	ItemCategory       string             `json:"item_category"`
	RequesterID        int                `json:"requester_id"`
	ResponderID        int                `json:"responder_id"`
	Source             int                `json:"source"`
	Status             int                `json:"status"`
	Subject            string             `json:"subject"`
	Tags               []string           `json:"tags"`
	Type               string             `json:"type"`
	Urgency            int                `json:"urgency"`
	Impact             int                `json:"impact"`
}

UpdateTicketModel is a data struct for updating a Ticket

type UpdateVendorModel

type UpdateVendorModel struct {
	Name             string        `json:"name"`
	Description      string        `json:"description"`
	PrimaryContactID int           `json:"primary_contact_id"`
	Address          VendorAddress `json:"address"`
}

UpdateVendorModel is the data structure required to update a Vendor

type UpsertNoteModel

type UpsertNoteModel struct {
	Body string `json:"body"`
}

UpsertNoteModel is a data struct for creating/updating Note

type Vendor

type Vendor struct {
	ID               int           `json:"id"`
	Name             string        `json:"name"`
	Description      string        `json:"description"`
	PrimaryContactID int           `json:"primary_contact_id"`
	Address          VendorAddress `json:"address"`
	CreatedAt        time.Time     `json:"created_at"`
	UpdatedAt        time.Time     `json:"updated_at"`
}

Vendor represents a FreshService Vendor

type VendorAddress

type VendorAddress struct {
	Line1   string `json:"line1"`
	City    string `json:"city"`
	State   string `json:"state"`
	Country string `json:"country"`
	ZipCode string `json:"zipcode"`
}

VendorAddress is an alternative to Address but with only one address line

type VendorService

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

VendorService API Docs: https://api.freshservice.com/#vendors

func (*VendorService) CreateVendor

func (s *VendorService) CreateVendor(newVendor *CreateVendorModel) (*Vendor, *http.Response, error)

CreateVendor will create and return a new Vendor based on CreateVendorModel

func (*VendorService) DeleteVendor

func (s *VendorService) DeleteVendor(id int) (bool, *http.Response, error)

DeleteVendor will completely remove a Vendor from FreshService matching id

func (*VendorService) GetVendor

func (s *VendorService) GetVendor(id int) (*Vendor, *http.Response, error)

GetVendor will return a single Vendor by id

func (*VendorService) ListVendors

func (s *VendorService) ListVendors(opt *ListVendorsOptions) (*Vendors, *http.Response, error)

ListVendors will return paginated/filtered Vendors using ListVendorsOptions

func (*VendorService) UpdateVendor

func (s *VendorService) UpdateVendor(id int, vendor *UpdateVendorModel) (*Vendor, *http.Response, error)

UpdateVendor will update and return a Vendor matching id based on UpdateVendorModel

type Vendors

type Vendors struct {
	Collection []Vendor `json:"vendors"`
}

Vendors contains Collection an array of Vendor

type Workday

type Workday struct {
	BeginningOfWorkday string `json:"beginning_of_workday"`
	EndOfWorkday       string `json:"end_of_workday"`
}

Workday is a data struct representing the start and end of a working day

Jump to

Keyboard shortcuts

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