Skip to content

Commit 9f3883a

Browse files
committed
rename BitbucketTrigerPipelineRequestBody and fix typo
1 parent 1c88ade commit 9f3883a

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

bitbucket.go

+17
Original file line numberDiff line numberDiff line change
@@ -552,3 +552,20 @@ type DeployKeyOptions struct {
552552
Label string `json:"label"`
553553
Key string `json:"key"`
554554
}
555+
556+
type TriggerPipelineRequestBody struct {
557+
Target struct {
558+
RefType string `json:"ref_type"`
559+
Type string `json:"type"`
560+
RefName string `json:"ref_name"`
561+
Selector struct {
562+
Type string `json:"type"`
563+
Pattern string `json:"pattern"`
564+
} `json:"selector"`
565+
} `json:"target"`
566+
Variables []struct {
567+
Key string `json:"key"`
568+
Value string `json:"value"`
569+
Secured bool `json:"secured,omitempty"`
570+
} `json:"variables"`
571+
}

pipelines.go

+1-18
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,7 @@ func (p *Pipelines) GetLog(po *PipelinesOptions) (string, error) {
115115
return string(rawBody), nil
116116
}
117117

118-
type BitbucketTrigerPipelineRequestBody struct {
119-
Target struct {
120-
RefType string `json:"ref_type"`
121-
Type string `json:"type"`
122-
RefName string `json:"ref_name"`
123-
Selector struct {
124-
Type string `json:"type"`
125-
Pattern string `json:"pattern"`
126-
} `json:"selector"`
127-
} `json:"target"`
128-
Variables []struct {
129-
Key string `json:"key"`
130-
Value string `json:"value"`
131-
Secured bool `json:"secured,omitempty"`
132-
} `json:"variables"`
133-
}
134-
135-
func (p *Pipelines) TriggerPipeline(po *PipelinesOptions, body *BitbucketTrigerPipelineRequestBody) (interface{}, error) {
118+
func (p *Pipelines) TriggerPipeline(po *PipelinesOptions, body *TriggerPipelineRequestBody) (interface{}, error) {
136119
urlStr := p.c.requestUrl("/repositories/%s/%s/pipelines/", po.Owner, po.RepoSlug)
137120

138121
b, err := json.Marshal(body)

0 commit comments

Comments
 (0)