Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Tranter <ben@bentranter.io>
  • Loading branch information
kamaln7 and bentranter authored Nov 4, 2020
1 parent a318797 commit f93b1bd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type AppsService interface {

GetDeployment(ctx context.Context, appID, deploymentID string) (*Deployment, *Response, error)
ListDeployments(ctx context.Context, appID string, opts *ListOptions) ([]*Deployment, *Response, error)
CreateDeployment(ctx context.Context, appID string, create *DeploymentCreateRequest) (*Deployment, *Response, error)
CreateDeployment(ctx context.Context, appID string, create ...*DeploymentCreateRequest) (*Deployment, *Response, error)

GetLogs(ctx context.Context, appID, deploymentID, component string, logType AppLogType, follow bool) (*AppLogs, *Response, error)

Expand Down Expand Up @@ -215,9 +215,15 @@ func (s *AppsServiceOp) ListDeployments(ctx context.Context, appID string, opts
}

// CreateDeployment creates an app deployment.
func (s *AppsServiceOp) CreateDeployment(ctx context.Context, appID string, create *DeploymentCreateRequest) (*Deployment, *Response, error) {
func (s *AppsServiceOp) CreateDeployment(ctx context.Context, appID string, create ...*DeploymentCreateRequest) (*Deployment, *Response, error) {
path := fmt.Sprintf("%s/%s/deployments", appsBasePath, appID)
req, err := s.client.NewRequest(ctx, http.MethodPost, path, create)

var createReq *DeploymentCreateRequest
for _, c := range create {
createReq = c
}

req, err := s.client.NewRequest(ctx, http.MethodPost, path, createReq)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit f93b1bd

Please sign in to comment.