Skip to content

Commit

Permalink
Convert response model property accessors from protected to the more …
Browse files Browse the repository at this point in the history
…appropriate private for consistency (#2565)
  • Loading branch information
nickfloyd authored Sep 12, 2022
1 parent cf9db5f commit 9ceb188
Show file tree
Hide file tree
Showing 137 changed files with 949 additions and 950 deletions.
4 changes: 2 additions & 2 deletions Octokit/Models/Response/AccessToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public AccessToken(string token, DateTimeOffset expiresAt)
/// <summary>
/// The access token
/// </summary>
public string Token { get; protected set; }
public string Token { get; private set; }

/// <summary>
/// The expiration date
/// </summary>
public DateTimeOffset ExpiresAt { get; protected set; }
public DateTimeOffset ExpiresAt { get; private set; }

internal string DebuggerDisplay
{
Expand Down
18 changes: 9 additions & 9 deletions Octokit/Models/Response/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,42 @@ public Activity(string type, bool @public, Repository repo, User actor, Organiza
/// The type of the activity.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")]
public string Type { get; protected set; }
public string Type { get; private set; }

/// <summary>
/// Whether the activity event is public or not.
/// </summary>
public bool Public { get; protected set; }
public bool Public { get; private set; }

/// <summary>
/// The repository associated with the activity event.
/// </summary>
public Repository Repo { get; protected set; }
public Repository Repo { get; private set; }

/// <summary>
/// The user associated with the activity event.
/// </summary>
public User Actor { get; protected set; }
public User Actor { get; private set; }

/// <summary>
/// The organization associated with the activity event.
/// </summary>
public Organization Org { get; protected set; }
public Organization Org { get; private set; }

/// <summary>
/// The date the activity event was created.
/// </summary>
public DateTimeOffset CreatedAt { get; protected set; }
public DateTimeOffset CreatedAt { get; private set; }

/// <summary>
/// The activity event Id.
/// </summary>
public string Id { get; protected set; }
public string Id { get; private set; }

/// <summary>
/// The payload associated with the activity event.
/// </summary>
public ActivityPayload Payload { get; protected set; }
public ActivityPayload Payload { get; private set; }

internal string DebuggerDisplay
{
Expand All @@ -74,4 +74,4 @@ internal string DebuggerDisplay
}
}
}
}
}
6 changes: 3 additions & 3 deletions Octokit/Models/Response/ActivityPayloads/ActivityPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public ActivityPayload(Repository repository, User sender, InstallationId instal
Installation = installation;
}

public Repository Repository { get; protected set; }
public User Sender { get; protected set; }
public InstallationId Installation { get; protected set; }
public Repository Repository { get; private set; }
public User Sender { get; private set; }
public InstallationId Installation { get; private set; }

internal string DebuggerDisplay
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CheckRunEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public CheckRun CheckRun { get; protected set; }
public CheckRunRequestedAction RequestedAction { get; protected set; }
public string Action { get; private set; }
public CheckRun CheckRun { get; private set; }
public CheckRunRequestedAction RequestedAction { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CheckSuiteEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public CheckSuite CheckSuite { get; protected set; }
public string Action { get; private set; }
public CheckSuite CheckSuite { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CommitCommentPayload : ActivityPayload
{
public CommitComment Comment { get; protected set; }
public CommitComment Comment { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CreateEventPayload : ActivityPayload
{
public string Ref { get; protected set; }
public string Ref { get; private set; }

public StringEnum<RefType> RefType { get; protected set; }
public StringEnum<RefType> RefType { get; private set; }

public string MasterBranch { get; protected set; }
public string MasterBranch { get; private set; }

public string Description { get; protected set; }
public string Description { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class DeleteEventPayload : ActivityPayload
{
public string Ref { get; protected set; }
public string Ref { get; private set; }

public StringEnum<RefType> RefType { get; protected set; }
public StringEnum<RefType> RefType { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ForkEventPayload : ActivityPayload
{
public Repository Forkee { get; protected set; }
public Repository Forkee { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace Octokit
public class IssueCommentPayload : ActivityPayload
{
// should always be "created" according to github api docs
public string Action { get; protected set; }
public Issue Issue { get; protected set; }
public IssueComment Comment { get; protected set; }
public string Action { get; private set; }
public Issue Issue { get; private set; }
public IssueComment Comment { get; private set; }
}
}
4 changes: 2 additions & 2 deletions Octokit/Models/Response/ActivityPayloads/IssueEventPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class IssueEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public Issue Issue { get; protected set; }
public string Action { get; private set; }
public Issue Issue { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PullRequestCommentPayload : ActivityPayload
{
public string Action { get; protected set; }
public PullRequest PullRequest { get; protected set; }
public PullRequestReviewComment Comment { get; protected set; }
public string Action { get; private set; }
public PullRequest PullRequest { get; private set; }
public PullRequestReviewComment Comment { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PullRequestEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public int Number { get; protected set; }
public string Action { get; private set; }
public int Number { get; private set; }

public PullRequest PullRequest { get; protected set; }
public PullRequest PullRequest { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PullRequestReviewEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public PullRequest PullRequest { get; protected set; }
public PullRequestReview Review { get; protected set; }
public string Action { get; private set; }
public PullRequest PullRequest { get; private set; }
public PullRequestReview Review { get; private set; }
}
}
8 changes: 4 additions & 4 deletions Octokit/Models/Response/ActivityPayloads/PushEventPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PushEventPayload : ActivityPayload
{
public string Head { get; protected set; }
public string Ref { get; protected set; }
public int Size { get; protected set; }
public IReadOnlyList<Commit> Commits { get; protected set; }
public string Head { get; private set; }
public string Ref { get; private set; }
public int Size { get; private set; }
public IReadOnlyList<Commit> Commits { get; private set; }
}
}
22 changes: 11 additions & 11 deletions Octokit/Models/Response/ActivityPayloads/PushWebhookCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PushWebhookCommit
{
public string Id { get; protected set; }
public string Id { get; private set; }

public string TreeId { get; protected set; }
public string TreeId { get; private set; }

public bool Distinct { get; protected set; }
public bool Distinct { get; private set; }

public string Message { get; protected set; }
public string Message { get; private set; }

public DateTimeOffset Timestamp { get; protected set; }
public DateTimeOffset Timestamp { get; private set; }

public Uri Url { get; protected set; }
public Uri Url { get; private set; }

public Committer Author { get; protected set; }
public Committer Author { get; private set; }

public Committer Committer { get; protected set; }
public Committer Committer { get; private set; }

public IReadOnlyList<string> Added { get; protected set; }
public IReadOnlyList<string> Added { get; private set; }

public IReadOnlyList<string> Removed { get; protected set; }
public IReadOnlyList<string> Removed { get; private set; }

public IReadOnlyList<string> Modified { get; protected set; }
public IReadOnlyList<string> Modified { get; private set; }

internal string DebuggerDisplay
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ public PushWebhookCommitter(string name, string email, string username)
/// <value>
/// The name.
/// </value>
public string Name { get; protected set; }
public string Name { get; private set; }

/// <summary>
/// Gets the email of the author or committer.
/// </summary>
/// <value>
/// The email.
/// </value>
public string Email { get; protected set; }
public string Email { get; private set; }

/// <summary>
/// Gets the GitHub username associated with the commit
/// </summary>
/// <value>
/// The username.
/// </value>
public string Username { get; protected set; }
public string Username { get; private set; }

internal string DebuggerDisplay
{
Expand Down
24 changes: 12 additions & 12 deletions Octokit/Models/Response/ActivityPayloads/PushWebhookPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PushWebhookPayload : ActivityPayload
{
public string Head { get; protected set; }
public string Before { get; protected set; }
public string After { get; protected set; }
public string Ref { get; protected set; }
public string BaseRef { get; protected set; }
public bool Created { get; protected set; }
public bool Deleted { get; protected set; }
public bool Forced { get; protected set; }
public string Compare { get; protected set; }
public int Size { get; protected set; }
public IReadOnlyList<PushWebhookCommit> Commits { get; protected set; }
public PushWebhookCommit HeadCommit { get; protected set; }
public string Head { get; private set; }
public string Before { get; private set; }
public string After { get; private set; }
public string Ref { get; private set; }
public string BaseRef { get; private set; }
public bool Created { get; private set; }
public bool Deleted { get; private set; }
public bool Forced { get; private set; }
public string Compare { get; private set; }
public int Size { get; private set; }
public IReadOnlyList<PushWebhookCommit> Commits { get; private set; }
public PushWebhookCommit HeadCommit { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ReleaseEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public string Action { get; private set; }

public Release Release { get; protected set; }
public Release Release { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class StarredEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public string Action { get; private set; }
}
}
Loading

0 comments on commit 9ceb188

Please sign in to comment.