Skip to content

Commit

Permalink
Add support for DefaultBranch (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel authored Mar 18, 2024
1 parent 227c650 commit 265432d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
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

0 comments on commit 265432d

Please sign in to comment.