MCPcopy Create free account
hub / github.com/cli/cli / Get

Method Get

pkg/cmd/issue/artifact/client/client.go:127–141  ·  view source on GitHub ↗
(repo ghrepo.Interface, issueNumber int, number int)

Source from the content-addressed store, hash-verified

125}
126
127func (c *artifactClient) Get(repo ghrepo.Interface, issueNumber int, number int) (*ArtifactWithVersions, error) {
128 u, err := safeurl.JoinPath("repos", repo.RepoOwner(), repo.RepoName(), "issues", strconv.Itoa(issueNumber), "artifacts", strconv.Itoa(number))
129 if err != nil {
130 return nil, err
131 }
132
133 var response struct {
134 Artifact Artifact `json:"artifact"`
135 Versions []Version `json:"versions"`
136 }
137 if err := c.apiClient.REST(repo.RepoHost(), "GET", u.String(), nil, &response); err != nil {
138 return nil, err
139 }
140 return &ArtifactWithVersions{Artifact: response.Artifact, Versions: response.Versions}, nil
141}
142
143// Delete ignores the response's body. A successful delete can get 204 No
144// Content, which has none, or 200 with the deleted artifact's number, which

Callers

nothing calls this directly

Calls 6

JoinPathFunction · 0.92
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
RESTMethod · 0.65
RepoHostMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected