-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
IObservableMigrationsClient.cs
110 lines (103 loc) · 4.37 KB
/
IObservableMigrationsClient.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
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
namespace Octokit.Reactive
{
/// <summary>
/// An interface for GitHub's Migrations API client.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/migration/migrations/">docs</a>
/// for more information.
/// </remarks>
public interface IObservableMigrationsClient
{
/// <summary>
/// Starts a new migration specified for the given organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#start-a-migration
/// </remarks>
/// <param name="org">The organization for which to start a migration.</param>
/// <param name="migration">Specifies parameters for the migration in a
/// <see cref="StartMigrationRequest"/> object.</param>
/// <returns>The started migration.</returns>
IObservable<Migration> Start(
string org,
StartMigrationRequest migration);
/// <summary>
/// Gets the list of the most recent migrations of the organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#get-a-list-of-migrations
/// </remarks>
/// <param name="org">The organization of which to list migrations.</param>
/// <returns>List of most recent <see cref="Migration"/>s.</returns>
IObservable<Migration> GetAll(
string org);
/// <summary>
/// Gets the list of the most recent migrations of the organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#get-a-list-of-migrations
/// </remarks>
/// <param name="org">The organization of which to list migrations.</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>List of most recent <see cref="Migration"/>s.</returns>
IObservable<Migration> GetAll(
string org,
ApiOptions options);
/// <summary>
/// Get the status of a migration.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#get-the-status-of-a-migration
/// </remarks>
/// <param name="org">The organization which is migrating.</param>
/// <param name="id">Migration Id of the organization.</param>
/// <returns>A <see cref="Migration"/> object representing the state of migration.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<Migration> Get(
string org,
long id);
/// <summary>
/// Get the migration archive.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#download-a-migration-archive
/// </remarks>
/// <param name="org">The organization of which the migration was.</param>
/// <param name="id">The Id of the migration.</param>
/// <returns>The binary contents of the archive as a byte array.</returns>
IObservable<byte[]> GetArchive(
string org,
long id);
/// <summary>
/// Deletes a previous migration archive.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#delete-a-migration-archive
/// </remarks>
/// <param name="org">The organization of which the migration was.</param>
/// <param name="id">The Id of the migration.</param>
/// <returns></returns>
IObservable<Unit> DeleteArchive(
string org,
long id);
/// <summary>
/// Unlocks a repository that was locked for migration.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/migration/migrations/#unlock-a-repository
/// </remarks>
/// <param name="org">The organization of which the migration was.</param>
/// <param name="id">The Id of the migration.</param>
/// <param name="repo">The repo to unlock.</param>
/// <returns></returns>
IObservable<Unit> UnlockRepository(
string org,
long id,
string repo);
}
}