-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
IReleasesClient.cs
302 lines (277 loc) · 16.6 KB
/
IReleasesClient.cs
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#if NET_45
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
#endif
namespace Octokit
{
/// <summary>
/// A client for GitHub's Releases API.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/">Releases API documentation</a> for more information.
/// </remarks>
public interface IReleasesClient
{
/// <summary>
/// Gets all <see cref="Release"/>s for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<Release>> GetAll(string owner, string name);
/// <summary>
/// Gets all <see cref="Release"/>s for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<Release>> GetAll(long repositoryId);
/// <summary>
/// Gets all <see cref="Release"/>s for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<Release>> GetAll(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all <see cref="Release"/>s for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<Release>> GetAll(long repositoryId, ApiOptions options);
/// <summary>
/// Gets a single <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="id">The id of the release</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")]
Task<Release> Get(string owner, string name, int id);
/// <summary>
/// Gets a single <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The id of the release</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")]
Task<Release> Get(long repositoryId, int id);
/// <summary>
/// Gets the latest <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<Release> GetLatest(string owner, string name);
/// <summary>
/// Gets the latest <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<Release> GetLatest(long repositoryId);
/// <summary>
/// Creates a new <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#create-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="data">A description of the release to create</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<Release> Create(string owner, string name, NewRelease data);
/// <summary>
/// Creates a new <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#create-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="data">A description of the release to create</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<Release> Create(long repositoryId, NewRelease data);
/// <summary>
/// Edits an existing <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="id">The id of the release</param>
/// <param name="data">A description of the release to edit</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<Release> Edit(string owner, string name, int id, ReleaseUpdate data);
/// <summary>
/// Edits an existing <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The id of the release</param>
/// <param name="data">A description of the release to edit</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<Release> Edit(long repositoryId, int id, ReleaseUpdate data);
/// <summary>
/// Deletes an existing <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="id">The id of the release to delete</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task Delete(string owner, string name, int id);
/// <summary>
/// Deletes an existing <see cref="Release"/> for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The id of the release to delete</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task Delete(long repositoryId, int id);
/// <summary>
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="id">The id of the <see cref="Release"/>.</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(string owner, string name, int id);
/// <summary>
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The id of the <see cref="Release"/>.</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(long repositoryId, int id);
/// <summary>
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="id">The id of the <see cref="Release"/>.</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(string owner, string name, int id, ApiOptions options);
/// <summary>
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The id of the <see cref="Release"/>.</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(long repositoryId, int id, ApiOptions options);
/// <summary>
/// Uploads a <see cref="ReleaseAsset"/> for the specified release.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#upload-a-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="release">The <see cref="Release"/> to attach the uploaded asset to</param>
/// <param name="data">Description of the asset with its data</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
Task<ReleaseAsset> UploadAsset(Release release, ReleaseAssetUpload data);
/// <summary>
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
Task<ReleaseAsset> GetAsset(string owner, string name, int assetId);
/// <summary>
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
Task<ReleaseAsset> GetAsset(long repositoryId, int assetId);
/// <summary>
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
/// <param name="data">Description of the asset with its amended data</param>
Task<ReleaseAsset> EditAsset(string owner, string name, int assetId, ReleaseAssetUpdate data);
/// <summary>
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
/// <param name="data">Description of the asset with its amended data</param>
Task<ReleaseAsset> EditAsset(long repositoryId, int assetId, ReleaseAssetUpdate data);
/// <summary>
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
Task DeleteAsset(string owner, string name, int id);
/// <summary>
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release-asset">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
Task DeleteAsset(long repositoryId, int id);
}
}