| 56 | } |
| 57 | |
| 58 | func (c *liveFixtureRepositoryClient) create(name string) error { |
| 59 | body, err := json.Marshal(struct { |
| 60 | Name string `json:"name"` |
| 61 | Private bool `json:"private"` |
| 62 | AutoInit bool `json:"auto_init"` |
| 63 | HasDiscussions bool `json:"has_discussions"` |
| 64 | }{ |
| 65 | Name: name, |
| 66 | Private: true, |
| 67 | AutoInit: true, |
| 68 | HasDiscussions: true, |
| 69 | }) |
| 70 | if err != nil { |
| 71 | return err |
| 72 | } |
| 73 | path := fmt.Sprintf("orgs/%s/repos", url.PathEscape(c.org)) |
| 74 | return c.apiClient.Do(http.MethodPost, path, bytes.NewReader(body), nil) |
| 75 | } |
| 76 | |
| 77 | func (c *liveFixtureRepositoryClient) delete(name string) error { |
| 78 | path := fmt.Sprintf("repos/%s/%s", url.PathEscape(c.org), url.PathEscape(name)) |