-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathartifacts.go
More file actions
159 lines (145 loc) · 5.29 KB
/
Copy pathartifacts.go
File metadata and controls
159 lines (145 loc) · 5.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// ArtifactsService handles the "AI SRE/Artifacts" API resource.
type ArtifactsService service
// Get artifact detail.
//
// Get a single published artifact by ID.
//
// API: POST /safari/artifact/gallery/get (artifact-read-get).
func (s *ArtifactsService) ReadGet(ctx context.Context, req *ArtifactIDRequest) (*PublishedArtifactItem, *Response, error) {
out := new(PublishedArtifactItem)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/get", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get file publish state.
//
// Check which presented files already have a live published artifact.
//
// API: POST /safari/artifact/gallery/file-state (artifact-read-get-file-state).
func (s *ArtifactsService) ReadGetFileState(ctx context.Context, req *ArtifactFileStateRequest) (*ArtifactFileStateResponse, *Response, error) {
out := new(ArtifactFileStateResponse)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/file-state", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List artifacts.
//
// List published artifacts visible to the caller, with pagination and title search.
//
// API: POST /safari/artifact/gallery/list (artifact-read-list).
func (s *ArtifactsService) ReadList(ctx context.Context, req *ArtifactListRequest) (*ArtifactListResponse, *Response, error) {
out := new(ArtifactListResponse)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Create signed file URLs.
//
// Create short-lived signed URLs to download or preview a presented file.
//
// API: POST /safari/artifact/sign (artifact-read-sign).
func (s *ArtifactsService) ReadSign(ctx context.Context, req *ArtifactSignRequest) (*SignedUrLs, *Response, error) {
out := new(SignedUrLs)
resp, err := s.client.do(ctx, "/safari/artifact/sign", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Download or preview a file.
//
// Download or preview a file's bytes using a signed token.
//
// The success body is a file, not a JSON envelope: it is returned on Response.Raw.
//
// API: GET /safari/artifact/stream (artifact-read-stream).
func (s *ArtifactsService) ReadStream(ctx context.Context, req *ArtifactsReadStreamRequest) (*Response, error) {
return s.client.doGet(ctx, "/safari/artifact/stream", req, nil)
}
// Remove artifact from gallery.
//
// Detach an artifact from the gallery; the source file stays with its session.
//
// API: POST /safari/artifact/gallery/delete (artifact-write-delete).
func (s *ArtifactsService) WriteDelete(ctx context.Context, req *ArtifactIDRequest) (*any, *Response, error) {
out := new(any)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/delete", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Publish file as artifact.
//
// Publish a session-produced file to the artifact gallery.
//
// API: POST /safari/artifact/gallery/publish-from-file (artifact-write-publish).
func (s *ArtifactsService) WritePublish(ctx context.Context, req *ArtifactPublishFromFileRequest) (*ArtifactPublishResponse, *Response, error) {
out := new(ArtifactPublishResponse)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/publish-from-file", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Enable public sharing.
//
// Turn on anonymous public sharing for an artifact and return its public link.
//
// API: POST /safari/artifact/gallery/share/enable (artifact-write-share-enable).
func (s *ArtifactsService) WriteShareEnable(ctx context.Context, req *ArtifactIDRequest) (*ArtifactShareState, *Response, error) {
out := new(ArtifactShareState)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/share/enable", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Revoke public sharing.
//
// Turn off public sharing; the link stops resolving immediately.
//
// API: POST /safari/artifact/gallery/share/revoke (artifact-write-share-revoke).
func (s *ArtifactsService) WriteShareRevoke(ctx context.Context, req *ArtifactIDRequest) (*any, *Response, error) {
out := new(any)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/share/revoke", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Update shared snapshot.
//
// Refresh the public snapshot of a shared artifact with its latest content.
//
// API: POST /safari/artifact/gallery/share/sync (artifact-write-share-sync).
func (s *ArtifactsService) WriteShareSync(ctx context.Context, req *ArtifactIDRequest) (*ArtifactShareState, *Response, error) {
out := new(ArtifactShareState)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/share/sync", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Update artifact.
//
// Rename an artifact or transfer it between personal and team scope.
//
// API: POST /safari/artifact/gallery/update (artifact-write-update).
func (s *ArtifactsService) WriteUpdate(ctx context.Context, req *ArtifactUpdateRequest) (*PublishedArtifactItem, *Response, error) {
out := new(PublishedArtifactItem)
resp, err := s.client.do(ctx, "/safari/artifact/gallery/update", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}