go-pagerduty
go-pagerduty copied to clipboard
Research updating some fields to use APIObject type instead of full objects
There are some PagerDuty REST API endpoints that return API object references instead of the full objects for specific keys, to avoid sending massive amounts of (potentially unused) JSON across the wire.
Refer to this comment on a PR where a change was required to use APIObject instead, because it was the shape expected by the PagerDuty API: https://github.com/PagerDuty/go-pagerduty/pull/273#discussion_r579711069.
The reason I think we should investigate changing this, is because per our documentation some users may expect to see a full object sent back (see #250). This would be a v2.0.0 change.
Another example: https://github.com/PagerDuty/go-pagerduty/blob/e23b94cea01f37da371fd9d7efb4e20ea0e36ff2/webhook.go#L32
https://github.com/PagerDuty/go-pagerduty/blob/da97010e7f22b22d88b2a9e4b0eb6e7c4566721f/incident.go#L80
https://github.com/PagerDuty/go-pagerduty/blob/da97010e7f22b22d88b2a9e4b0eb6e7c4566721f/incident.go#L60-L64
https://developer.pagerduty.com/api-reference/b3A6Mjc0ODE0MQ-get-an-incident
https://github.com/PagerDuty/go-pagerduty/blob/77a73c9d16987b91549d60d76d5a075e91400df9/on_call.go#L11-L13