-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for creating Codespaces and getting available machine …
…types (#2929) Adding support for creating Codespaces
- Loading branch information
1 parent
148162a
commit 35f1784
Showing
11 changed files
with
181 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Octokit.Internal; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
|
||
namespace Octokit | ||
{ | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class MachinesCollection | ||
{ | ||
public MachinesCollection(IReadOnlyList<Machine> machines, int count) | ||
{ | ||
Machines = machines; | ||
Count = count; | ||
} | ||
|
||
public MachinesCollection() { } | ||
|
||
[Parameter(Key = "total_count")] | ||
public int Count { get; private set; } | ||
[Parameter(Key = "machines")] | ||
public IReadOnlyList<Machine> Machines { get; private set; } = new List<Machine>(); | ||
|
||
internal string DebuggerDisplay => string.Format(CultureInfo.CurrentCulture, "MachinesCollection: Count: {0}", Count); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Octokit.Internal; | ||
|
||
namespace Octokit | ||
{ | ||
public enum CodespaceLocation | ||
{ | ||
[Parameter(Value = "EuropeWest")] | ||
EuropeWest, | ||
[Parameter(Value = "SoutheastAsia")] | ||
SoutheastAsia, | ||
[Parameter(Value = "UsEast")] | ||
UsEast, | ||
[Parameter(Value = "UsWest")] | ||
UsWest | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
using System.Text; | ||
|
||
namespace Octokit | ||
{ | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class NewCodespace | ||
{ | ||
public string MachineType { get; set; } | ||
public string Reference { get; set; } | ||
public CodespaceLocation? Location { get; set; } | ||
public string DisplayName { get; set; } | ||
|
||
public NewCodespace(Machine machineType, string reference = "main", CodespaceLocation? location = null, string displayName = null) | ||
{ | ||
MachineType = machineType.Name; | ||
Reference = reference; | ||
Location = location; | ||
DisplayName = displayName; | ||
} | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return string.Format(CultureInfo.InvariantCulture, "NewCodespace Repo: {0}", DisplayName); | ||
} | ||
} | ||
|
||
} | ||
} |