Skip to content

Commit

Permalink
rename BitbucketTrigerPipelineRequestBody and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
veziak committed Mar 24, 2023
1 parent 1c88ade commit 9f3883a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
17 changes: 17 additions & 0 deletions bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,20 @@ type DeployKeyOptions struct {
Label string `json:"label"`
Key string `json:"key"`
}

type TriggerPipelineRequestBody struct {
Target struct {
RefType string `json:"ref_type"`
Type string `json:"type"`
RefName string `json:"ref_name"`
Selector struct {
Type string `json:"type"`
Pattern string `json:"pattern"`
} `json:"selector"`
} `json:"target"`
Variables []struct {
Key string `json:"key"`
Value string `json:"value"`
Secured bool `json:"secured,omitempty"`
} `json:"variables"`
}
19 changes: 1 addition & 18 deletions pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,7 @@ func (p *Pipelines) GetLog(po *PipelinesOptions) (string, error) {
return string(rawBody), nil
}

type BitbucketTrigerPipelineRequestBody struct {
Target struct {
RefType string `json:"ref_type"`
Type string `json:"type"`
RefName string `json:"ref_name"`
Selector struct {
Type string `json:"type"`
Pattern string `json:"pattern"`
} `json:"selector"`
} `json:"target"`
Variables []struct {
Key string `json:"key"`
Value string `json:"value"`
Secured bool `json:"secured,omitempty"`
} `json:"variables"`
}

func (p *Pipelines) TriggerPipeline(po *PipelinesOptions, body *BitbucketTrigerPipelineRequestBody) (interface{}, error) {
func (p *Pipelines) TriggerPipeline(po *PipelinesOptions, body *TriggerPipelineRequestBody) (interface{}, error) {
urlStr := p.c.requestUrl("/repositories/%s/%s/pipelines/", po.Owner, po.RepoSlug)

b, err := json.Marshal(body)
Expand Down

0 comments on commit 9f3883a

Please sign in to comment.