Skip to content

Commit

Permalink
Merge pull request #416 from PagerDuty/maintain_api_compatibility
Browse files Browse the repository at this point in the history
Find a way to gracefully avoid one breaking change in #405
  • Loading branch information
theckman committed Jan 19, 2022
2 parents 91a25f6 + 428048d commit ca33620
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions priorites.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ import (
"github.com/google/go-querystring/query"
)

// PriorityProperty is a single priorty object returned from the Priorities endpoint
type PriorityProperty struct {
APIObject
Name string `json:"name"`
Description string `json:"description"`
}
// PriorityProperty is the original type name and is retained as an alias for API
// compatibility.
//
// Deprecated: Use type Priority instead; will be removed in V2
type PriorityProperty = Priority

// ListPrioritiesResponse repreents the API response from PagerDuty when listing
// the configured priorities.
type ListPrioritiesResponse struct {
APIListObject
Priorities []PriorityProperty `json:"priorities"`
Priorities []Priority `json:"priorities"`
}

// Priorities is the original type name and is retained as an alias for API
// compatibility.
//
// Deprecated: Use type ListPrioritiesResponse instead; will be removed in V2
type Priorities = ListPrioritiesResponse

// ListPrioritiesOptions is the data structure used when calling the
// ListPriorities API endpoint.
type ListPrioritiesOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion priorities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestPriorities_List(t *testing.T) {

want := &ListPrioritiesResponse{
APIListObject: listObj,
Priorities: []PriorityProperty{
Priorities: []Priority{
{
APIObject: APIObject{
ID: "1",
Expand Down

0 comments on commit ca33620

Please sign in to comment.