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

Interface ArtifactClient

pkg/cmd/issue/artifact/client/client.go:22–46  ·  view source on GitHub ↗

go:generate moq -rm -out client_mock.go . ArtifactClient ArtifactClient is how the artifact commands reach the API. Every request goes to the host of the repository it is given.

Source from the content-addressed store, hash-verified

20// ArtifactClient is how the artifact commands reach the API. Every request
21// goes to the host of the repository it is given.
22type ArtifactClient interface {
23 // IsPullRequest reports whether number in repo is a pull request rather
24 // than an issue, with one lookup.
25 IsPullRequest(repo ghrepo.Interface, number int) (bool, error)
26 // UploadTarget is IsPullRequest for a command that uploads files with
27 // --attach. Its one lookup also returns what an upload needs to know
28 // about repo.
29 UploadTarget(repo ghrepo.Interface, number int) (*UploadTarget, error)
30 // List returns the artifacts on an issue in the order the API returns
31 // them, which is number order. An empty artifactType lists every type,
32 // and a limit of 0 lists every artifact.
33 List(repo ghrepo.Interface, issueNumber int, artifactType string, limit int) ([]Artifact, error)
34 // Get returns one artifact on an issue, with its edit history.
35 Get(repo ghrepo.Interface, issueNumber int, number int) (*ArtifactWithVersions, error)
36 // Delete deletes one artifact from an issue. The API can't restore a
37 // deleted artifact.
38 Delete(repo ghrepo.Interface, issueNumber int, number int) error
39 // Create creates one artifact on an issue and returns it. The API doesn't
40 // return a new artifact's description.
41 Create(repo ghrepo.Interface, issueNumber int, artifactType, name, body string) (*Artifact, error)
42 // Update saves a new version of one artifact on an issue and returns the
43 // artifact. A nil name or body keeps the current one. The API can't change
44 // an artifact's type.
45 Update(repo ghrepo.Interface, issueNumber int, number int, name, body *string) (*Artifact, error)
46}
47
48// maxPageSize is the most artifacts one request asks for.
49const maxPageSize = 100

Callers 29

TestIsPullRequestFunction · 0.95
displayIssueResultsFunction · 0.65
closeRunFunction · 0.65
apiCloseFunction · 0.65
apiReopenFunction · 0.65
deleteRunFunction · 0.65
transferRunFunction · 0.65
IsPullRequestMethod · 0.65
TestUploadTargetFunction · 0.95
CheckUploadTargetFunction · 0.65
TestListFunction · 0.95
listArtifactsFunction · 0.65

Implementers 2

ArtifactClientMockpkg/cmd/issue/artifact/client/client_m
artifactClientpkg/cmd/issue/artifact/client/client.g

Calls

no outgoing calls

Tested by

no test coverage detected