MCPcopy Index your code
hub / github.com/google/go-github / SetRepositorySubscription

Method SetRepositorySubscription

github/activity_watching.go:125–140  ·  view source on GitHub ↗

SetRepositorySubscription sets the subscription for the specified repository for the authenticated user. To watch a repository, set subscription.Subscribed to true. To ignore notifications made within a repository, set subscription.Ignored to true. To stop watching a repository, use DeleteRepositor

(ctx context.Context, owner, repo string, subscription *Subscription)

Source from the content-addressed store, hash-verified

123//
124//meta:operation PUT /repos/{owner}/{repo}/subscription
125func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) {
126 u := fmt.Sprintf("repos/%v/%v/subscription", owner, repo)
127
128 req, err := s.client.NewRequest(ctx, "PUT", u, subscription)
129 if err != nil {
130 return nil, nil, err
131 }
132
133 var sub *Subscription
134 resp, err := s.client.Do(req, &sub)
135 if err != nil {
136 return nil, resp, err
137 }
138
139 return sub, resp, nil
140}
141
142// DeleteRepositorySubscription deletes the subscription for the specified
143// repository for the authenticated user.

Calls 2

NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 2

createSubscriptionFunction · 0.64