Skip to content

Commit

Permalink
Fix PipelineList from updated schema (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
mars authored Jan 13, 2022
1 parent a332284 commit 3f30614
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 45 deletions.
22 changes: 5 additions & 17 deletions v5/heroku.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/google/go-querystring/query"
"io"
"net/http"
"reflect"
"runtime"
"strings"
"time"

"github.com/google/go-querystring/query"
)

var _ = time.Second
Expand Down Expand Up @@ -1903,20 +1904,6 @@ type Domain struct {
Status string `json:"status" url:"status,key"` // status of this record's cname
UpdatedAt time.Time `json:"updated_at" url:"updated_at,key"` // when domain was updated
}
type DomainCreateDeprecatedOpts struct {
Hostname string `json:"hostname" url:"hostname,key"` // full hostname
}

// Create a new domain. Deprecated in favor of this same endpoint, but
// with a new required attribute of `sni_endpoint`. During the
// transitional phase sni_endpoint can be omitted entirely (current
// behavior), can be a valid id, or can be null which will skip
// auto-association.
func (s *Service) DomainCreateDeprecated(ctx context.Context, appIdentity string, o DomainCreateDeprecatedOpts) (*Domain, error) {
var domain Domain
return &domain, s.Post(ctx, &domain, fmt.Sprintf("/apps/%v/domains", appIdentity), o)
}

type DomainCreateOpts struct {
Hostname string `json:"hostname" url:"hostname,key"` // full hostname
SniEndpoint *string `json:"sni_endpoint" url:"sni_endpoint,key"` // null or unique identifier or name for SNI endpoint
Expand Down Expand Up @@ -3103,8 +3090,9 @@ func (s *Service) PipelineUpdate(ctx context.Context, pipelineID string, o Pipel
type PipelineListResult []Pipeline

// List existing pipelines.
func (s *Service) PipelineList(ctx context.Context, lr *ListRange) error {
return s.Get(ctx, nil, fmt.Sprintf("/pipelines"), nil, lr)
func (s *Service) PipelineList(ctx context.Context, lr *ListRange) (PipelineListResult, error) {
var pipeline PipelineListResult
return pipeline, s.Get(ctx, &pipeline, fmt.Sprintf("/pipelines"), nil, lr)
}

// Information about latest builds of apps in a pipeline.
Expand Down
32 changes: 4 additions & 28 deletions v5/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5452,30 +5452,6 @@
}
},
"links": [
{
"deactivate_on": "2021-10-31",
"description": "Create a new domain. Deprecated in favor of this same endpoint, but with a new required attribute of `sni_endpoint`. During the transitional phase sni_endpoint can be omitted entirely (current behavior), can be a valid id, or can be null which will skip auto-association.",
"href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains",
"method": "POST",
"rel": "create",
"schema": {
"properties": {
"hostname": {
"$ref": "#/definitions/domain/definitions/hostname"
}
},
"required": [
"hostname"
],
"type": [
"object"
]
},
"targetSchema": {
"$ref": "#/definitions/domain"
},
"title": "Create - Deprecated"
},
{
"description": "Create a new domain.",
"href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains",
Expand Down Expand Up @@ -10830,11 +10806,11 @@
"targetSchema": {
"items": {
"$ref": "#/definitions/pipeline"
}
},
"type": [
"array"
]
},
"type": [
"array"
],
"title": "List"
}
],
Expand Down

0 comments on commit 3f30614

Please sign in to comment.