Files
octokit.net/Octokit/Models/Request/NewPullRequest.cs
T
Henrik Andersson fafbf33b78 Implement Draft Pull Requests (#2009)
* Add draft PR preview header

* Add Draft property to models

* Update pull requests client and tests to use draft PR accept header

* Update observable pull requests client and tests to use draft PR accept header

* Add integration tests to create and retrieve draft pull requests
2019-09-22 13:38:56 -03:00

68 lines
2.3 KiB
C#

using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// Describes a new pull request to create via the <see cref="IPullRequestsClient.Create(string,string,NewPullRequest)"/> method.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class NewPullRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="NewPullRequest"/> class.
/// </summary>
/// <param name="title">The title of the pull request.</param>
/// <param name="head">The branch (or git ref where your changes are implemented. In other words, the source branch/ref</param>
/// <param name="baseRef">The base (or git ref) reference you want your changes pulled into. In other words, the target branch/ref</param>
public NewPullRequest(string title, string head, string baseRef)
{
Ensure.ArgumentNotNullOrEmptyString(title, nameof(title));
Ensure.ArgumentNotNullOrEmptyString(head, nameof(head));
Ensure.ArgumentNotNullOrEmptyString(baseRef, nameof(baseRef));
Title = title;
Head = head;
Base = baseRef;
}
/// <summary>
/// Title of the pull request (required)
/// </summary>
public string Title { get; private set; }
/// <summary>
/// The branch (or git ref) you want your changes pulled into (required).
/// </summary>
public string Base { get; private set; }
/// <summary>
/// The branch (or git ref) where your changes are implemented (required).
/// </summary>
public string Head { get; private set; }
/// <summary>
/// Whether maintainers of the base repository can push to the HEAD branch (optional).
/// </summary>
public bool? MaintainerCanModify { get; set; }
/// <summary>
/// Body of the pull request (optional)
/// </summary>
public string Body { get; set; }
/// <summary>
/// Whether the pull request is in a draft state or not (optional)
/// </summary>
public bool? Draft { get; set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Title: {0}", Title);
}
}
}
}