Skip to content

Commit

Permalink
feat: Updates users (#79)
Browse files Browse the repository at this point in the history
* New updates to generated code

* New updates to generated code

* New updates to generated code
  • Loading branch information
octokitbot authored Sep 30, 2024
1 parent 561fd77 commit 3530f42
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/GitHub.Octokit.GHES.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.2" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.1.0" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.12.4" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.12.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.12.4" />
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Models/OrgRulesetConditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace GitHub.Models
{
/// <summary>
/// Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties.
/// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class OrgRulesetConditions : IAdditionalDataHolder, IParsable
Expand Down
3 changes: 2 additions & 1 deletion src/GitHub/Models/RepositoryRulesetBypassActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ public partial class RepositoryRulesetBypassActor : IAdditionalDataHolder, IPars
public global::GitHub.Models.RepositoryRulesetBypassActor_actor_type? ActorType { get; set; }
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type.</summary>
/// <summary>When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets.</summary>
public global::GitHub.Models.RepositoryRulesetBypassActor_bypass_mode? BypassMode { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.RepositoryRulesetBypassActor"/> and sets the default values.
/// </summary>
public RepositoryRulesetBypassActor()
{
AdditionalData = new Dictionary<string, object>();
BypassMode = global::GitHub.Models.RepositoryRulesetBypassActor_bypass_mode.Always;
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System;
namespace GitHub.Models
{
/// <summary>When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type.</summary>
/// <summary>When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public enum RepositoryRulesetBypassActor_bypass_mode
{
Expand Down
54 changes: 40 additions & 14 deletions src/GitHub/Models/Users.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,45 @@ public partial class Users : IAdditionalDataHolder, IParsable
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>Whether this email address is the primary address.</summary>
public bool? Primary { get; set; }
/// <summary>The type of email address.</summary>
/// <summary>The fragment property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Type { get; set; }
public string? Fragment { get; set; }
#nullable restore
#else
public string Type { get; set; }
public string Fragment { get; set; }
#endif
/// <summary>The email address.</summary>
/// <summary>The matches property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Value { get; set; }
public List<global::GitHub.Models.Users_matches>? Matches { get; set; }
#nullable restore
#else
public string Value { get; set; }
public List<global::GitHub.Models.Users_matches> Matches { get; set; }
#endif
/// <summary>The object_type property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ObjectType { get; set; }
#nullable restore
#else
public string ObjectType { get; set; }
#endif
/// <summary>The object_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ObjectUrl { get; set; }
#nullable restore
#else
public string ObjectUrl { get; set; }
#endif
/// <summary>The property property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Property { get; set; }
#nullable restore
#else
public string Property { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.Users"/> and sets the default values.
Expand All @@ -57,9 +79,11 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "primary", n => { Primary = n.GetBoolValue(); } },
{ "type", n => { Type = n.GetStringValue(); } },
{ "value", n => { Value = n.GetStringValue(); } },
{ "fragment", n => { Fragment = n.GetStringValue(); } },
{ "matches", n => { Matches = n.GetCollectionOfObjectValues<global::GitHub.Models.Users_matches>(global::GitHub.Models.Users_matches.CreateFromDiscriminatorValue)?.AsList(); } },
{ "object_type", n => { ObjectType = n.GetStringValue(); } },
{ "object_url", n => { ObjectUrl = n.GetStringValue(); } },
{ "property", n => { Property = n.GetStringValue(); } },
};
}
/// <summary>
Expand All @@ -69,9 +93,11 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteBoolValue("primary", Primary);
writer.WriteStringValue("type", Type);
writer.WriteStringValue("value", Value);
writer.WriteStringValue("fragment", Fragment);
writer.WriteCollectionOfObjectValues<global::GitHub.Models.Users_matches>("matches", Matches);
writer.WriteStringValue("object_type", ObjectType);
writer.WriteStringValue("object_url", ObjectUrl);
writer.WriteStringValue("property", Property);
writer.WriteAdditionalData(AdditionalData);
}
}
Expand Down
75 changes: 75 additions & 0 deletions src/GitHub/Models/Users_matches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System;
namespace GitHub.Models
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
#pragma warning disable CS1591
public partial class Users_matches : IAdditionalDataHolder, IParsable
#pragma warning restore CS1591
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The indices property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<int?>? Indices { get; set; }
#nullable restore
#else
public List<int?> Indices { get; set; }
#endif
/// <summary>The text property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Text { get; set; }
#nullable restore
#else
public string Text { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.Users_matches"/> and sets the default values.
/// </summary>
public Users_matches()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::GitHub.Models.Users_matches"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Models.Users_matches CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Models.Users_matches();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "indices", n => { Indices = n.GetCollectionOfPrimitiveValues<int?>()?.AsList(); } },
{ "text", n => { Text = n.GetStringValue(); } },
};
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteCollectionOfPrimitiveValues<int?>("indices", Indices);
writer.WriteStringValue("text", Text);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class WithRuleset_PutRequestBody : IAdditionalDataHolder, IParsab
#else
public List<global::GitHub.Models.RepositoryRulesetBypassActor> BypassActors { get; set; }
#endif
/// <summary>Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties.</summary>
/// <summary>Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.OrgRulesetConditions? Conditions { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class RulesetsPostRequestBody : IAdditionalDataHolder, IParsable
#else
public List<global::GitHub.Models.RepositoryRulesetBypassActor> BypassActors { get; set; }
#endif
/// <summary>Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties.</summary>
/// <summary>Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.OrgRulesetConditions? Conditions { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "2FEB471D3FC2D8EEEB29047BBC2181B1999549327F36EB90889C72FCA5E2645C7B89EDAAA8431EEBD410557433119614B214ED39608A3CFD13F38C77E076758F",
"descriptionHash": "D193FB5ADEB3C48A311B7009C13614E76582927AC1F0735770FBD08ABED36F68CC606FA74A323F3EA39986D85843A14B8B41A0F7D1530D47E818433E7E0F2148",
"descriptionLocation": "../../../../../schemas/ghes-3.12.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.18.0",
Expand Down
2 changes: 1 addition & 1 deletion test/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="all" />
<PackageReference Include="Moq" Version="4.20.72" />
</ItemGroup>
Expand Down

0 comments on commit 3530f42

Please sign in to comment.