Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DefaultBranch #5

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions visual-dotnet/SauceLabs.Visual/CreateBuildOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
5 changes: 4 additions & 1 deletion visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ 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;
Url = url;
Project = project;
Branch = branch;
CustomId = customId;
DefaultBranch = defaultBranch;
}
}
}
2 changes: 2 additions & 0 deletions visual-dotnet/SauceLabs.Visual/GraphQL/CreateBuildIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ mutation createBuild($input: BuildIn!) {
url,
project,
branch,
name
name,
defaultBranch
}
}
";
Expand Down
1 change: 1 addition & 0 deletions visual-dotnet/SauceLabs.Visual/VisualClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ private async Task<VisualBuild> 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);
}
Expand Down