Skip to content

Commit ed4ab53

Browse files
Merge pull request #185 from octokit/schema-update
Updating schema
2 parents 772de8c + ee4ca85 commit ed4ab53

9 files changed

+419
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Linq.Expressions;
7+
using Octokit.GraphQL.Model;
8+
using Octokit.GraphQL.Core;
9+
using Octokit.GraphQL.Core.Builders;
10+
11+
/// <summary>
12+
/// Represents a contribution a user made on GitHub, such as opening an issue.
13+
/// </summary>
14+
public interface IContribution : IQueryableValue<IContribution>, IQueryableInterface
15+
{
16+
/// <summary>
17+
/// Whether this contribution is associated with a record you do not have access to. For
18+
/// example, your own 'first issue' contribution may have been made on a repository you can no
19+
/// longer access.
20+
/// </summary>
21+
bool IsRestricted { get; }
22+
23+
/// <summary>
24+
/// When this contribution was made.
25+
/// </summary>
26+
DateTimeOffset OccurredAt { get; }
27+
28+
/// <summary>
29+
/// The HTTP path for this contribution.
30+
/// </summary>
31+
string ResourcePath { get; }
32+
33+
/// <summary>
34+
/// The HTTP URL for this contribution.
35+
/// </summary>
36+
string Url { get; }
37+
38+
/// <summary>
39+
/// The user who made this contribution.
40+
/// </summary>
41+
User User { get; }
42+
}
43+
}
44+
45+
namespace Octokit.GraphQL.Model.Internal
46+
{
47+
using System;
48+
using System.Collections.Generic;
49+
using System.Linq.Expressions;
50+
using Octokit.GraphQL.Core;
51+
using Octokit.GraphQL.Core.Builders;
52+
53+
internal class StubIContribution : QueryableValue<StubIContribution>, IContribution
54+
{
55+
internal StubIContribution(Expression expression) : base(expression)
56+
{
57+
}
58+
59+
public bool IsRestricted { get; }
60+
61+
public DateTimeOffset OccurredAt { get; }
62+
63+
public string ResourcePath { get; }
64+
65+
public string Url { get; }
66+
67+
public User User => this.CreateProperty(x => x.User, Octokit.GraphQL.Model.User.Create);
68+
69+
internal static StubIContribution Create(Expression expression)
70+
{
71+
return new StubIContribution(expression);
72+
}
73+
}
74+
}

Octokit.GraphQL/Model/ContributionsCollection.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ internal ContributionsCollection(Expression expression) : base(expression)
3535
/// </summary>
3636
public DateTimeOffset EndedAt { get; }
3737

38+
/// <summary>
39+
/// Does the user have any more activity in the timeline that occurred prior to the collection's time range?
40+
/// </summary>
41+
public bool HasActivityInThePast { get; }
42+
3843
/// <summary>
3944
/// Determine if there are any contributions in this collection.
4045
/// </summary>
@@ -50,6 +55,12 @@ internal ContributionsCollection(Expression expression) : base(expression)
5055
/// </summary>
5156
public bool IsSingleDay { get; }
5257

58+
/// <summary>
59+
/// When the user signed up for GitHub. This will be null if that sign up date falls outside the collection's time range and ignoreTimeRange is false.
60+
/// </summary>
61+
/// <param name="ignoreTimeRange">If true, the contribution will be returned even if the user signed up outside of the collection's time range.</param>
62+
public JoinedGitHubContribution JoinedGitHubContribution(Arg<bool>? ignoreTimeRange = null) => this.CreateMethodCall(x => x.JoinedGitHubContribution(ignoreTimeRange), Octokit.GraphQL.Model.JoinedGitHubContribution.Create);
63+
5364
/// <summary>
5465
/// The date of the most recent restricted contribution the user made in this time period. Can only be non-null when the user has enabled private contribution counts.
5566
/// </summary>
@@ -61,6 +72,24 @@ internal ContributionsCollection(Expression expression) : base(expression)
6172
/// </summary>
6273
public ContributionsCollection MostRecentCollectionWithActivity => this.CreateProperty(x => x.MostRecentCollectionWithActivity, Octokit.GraphQL.Model.ContributionsCollection.Create);
6374

75+
/// <summary>
76+
/// Returns a different contributions collection from an earlier time range than this one
77+
/// that does not have any contributions.
78+
/// </summary>
79+
public ContributionsCollection MostRecentCollectionWithoutActivity => this.CreateProperty(x => x.MostRecentCollectionWithoutActivity, Octokit.GraphQL.Model.ContributionsCollection.Create);
80+
81+
/// <summary>
82+
/// The issue the user opened on GitHub that received the most comments in the specified
83+
/// time frame.
84+
/// </summary>
85+
public CreatedIssueContribution PopularIssueContribution => this.CreateProperty(x => x.PopularIssueContribution, Octokit.GraphQL.Model.CreatedIssueContribution.Create);
86+
87+
/// <summary>
88+
/// The pull request the user opened on GitHub that received the most comments in the
89+
/// specified time frame.
90+
/// </summary>
91+
public CreatedPullRequestContribution PopularPullRequestContribution => this.CreateProperty(x => x.PopularPullRequestContribution, Octokit.GraphQL.Model.CreatedPullRequestContribution.Create);
92+
6493
/// <summary>
6594
/// A count of contributions made by the user that the viewer cannot access. Only non-zero when the user has chosen to share their private contribution counts.
6695
/// </summary>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq.Expressions;
6+
using Octokit.GraphQL.Core;
7+
using Octokit.GraphQL.Core.Builders;
8+
9+
/// <summary>
10+
/// Represents the contribution a user made on GitHub by opening an issue.
11+
/// </summary>
12+
public class CreatedIssueContribution : QueryableValue<CreatedIssueContribution>
13+
{
14+
internal CreatedIssueContribution(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// Whether this contribution is associated with a record you do not have access to. For
20+
/// example, your own 'first issue' contribution may have been made on a repository you can no
21+
/// longer access.
22+
/// </summary>
23+
public bool IsRestricted { get; }
24+
25+
/// <summary>
26+
/// The issue that was opened.
27+
/// </summary>
28+
public Issue Issue => this.CreateProperty(x => x.Issue, Octokit.GraphQL.Model.Issue.Create);
29+
30+
/// <summary>
31+
/// When this contribution was made.
32+
/// </summary>
33+
public DateTimeOffset OccurredAt { get; }
34+
35+
/// <summary>
36+
/// The HTTP path for this contribution.
37+
/// </summary>
38+
public string ResourcePath { get; }
39+
40+
/// <summary>
41+
/// The HTTP URL for this contribution.
42+
/// </summary>
43+
public string Url { get; }
44+
45+
/// <summary>
46+
/// The user who made this contribution.
47+
/// </summary>
48+
public User User => this.CreateProperty(x => x.User, Octokit.GraphQL.Model.User.Create);
49+
50+
internal static CreatedIssueContribution Create(Expression expression)
51+
{
52+
return new CreatedIssueContribution(expression);
53+
}
54+
}
55+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq.Expressions;
6+
using Octokit.GraphQL.Core;
7+
using Octokit.GraphQL.Core.Builders;
8+
9+
/// <summary>
10+
/// The connection type for CreatedIssueContribution.
11+
/// </summary>
12+
public class CreatedIssueContributionConnection : QueryableValue<CreatedIssueContributionConnection>, IPagingConnection<CreatedIssueContribution>
13+
{
14+
internal CreatedIssueContributionConnection(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// A list of edges.
20+
/// </summary>
21+
public IQueryableList<CreatedIssueContributionEdge> Edges => this.CreateProperty(x => x.Edges);
22+
23+
/// <summary>
24+
/// A list of nodes.
25+
/// </summary>
26+
public IQueryableList<CreatedIssueContribution> Nodes => this.CreateProperty(x => x.Nodes);
27+
28+
/// <summary>
29+
/// Information to aid in pagination.
30+
/// </summary>
31+
public PageInfo PageInfo => this.CreateProperty(x => x.PageInfo, Octokit.GraphQL.Model.PageInfo.Create);
32+
33+
/// <summary>
34+
/// Identifies the total count of items in the connection.
35+
/// </summary>
36+
public int TotalCount { get; }
37+
38+
IPageInfo IPagingConnection.PageInfo => PageInfo;
39+
40+
internal static CreatedIssueContributionConnection Create(Expression expression)
41+
{
42+
return new CreatedIssueContributionConnection(expression);
43+
}
44+
}
45+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq.Expressions;
6+
using Octokit.GraphQL.Core;
7+
using Octokit.GraphQL.Core.Builders;
8+
9+
/// <summary>
10+
/// An edge in a connection.
11+
/// </summary>
12+
public class CreatedIssueContributionEdge : QueryableValue<CreatedIssueContributionEdge>
13+
{
14+
internal CreatedIssueContributionEdge(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// A cursor for use in pagination.
20+
/// </summary>
21+
public string Cursor { get; }
22+
23+
/// <summary>
24+
/// The item at the end of the edge.
25+
/// </summary>
26+
public CreatedIssueContribution Node => this.CreateProperty(x => x.Node, Octokit.GraphQL.Model.CreatedIssueContribution.Create);
27+
28+
internal static CreatedIssueContributionEdge Create(Expression expression)
29+
{
30+
return new CreatedIssueContributionEdge(expression);
31+
}
32+
}
33+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq.Expressions;
6+
using Octokit.GraphQL.Core;
7+
using Octokit.GraphQL.Core.Builders;
8+
9+
/// <summary>
10+
/// Represents the contribution a user made on GitHub by opening a pull request.
11+
/// </summary>
12+
public class CreatedPullRequestContribution : QueryableValue<CreatedPullRequestContribution>
13+
{
14+
internal CreatedPullRequestContribution(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// Whether this contribution is associated with a record you do not have access to. For
20+
/// example, your own 'first issue' contribution may have been made on a repository you can no
21+
/// longer access.
22+
/// </summary>
23+
public bool IsRestricted { get; }
24+
25+
/// <summary>
26+
/// When this contribution was made.
27+
/// </summary>
28+
public DateTimeOffset OccurredAt { get; }
29+
30+
/// <summary>
31+
/// The pull request that was opened.
32+
/// </summary>
33+
public PullRequest PullRequest => this.CreateProperty(x => x.PullRequest, Octokit.GraphQL.Model.PullRequest.Create);
34+
35+
/// <summary>
36+
/// The HTTP path for this contribution.
37+
/// </summary>
38+
public string ResourcePath { get; }
39+
40+
/// <summary>
41+
/// The HTTP URL for this contribution.
42+
/// </summary>
43+
public string Url { get; }
44+
45+
/// <summary>
46+
/// The user who made this contribution.
47+
/// </summary>
48+
public User User => this.CreateProperty(x => x.User, Octokit.GraphQL.Model.User.Create);
49+
50+
internal static CreatedPullRequestContribution Create(Expression expression)
51+
{
52+
return new CreatedPullRequestContribution(expression);
53+
}
54+
}
55+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq.Expressions;
6+
using Octokit.GraphQL.Core;
7+
using Octokit.GraphQL.Core.Builders;
8+
9+
/// <summary>
10+
/// The connection type for CreatedPullRequestContribution.
11+
/// </summary>
12+
public class CreatedPullRequestContributionConnection : QueryableValue<CreatedPullRequestContributionConnection>, IPagingConnection<CreatedPullRequestContribution>
13+
{
14+
internal CreatedPullRequestContributionConnection(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// A list of edges.
20+
/// </summary>
21+
public IQueryableList<CreatedPullRequestContributionEdge> Edges => this.CreateProperty(x => x.Edges);
22+
23+
/// <summary>
24+
/// A list of nodes.
25+
/// </summary>
26+
public IQueryableList<CreatedPullRequestContribution> Nodes => this.CreateProperty(x => x.Nodes);
27+
28+
/// <summary>
29+
/// Information to aid in pagination.
30+
/// </summary>
31+
public PageInfo PageInfo => this.CreateProperty(x => x.PageInfo, Octokit.GraphQL.Model.PageInfo.Create);
32+
33+
/// <summary>
34+
/// Identifies the total count of items in the connection.
35+
/// </summary>
36+
public int TotalCount { get; }
37+
38+
IPageInfo IPagingConnection.PageInfo => PageInfo;
39+
40+
internal static CreatedPullRequestContributionConnection Create(Expression expression)
41+
{
42+
return new CreatedPullRequestContributionConnection(expression);
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)