Skip to content

Commit cc05fd6

Browse files
committed
Tweak last PR issues
1 parent f6fecab commit cc05fd6

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

event_webhook_types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"time"
2424
)
2525

26-
//BuildEvent represents a build event
26+
// BuildEvent represents a build event.
2727
//
2828
// GitLab API docs:
2929
// https://docs.gitlab.com/ce/user/project/integrations/webhooks.html#build-events
@@ -189,12 +189,12 @@ type IssueCommentEvent struct {
189189
NoteableType string `json:"noteable_type"`
190190
AuthorID int `json:"author_id"`
191191
CreatedAt string `json:"created_at"`
192-
DiscussionID string `json:"discussion_id"`
193192
UpdatedAt string `json:"updated_at"`
194193
ProjectID int `json:"project_id"`
195194
Attachment string `json:"attachment"`
196195
LineCode string `json:"line_code"`
197196
CommitID string `json:"commit_id"`
197+
DiscussionID string `json:"discussion_id"`
198198
NoteableID int `json:"noteable_id"`
199199
System bool `json:"system"`
200200
StDiff []*Diff `json:"st_diff"`

external_status_checks.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ func (s *ExternalStatusChecksService) ListMergeStatusChecks(pid interface{}, mr
6464
return mscs, resp, err
6565
}
6666

67-
// SetExternalStatusCheckStatusOptions represents the available SetExternalStatusCheckStatus() options.
67+
// SetExternalStatusCheckStatusOptions represents the available
68+
// SetExternalStatusCheckStatus() options.
6869
//
6970
// GitLab API docs:
7071
// https://docs.gitlab.com/ee/api/status_checks.html#set-status-of-an-external-status-check
7172
type SetExternalStatusCheckStatusOptions struct {
72-
SHA string `url:"sha" json:"sha"`
73-
ExternalStatusCheckID int `url:"external_status_check_id" json:"external_status_check_id"`
73+
SHA *string `url:"sha,omitempty" json:"sha,omitempty"`
74+
ExternalStatusCheckID *int `url:"external_status_check_id,omitempty" json:"external_status_check_id,omitempty"`
7475
Status *string `url:"status,omitempty" json:"status,omitempty"`
7576
}
7677

@@ -118,14 +119,15 @@ func (s *ExternalStatusChecksService) ListProjectStatusChecks(pid interface{}, o
118119
return pscs, resp, err
119120
}
120121

121-
// CreateExternalStatusCheckOptions represents the available CreateExternalStatusCheck() options.
122+
// CreateExternalStatusCheckOptions represents the available
123+
// CreateExternalStatusCheck() options.
122124
//
123125
// GitLab API docs:
124126
// https://docs.gitlab.com/ee/api/status_checks.html#create-external-status-check
125127
type CreateExternalStatusCheckOptions struct {
126-
Name string `url:"name" json:"name"`
127-
ExternalURL string `url:"external_url" json:"external_url"`
128-
ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"`
128+
Name *string `url:"name,omitempty" json:"name,omitempty"`
129+
ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"`
130+
ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"`
129131
}
130132

131133
// CreateExternalStatusCheck creates an external status check.
@@ -156,7 +158,6 @@ func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid interface{},
156158
if err != nil {
157159
return nil, err
158160
}
159-
160161
u := fmt.Sprintf("projects/%s/external_status_checks/%d", PathEscape(project), check)
161162

162163
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
@@ -167,7 +168,8 @@ func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid interface{},
167168
return s.client.Do(req, nil)
168169
}
169170

170-
// UpdateExternalStatusCheckOptions represents the available UpdateExternalStatusCheck() options.
171+
// UpdateExternalStatusCheckOptions represents the available
172+
// UpdateExternalStatusCheck() options.
171173
//
172174
// GitLab API docs:
173175
// https://docs.gitlab.com/ee/api/status_checks.html#update-external-status-check
@@ -186,7 +188,6 @@ func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid interface{},
186188
if err != nil {
187189
return nil, err
188190
}
189-
190191
u := fmt.Sprintf("projects/%s/external_status_checks/%d", PathEscape(project), check)
191192

192193
req, err := s.client.NewRequest(http.MethodPut, u, opt, options)

0 commit comments

Comments
 (0)