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)
| 123 | // |
| 124 | //meta:operation PUT /repos/{owner}/{repo}/subscription |
| 125 | func (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. |