Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to gracefully avoid one breaking change in #405 #416

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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