Skip to content

Commit 9a7e640

Browse files
authored
Merge pull request #221 from octokit/fixes/206-remove-union-hack
Stop returning IQueryableList for unions
2 parents 9b59a95 + 5a89fe9 commit 9a7e640

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1183
-14
lines changed

Octokit.GraphQL.Core.Generation/InterfaceGenerator.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ private static string GenerateField(FieldModel field)
7575
GenerateListMethod(field, reduced) :
7676
GenerateListField(field, reduced);
7777
}
78-
else if (reduced.Kind == TypeKind.Union)
79-
{
80-
// HACK: Returning IEnumerable<object> for unions for now until we decide how to handle them.
81-
reduced = TypeModel.List(reduced);
82-
result += method ?
83-
GenerateListMethod(field, reduced) :
84-
GenerateListField(field, reduced);
85-
}
8678
else
8779
{
8880
result += method ?

Octokit.GraphQL/Model/AuditEntry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface IAuditEntry : IQueryableValue<IAuditEntry>, IQueryableInterface
2121
/// <summary>
2222
/// The user who initiated the action
2323
/// </summary>
24-
IQueryableList<AuditEntryActor> Actor { get; }
24+
AuditEntryActor Actor { get; }
2525

2626
/// <summary>
2727
/// The IP address of the actor
@@ -96,7 +96,7 @@ internal StubIAuditEntry(Expression expression) : base(expression)
9696

9797
public string Action { get; }
9898

99-
public IQueryableList<AuditEntryActor> Actor => this.CreateProperty(x => x.Actor);
99+
public AuditEntryActor Actor => this.CreateProperty(x => x.Actor, Octokit.GraphQL.Model.AuditEntryActor.Create);
100100

101101
public string ActorIp { get; }
102102

Octokit.GraphQL/Model/CheckConclusionState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ public enum CheckConclusionState
4848
Neutral,
4949

5050
/// <summary>
51-
/// The check suite or run was skipped. For internal use only.
51+
/// The check suite or run was skipped by GitHub. Only GitHub can use this conclusion.
5252
/// </summary>
5353
[EnumMember(Value = "SKIPPED")]
5454
Skipped,
5555

5656
/// <summary>
57-
/// The check suite or run was marked stale. For internal use only.
57+
/// The check suite or run was marked stale by GitHub. Only GitHub can use this conclusion.
5858
/// </summary>
5959
[EnumMember(Value = "STALE")]
6060
Stale,

Octokit.GraphQL/Model/Commit.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,20 @@ internal Commit(Expression expression) : base(expression)
200200
/// </summary>
201201
public Status Status => this.CreateProperty(x => x.Status, Octokit.GraphQL.Model.Status.Create);
202202

203+
/// <summary>
204+
/// Check and Status rollup information for this commit.
205+
/// </summary>
206+
public StatusCheckRollup StatusCheckRollup => this.CreateProperty(x => x.StatusCheckRollup, Octokit.GraphQL.Model.StatusCheckRollup.Create);
207+
208+
/// <summary>
209+
/// Returns a list of all submodules in this repository as of this Commit parsed from the .gitmodules file.
210+
/// </summary>
211+
/// <param name="first">Returns the first _n_ elements from the list.</param>
212+
/// <param name="after">Returns the elements in the list that come after the specified cursor.</param>
213+
/// <param name="last">Returns the last _n_ elements from the list.</param>
214+
/// <param name="before">Returns the elements in the list that come before the specified cursor.</param>
215+
public SubmoduleConnection Submodules(Arg<int>? first = null, Arg<string>? after = null, Arg<int>? last = null, Arg<string>? before = null) => this.CreateMethodCall(x => x.Submodules(first, after, last, before), Octokit.GraphQL.Model.SubmoduleConnection.Create);
216+
203217
/// <summary>
204218
/// Returns a URL to download a tarball archive for a repository.
205219
/// Note: For private repositories, these links are temporary and expire after five minutes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
6+
/// <summary>
7+
/// Autogenerated input type of CreateIpAllowListEntry
8+
/// </summary>
9+
public class CreateIpAllowListEntryInput
10+
{
11+
/// <summary>
12+
/// The ID of the owner for which to create the new IP allow list entry.
13+
/// </summary>
14+
public ID OwnerId { get; set; }
15+
16+
/// <summary>
17+
/// An IP address or range of addresses in CIDR notation.
18+
/// </summary>
19+
public string AllowListValue { get; set; }
20+
21+
/// <summary>
22+
/// An optional name for the IP allow list entry.
23+
/// </summary>
24+
public string Name { get; set; }
25+
26+
/// <summary>
27+
/// Whether the IP allow list entry is active when an IP allow list is enabled.
28+
/// </summary>
29+
public bool IsActive { get; set; }
30+
31+
/// <summary>
32+
/// A unique identifier for the client performing the mutation.
33+
/// </summary>
34+
public string ClientMutationId { get; set; }
35+
}
36+
}
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+
/// Autogenerated return type of CreateIpAllowListEntry
11+
/// </summary>
12+
public class CreateIpAllowListEntryPayload : QueryableValue<CreateIpAllowListEntryPayload>
13+
{
14+
internal CreateIpAllowListEntryPayload(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// A unique identifier for the client performing the mutation.
20+
/// </summary>
21+
public string ClientMutationId { get; }
22+
23+
/// <summary>
24+
/// The IP allow list entry that was created.
25+
/// </summary>
26+
public IpAllowListEntry IpAllowListEntry => this.CreateProperty(x => x.IpAllowListEntry, Octokit.GraphQL.Model.IpAllowListEntry.Create);
27+
28+
internal static CreateIpAllowListEntryPayload Create(Expression expression)
29+
{
30+
return new CreateIpAllowListEntryPayload(expression);
31+
}
32+
}
33+
}

Octokit.GraphQL/Model/CreatePullRequestInput.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ public class CreatePullRequestInput
4141
/// </summary>
4242
public bool? MaintainerCanModify { get; set; }
4343

44+
/// <summary>
45+
/// Indicates whether this pull request should be a draft.
46+
/// </summary>
47+
public bool? Draft { get; set; }
48+
4449
/// <summary>
4550
/// A unique identifier for the client performing the mutation.
4651
/// </summary>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
6+
/// <summary>
7+
/// Autogenerated input type of DeleteDeployment
8+
/// </summary>
9+
public class DeleteDeploymentInput
10+
{
11+
/// <summary>
12+
/// The Node ID of the deployment to be deleted.
13+
/// </summary>
14+
public ID Id { get; set; }
15+
16+
/// <summary>
17+
/// A unique identifier for the client performing the mutation.
18+
/// </summary>
19+
public string ClientMutationId { get; set; }
20+
}
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
/// Autogenerated return type of DeleteDeployment
11+
/// </summary>
12+
public class DeleteDeploymentPayload : QueryableValue<DeleteDeploymentPayload>
13+
{
14+
internal DeleteDeploymentPayload(Expression expression) : base(expression)
15+
{
16+
}
17+
18+
/// <summary>
19+
/// A unique identifier for the client performing the mutation.
20+
/// </summary>
21+
public string ClientMutationId { get; }
22+
23+
internal static DeleteDeploymentPayload Create(Expression expression)
24+
{
25+
return new DeleteDeploymentPayload(expression);
26+
}
27+
}
28+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace Octokit.GraphQL.Model
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
6+
/// <summary>
7+
/// Autogenerated input type of DeleteIpAllowListEntry
8+
/// </summary>
9+
public class DeleteIpAllowListEntryInput
10+
{
11+
/// <summary>
12+
/// The ID of the IP allow list entry to delete.
13+
/// </summary>
14+
public ID IpAllowListEntryId { get; set; }
15+
16+
/// <summary>
17+
/// A unique identifier for the client performing the mutation.
18+
/// </summary>
19+
public string ClientMutationId { get; set; }
20+
}
21+
}

0 commit comments

Comments
 (0)