From 927e88a8b85a39b7a341bffa695239f43f8504cf Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Mon, 30 Sep 2024 11:59:52 -0700 Subject: [PATCH] feat: Updates users (#77) * New updates to generated code * New updates to generated code --- src/GitHub.Octokit.GHES.SDK.csproj | 2 +- src/GitHub/Models/OrgRulesetConditions.cs | 2 +- .../Models/RepositoryRulesetBypassActor.cs | 3 +- ...epositoryRulesetBypassActor_bypass_mode.cs | 2 +- src/GitHub/Models/Users.cs | 54 ++++--------- src/GitHub/Models/Users_matches.cs | 75 ------------------- .../Item/WithRuleset_PutRequestBody.cs | 2 +- .../Item/Rulesets/RulesetsPostRequestBody.cs | 2 +- src/GitHub/kiota-lock.json | 2 +- test/Tests.csproj | 2 +- 10 files changed, 23 insertions(+), 123 deletions(-) delete mode 100644 src/GitHub/Models/Users_matches.cs diff --git a/src/GitHub.Octokit.GHES.SDK.csproj b/src/GitHub.Octokit.GHES.SDK.csproj index 70cbd779d..ab2afc7df 100644 --- a/src/GitHub.Octokit.GHES.SDK.csproj +++ b/src/GitHub.Octokit.GHES.SDK.csproj @@ -33,7 +33,7 @@ - + diff --git a/src/GitHub/Models/OrgRulesetConditions.cs b/src/GitHub/Models/OrgRulesetConditions.cs index f1a256094..97137ed16 100644 --- a/src/GitHub/Models/OrgRulesetConditions.cs +++ b/src/GitHub/Models/OrgRulesetConditions.cs @@ -8,7 +8,7 @@ namespace GitHub.Models { /// - /// 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. /// [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")] public partial class OrgRulesetConditions : IAdditionalDataHolder, IParsable diff --git a/src/GitHub/Models/RepositoryRulesetBypassActor.cs b/src/GitHub/Models/RepositoryRulesetBypassActor.cs index b171f5c09..a341842c2 100644 --- a/src/GitHub/Models/RepositoryRulesetBypassActor.cs +++ b/src/GitHub/Models/RepositoryRulesetBypassActor.cs @@ -19,7 +19,7 @@ public partial class RepositoryRulesetBypassActor : IAdditionalDataHolder, IPars public global::GitHub.Models.RepositoryRulesetBypassActor_actor_type? ActorType { get; set; } /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// 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. + /// 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. public global::GitHub.Models.RepositoryRulesetBypassActor_bypass_mode? BypassMode { get; set; } /// /// Instantiates a new and sets the default values. @@ -27,6 +27,7 @@ public partial class RepositoryRulesetBypassActor : IAdditionalDataHolder, IPars public RepositoryRulesetBypassActor() { AdditionalData = new Dictionary(); + BypassMode = global::GitHub.Models.RepositoryRulesetBypassActor_bypass_mode.Always; } /// /// Creates a new instance of the appropriate class based on discriminator value diff --git a/src/GitHub/Models/RepositoryRulesetBypassActor_bypass_mode.cs b/src/GitHub/Models/RepositoryRulesetBypassActor_bypass_mode.cs index abc30cb9e..fa6e5e065 100644 --- a/src/GitHub/Models/RepositoryRulesetBypassActor_bypass_mode.cs +++ b/src/GitHub/Models/RepositoryRulesetBypassActor_bypass_mode.cs @@ -3,7 +3,7 @@ using System; namespace GitHub.Models { - /// 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. + /// 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. [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")] public enum RepositoryRulesetBypassActor_bypass_mode { diff --git a/src/GitHub/Models/Users.cs b/src/GitHub/Models/Users.cs index 5ccdff739..622ebb445 100644 --- a/src/GitHub/Models/Users.cs +++ b/src/GitHub/Models/Users.cs @@ -14,45 +14,23 @@ public partial class Users : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The fragment property + /// Whether this email address is the primary address. + public bool? Primary { get; set; } + /// The type of email address. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Fragment { get; set; } + public string? Type { get; set; } #nullable restore #else - public string Fragment { get; set; } + public string Type { get; set; } #endif - /// The matches property + /// The email address. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Matches { get; set; } + public string? Value { get; set; } #nullable restore #else - public List Matches { get; set; } -#endif - /// The object_type property -#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 - /// The object_url property -#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 - /// The property property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Property { get; set; } -#nullable restore -#else - public string Property { get; set; } + public string Value { get; set; } #endif /// /// Instantiates a new and sets the default values. @@ -79,11 +57,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "fragment", n => { Fragment = n.GetStringValue(); } }, - { "matches", n => { Matches = n.GetCollectionOfObjectValues(global::GitHub.Models.Users_matches.CreateFromDiscriminatorValue)?.AsList(); } }, - { "object_type", n => { ObjectType = n.GetStringValue(); } }, - { "object_url", n => { ObjectUrl = n.GetStringValue(); } }, - { "property", n => { Property = n.GetStringValue(); } }, + { "primary", n => { Primary = n.GetBoolValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, }; } /// @@ -93,11 +69,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("fragment", Fragment); - writer.WriteCollectionOfObjectValues("matches", Matches); - writer.WriteStringValue("object_type", ObjectType); - writer.WriteStringValue("object_url", ObjectUrl); - writer.WriteStringValue("property", Property); + writer.WriteBoolValue("primary", Primary); + writer.WriteStringValue("type", Type); + writer.WriteStringValue("value", Value); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Models/Users_matches.cs b/src/GitHub/Models/Users_matches.cs deleted file mode 100644 index 10b5df806..000000000 --- a/src/GitHub/Models/Users_matches.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -#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 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The indices property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public List? Indices { get; set; } -#nullable restore -#else - public List Indices { get; set; } -#endif - /// The text property -#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 - /// - /// Instantiates a new and sets the default values. - /// - public Users_matches() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::GitHub.Models.Users_matches CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new global::GitHub.Models.Users_matches(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - { "indices", n => { Indices = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, - { "text", n => { Text = n.GetStringValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfPrimitiveValues("indices", Indices); - writer.WriteStringValue("text", Text); - writer.WriteAdditionalData(AdditionalData); - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs index 534b7bcda..0a3363e16 100644 --- a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs +++ b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs @@ -23,7 +23,7 @@ public partial class WithRuleset_PutRequestBody : IAdditionalDataHolder, IParsab #else public List BypassActors { get; set; } #endif - /// 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. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public global::GitHub.Models.OrgRulesetConditions? Conditions { get; set; } diff --git a/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs b/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs index d3987802f..79df45e03 100644 --- a/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs +++ b/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs @@ -23,7 +23,7 @@ public partial class RulesetsPostRequestBody : IAdditionalDataHolder, IParsable #else public List BypassActors { get; set; } #endif - /// 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. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public global::GitHub.Models.OrgRulesetConditions? Conditions { get; set; } diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 858b7dc68..367f39f0c 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "74F535465F8C80AD4EAC12ED7F48EA48BE8FB9A3A04AF726140643312436081CA74E05C7BA5354C118E75C5D6FA4FA0A2DFE539C8B18DB026459DF3A909A7FCA", + "descriptionHash": "42342DB5DA0A2E38D39851FF9B2762416C72313AD8D9F96413AC131558CC65D9D73E2F462F39A044D278D93D0EA99C3AC5344EE58C4EA17062CC84EF94D57E91", "descriptionLocation": "../../../../../schemas/ghes-3.13.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.18.0", diff --git a/test/Tests.csproj b/test/Tests.csproj index b0e2c5092..d5454221d 100644 --- a/test/Tests.csproj +++ b/test/Tests.csproj @@ -38,7 +38,7 @@ all - +