...
1
2
3
4
5
6 package github
7
8 import (
9 "context"
10 )
11
12
13
14
15
16 func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) {
17 req, err := s.client.NewRequest("GET", "app/hook/config", nil)
18 if err != nil {
19 return nil, nil, err
20 }
21
22 config := new(HookConfig)
23 resp, err := s.client.Do(ctx, req, &config)
24 if err != nil {
25 return nil, resp, err
26 }
27
28 return config, resp, nil
29 }
30
31
32
33
34
35 func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) {
36 req, err := s.client.NewRequest("PATCH", "app/hook/config", config)
37 if err != nil {
38 return nil, nil, err
39 }
40
41 c := new(HookConfig)
42 resp, err := s.client.Do(ctx, req, c)
43 if err != nil {
44 return nil, resp, err
45 }
46
47 return c, resp, nil
48 }
49
View as plain text