From cba434bbbf5dbc5b218bc4ebda89609d8fa24a87 Mon Sep 17 00:00:00 2001 From: Felix P Date: Mon, 18 Mar 2024 15:06:45 +0100 Subject: [PATCH] Add support for DefaultBranch --- visual-dotnet/SauceLabs.Visual/CreateBuildOptions.cs | 1 + visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuild.cs | 5 ++++- visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildIn.cs | 2 ++ .../SauceLabs.Visual/GraphQL/CreateBuildMutation.cs | 3 ++- visual-dotnet/SauceLabs.Visual/VisualClient.cs | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/visual-dotnet/SauceLabs.Visual/CreateBuildOptions.cs b/visual-dotnet/SauceLabs.Visual/CreateBuildOptions.cs index 18808565..3edfaea5 100644 --- a/visual-dotnet/SauceLabs.Visual/CreateBuildOptions.cs +++ b/visual-dotnet/SauceLabs.Visual/CreateBuildOptions.cs @@ -13,5 +13,6 @@ public class CreateBuildOptions public string? Project { get; set; } public string? Branch { get; set; } public string? CustomId { get; set; } + public string? DefaultBranch { get; set; } } } \ No newline at end of file diff --git a/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuild.cs b/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuild.cs index df55235b..00037707 100644 --- a/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuild.cs +++ b/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuild.cs @@ -16,8 +16,10 @@ internal class CreateBuild public string? Branch { get; } [JsonProperty("customId")] public string? CustomId { get; } + [JsonProperty("defaultBranch")] + public string? DefaultBranch { get; } - public CreateBuild(string id, string name, string url, string? project, string? branch, string? customId) + public CreateBuild(string id, string name, string url, string? project, string? branch, string? customId, string? defaultBranch) { Id = id; Name = name; @@ -25,6 +27,7 @@ public CreateBuild(string id, string name, string url, string? project, string? Project = project; Branch = branch; CustomId = customId; + DefaultBranch = defaultBranch; } } } \ No newline at end of file diff --git a/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildIn.cs b/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildIn.cs index 2fbb8da1..67e8faef 100644 --- a/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildIn.cs +++ b/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildIn.cs @@ -12,5 +12,7 @@ internal class CreateBuildIn public string? Branch { get; set; } [JsonProperty("customId")] public string? CustomId { get; set; } + [JsonProperty("defaultBranch")] + public string? DefaultBranch { get; set; } } } \ No newline at end of file diff --git a/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildMutation.cs b/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildMutation.cs index 322a16fa..4a1cb783 100644 --- a/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildMutation.cs +++ b/visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildMutation.cs @@ -12,7 +12,8 @@ mutation createBuild($input: BuildIn!) { url, project, branch, - name + name, + defaultBranch } } "; diff --git a/visual-dotnet/SauceLabs.Visual/VisualClient.cs b/visual-dotnet/SauceLabs.Visual/VisualClient.cs index 85f6dae8..0f73709d 100644 --- a/visual-dotnet/SauceLabs.Visual/VisualClient.cs +++ b/visual-dotnet/SauceLabs.Visual/VisualClient.cs @@ -106,6 +106,7 @@ private async Task CreateBuild(CreateBuildOptions? options = null) Project = options?.Project, Branch = options?.Branch, CustomId = options?.CustomId, + DefaultBranch = options?.DefaultBranch, })).EnsureValidResponse(); return new VisualBuild(result.Result.Id, result.Result.Url); }