This commit is contained in:
Steven Polley 2018-06-28 19:38:22 -06:00
commit 4616997d47
2 changed files with 27 additions and 4 deletions

View File

@ -172,14 +172,26 @@ type Ticket struct {
ContactPhoneExtension string `json:"contactPhoneExtension,omitempty"` ContactPhoneExtension string `json:"contactPhoneExtension,omitempty"`
} }
<<<<<<< HEAD
//TimeEntryReference is a struct to hold the unmarshaled JSON data when making a call to the Service API //TimeEntryReference is a struct to hold the unmarshaled JSON data when making a call to the Service API
//TBD: For some reason the Info struct contained in TimeEntryReference does get data when the JSON is unmarshaled into this struct. The ID works fine //TBD: For some reason the Info struct contained in TimeEntryReference does get data when the JSON is unmarshaled into this struct. The ID works fine
=======
>>>>>>> ab8a24800f1f1789b3aca8e12cc3f8ccfc1ba415
type TimeEntryReference struct { type TimeEntryReference struct {
ID int ID int
Info struct { Info struct {
Notes string Notes string `json:"notes"`
TimeHref string TimeHref string `json:"time_href"`
} `json:"_info"`
} }
type ConfigurationReference struct {
ID int `json:"id"`
DeviceIdentifier string `json:"deviceIdentifier"`
Info struct {
Name string `json:"name"`
ConfigurationHref string `json:"configuration_href"`
} `json:"_info"`
} }
//GetTicketByID expects a ticket ID and returns a pointer to a Ticket struct //GetTicketByID expects a ticket ID and returns a pointer to a Ticket struct
@ -205,3 +217,14 @@ func (cw *ConnectwiseSite) GetTicketTimeEntriesByID(ticketID int) *[]TimeEntryRe
return &timeEntryReference return &timeEntryReference
} }
func (cw *ConnectwiseSite) GetTicketConfigurationsByID(ticketID int) *[]ConfigurationReference {
Url := cw.BuildUrl(fmt.Sprintf("/service/tickets/%d/configurations", ticketID))
body := cw.GetRequest(Url)
configurationReference := []ConfigurationReference{}
check(json.Unmarshal(body, &configurationReference))
return &configurationReference
}

View File

@ -73,7 +73,7 @@ type TimeEntry struct {
UpdatedBy string `json:"updatedBy"` UpdatedBy string `json:"updatedBy"`
ChargeToMobileGUID string `json:"chargeToMobileGuid"` ChargeToMobileGUID string `json:"chargeToMobileGuid"`
} `json:"_info"` } `json:"_info"`
CustomFields struct { CustomFields []struct {
ID int ID int
Caption string Caption string
Type string Type string