diff --git a/Octokit/Models/Request/CreateFileRequest.cs b/Octokit/Models/Request/CreateFileRequest.cs index 275d6fbf..b804ac73 100644 --- a/Octokit/Models/Request/CreateFileRequest.cs +++ b/Octokit/Models/Request/CreateFileRequest.cs @@ -21,6 +21,18 @@ namespace Octokit Message = message; } + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The branch the request is for. + protected ContentRequest(string message, string branch): this(message) + { + Ensure.ArgumentNotNullOrEmptyString(branch, "branch"); + + Branch = branch; + } + /// /// The commit message. This is required. /// @@ -54,6 +66,19 @@ namespace Octokit /// The message. /// The sha. public DeleteFileRequest(string message, string sha) : base(message) + { + Ensure.ArgumentNotNullOrEmptyString(sha, "content"); + + Sha = sha; + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The sha. + /// The branch the request is for. + public DeleteFileRequest(string message, string sha, string branch) : base(message, branch) { Ensure.ArgumentNotNullOrEmptyString(sha, "sha"); @@ -81,8 +106,8 @@ namespace Octokit /// /// Creates an instance of a . /// - /// - /// + /// The message. + /// The content. public CreateFileRequest(string message, string content) : base(message) { Ensure.ArgumentNotNull(content, "content"); @@ -90,6 +115,18 @@ namespace Octokit Content = content; } + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The content. + /// The branch the request is for. + public CreateFileRequest(string message, string content, string branch) : base(message, branch) + { + Ensure.ArgumentNotNullOrEmptyString(content, "content"); + + Content = content; + } /// /// The contents of the file to create. This is required. /// @@ -111,6 +148,12 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class UpdateFileRequest : CreateFileRequest { + /// + /// Creates an instance of a . + /// + /// The message. + /// The content. + /// The sha. public UpdateFileRequest(string message, string content, string sha) : base(message, content) { @@ -119,6 +162,21 @@ namespace Octokit Sha = sha; } + /// + /// Creates an instance of a . + /// + /// The message. + /// The content. + /// The sha. + /// The branch the request is for. + public UpdateFileRequest(string message, string content, string sha, string branch) + : base(message, content, branch) + { + Ensure.ArgumentNotNullOrEmptyString(sha, "sha"); + + Sha = sha; + } + /// /// The blob SHA of the file being replaced. ///