From f1654d7150d05f342cebf88cc828db065a9631ac Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 19 Sep 2024 08:38:04 -0700 Subject: [PATCH] feat | breaking : Adds User [Fragment, Matches, ObjectType, ObjectUrl. Property], removes Users[email.Type] --- src/GitHub/Models/Users.cs | 54 +++++++++---- src/GitHub/Models/Users_matches.cs | 75 +++++++++++++++++++ .../Item/WithEnablementItemRequestBuilder.cs | 4 +- src/GitHub/kiota-lock.json | 2 +- test/Tests.csproj | 4 +- 5 files changed, 120 insertions(+), 19 deletions(-) create mode 100644 src/GitHub/Models/Users_matches.cs diff --git a/src/GitHub/Models/Users.cs b/src/GitHub/Models/Users.cs index 622ebb44..5ccdff73 100644 --- a/src/GitHub/Models/Users.cs +++ b/src/GitHub/Models/Users.cs @@ -14,23 +14,45 @@ 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; } - /// Whether this email address is the primary address. - public bool? Primary { get; set; } - /// The type of email address. + /// The fragment property #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 - /// The email address. + /// The matches property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Value { get; set; } + public List? Matches { get; set; } #nullable restore #else - public string Value { get; set; } + 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; } #endif /// /// Instantiates a new and sets the default values. @@ -57,9 +79,11 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "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.CreateFromDiscriminatorValue)?.AsList(); } }, + { "object_type", n => { ObjectType = n.GetStringValue(); } }, + { "object_url", n => { ObjectUrl = n.GetStringValue(); } }, + { "property", n => { Property = n.GetStringValue(); } }, }; } /// @@ -69,9 +93,11 @@ public virtual IDictionary> 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("matches", Matches); + writer.WriteStringValue("object_type", ObjectType); + writer.WriteStringValue("object_url", ObjectUrl); + writer.WriteStringValue("property", Property); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Models/Users_matches.cs b/src/GitHub/Models/Users_matches.cs new file mode 100644 index 00000000..10b5df80 --- /dev/null +++ b/src/GitHub/Models/Users_matches.cs @@ -0,0 +1,75 @@ +// +#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/Item/Item/WithEnablementItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Item/Item/WithEnablementItemRequestBuilder.cs index 612995a0..71c26094 100644 --- a/src/GitHub/Orgs/Item/Item/Item/WithEnablementItemRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Item/Item/WithEnablementItemRequestBuilder.cs @@ -33,7 +33,7 @@ public WithEnablementItemRequestBuilder(string rawUrl, IRequestAdapter requestAd { } /// - /// > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-cloud@latest//rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-cloud@latest//organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-cloud@latest//rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-cloud@latest//organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// API method documentation /// /// The request body @@ -54,7 +54,7 @@ public async Task PostAsync(global::GitHub.Orgs.Item.Item.Item.WithEnablementPos await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); } /// - /// > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-cloud@latest//rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-cloud@latest//organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-cloud@latest//rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-cloud@latest//organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// /// A /// The request body diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 35793bed..83f2ecfc 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "EB274BA152C71E9EB451D0559F622D8F43A7E5E7ED0B38EC3F40EC16B3141647FB458E4617E9157AFF3BB90A04F1BD5F22D30ABF90D83AE96576D5D6A1A00178", + "descriptionHash": "28846D5BC35F098F6CC043EBD2CD0315C25D925DC86BA346879A8319E9FAE68DC0D6F517E8C766773C3C2E526B85023F15C0276F6295FF9021BB198C58CC010C", "descriptionLocation": "../../../../../schemas/ghec.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.18.0", diff --git a/test/Tests.csproj b/test/Tests.csproj index 856a2dcf..f908795e 100644 --- a/test/Tests.csproj +++ b/test/Tests.csproj @@ -37,10 +37,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + - +