Skip to content

Commit

Permalink
feat | breaking : Adds User [Fragment, Matches, ObjectType, ObjectUrl…
Browse files Browse the repository at this point in the history
…. Property], removes Users[email.Type]
  • Loading branch information
octokitbot authored Sep 19, 2024
1 parent 4e8f187 commit f1654d7
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 19 deletions.
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 @@ -33,7 +33,7 @@ public WithEnablementItemRequestBuilder(string rawUrl, IRequestAdapter requestAd
{
}
/// <summary>
/// &gt; [!WARNING]&gt; **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 &quot;[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).&quot;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.
/// &gt; [!WARNING]&gt; **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 &quot;[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).&quot;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 <see href="https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization" />
/// </summary>
/// <param name="body">The request body</param>
Expand All @@ -54,7 +54,7 @@ public async Task PostAsync(global::GitHub.Orgs.Item.Item.Item.WithEnablementPos
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// &gt; [!WARNING]&gt; **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 &quot;[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).&quot;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.
/// &gt; [!WARNING]&gt; **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 &quot;[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).&quot;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.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>
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": "EB274BA152C71E9EB451D0559F622D8F43A7E5E7ED0B38EC3F40EC16B3141647FB458E4617E9157AFF3BB90A04F1BD5F22D30ABF90D83AE96576D5D6A1A00178",
"descriptionHash": "28846D5BC35F098F6CC043EBD2CD0315C25D925DC86BA346879A8319E9FAE68DC0D6F517E8C766773C3C2E526B85023F15C0276F6295FF9021BB198C58CC010C",
"descriptionLocation": "../../../../../schemas/ghec.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.18.0",
Expand Down
4 changes: 2 additions & 2 deletions test/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="all" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Moq" Version="4.20.72" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit f1654d7

Please sign in to comment.