Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TeamRoleAssignment, UserRoleAssignment #86

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/GitHub.Octokit.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.1" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.9.0" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.1" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.2.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.3.0" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.8.4" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.1.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.2.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.1.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.1.5" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.1.5" />
Expand Down
186 changes: 186 additions & 0 deletions src/GitHub/Models/TeamRoleAssignment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// <auto-generated/>
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
namespace GitHub.Models {
/// <summary>
/// The Relationship a Team has with a role.
/// </summary>
public class TeamRoleAssignment : 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>The description property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Description { get; set; }
#nullable restore
#else
public string Description { get; set; }
#endif
/// <summary>The html_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? HtmlUrl { get; set; }
#nullable restore
#else
public string HtmlUrl { get; set; }
#endif
/// <summary>The id property</summary>
public int? Id { get; set; }
/// <summary>The members_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? MembersUrl { get; set; }
#nullable restore
#else
public string MembersUrl { get; set; }
#endif
/// <summary>The name property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Name { get; set; }
#nullable restore
#else
public string Name { get; set; }
#endif
/// <summary>The node_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? NodeId { get; set; }
#nullable restore
#else
public string NodeId { get; set; }
#endif
/// <summary>The notification_setting property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? NotificationSetting { get; set; }
#nullable restore
#else
public string NotificationSetting { get; set; }
#endif
/// <summary>Groups of organization members that gives permissions on specified repositories.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public NullableTeamSimple? Parent { get; set; }
#nullable restore
#else
public NullableTeamSimple Parent { get; set; }
#endif
/// <summary>The permission property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Permission { get; set; }
#nullable restore
#else
public string Permission { get; set; }
#endif
/// <summary>The permissions property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public TeamRoleAssignment_permissions? Permissions { get; set; }
#nullable restore
#else
public TeamRoleAssignment_permissions Permissions { get; set; }
#endif
/// <summary>The privacy property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Privacy { get; set; }
#nullable restore
#else
public string Privacy { get; set; }
#endif
/// <summary>The repositories_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? RepositoriesUrl { get; set; }
#nullable restore
#else
public string RepositoriesUrl { get; set; }
#endif
/// <summary>The slug property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Slug { get; set; }
#nullable restore
#else
public string Slug { get; set; }
#endif
/// <summary>The url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Url { get; set; }
#nullable restore
#else
public string Url { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="TeamRoleAssignment"/> and sets the default values.
/// </summary>
public TeamRoleAssignment()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="TeamRoleAssignment"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static TeamRoleAssignment CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new TeamRoleAssignment();
}
/// <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>>
{
{"description", n => { Description = n.GetStringValue(); } },
{"html_url", n => { HtmlUrl = n.GetStringValue(); } },
{"id", n => { Id = n.GetIntValue(); } },
{"members_url", n => { MembersUrl = n.GetStringValue(); } },
{"name", n => { Name = n.GetStringValue(); } },
{"node_id", n => { NodeId = n.GetStringValue(); } },
{"notification_setting", n => { NotificationSetting = n.GetStringValue(); } },
{"parent", n => { Parent = n.GetObjectValue<NullableTeamSimple>(NullableTeamSimple.CreateFromDiscriminatorValue); } },
{"permission", n => { Permission = n.GetStringValue(); } },
{"permissions", n => { Permissions = n.GetObjectValue<TeamRoleAssignment_permissions>(TeamRoleAssignment_permissions.CreateFromDiscriminatorValue); } },
{"privacy", n => { Privacy = n.GetStringValue(); } },
{"repositories_url", n => { RepositoriesUrl = n.GetStringValue(); } },
{"slug", n => { Slug = n.GetStringValue(); } },
{"url", n => { Url = 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.WriteStringValue("description", Description);
writer.WriteStringValue("html_url", HtmlUrl);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("members_url", MembersUrl);
writer.WriteStringValue("name", Name);
writer.WriteStringValue("node_id", NodeId);
writer.WriteStringValue("notification_setting", NotificationSetting);
writer.WriteObjectValue<NullableTeamSimple>("parent", Parent);
writer.WriteStringValue("permission", Permission);
writer.WriteObjectValue<TeamRoleAssignment_permissions>("permissions", Permissions);
writer.WriteStringValue("privacy", Privacy);
writer.WriteStringValue("repositories_url", RepositoriesUrl);
writer.WriteStringValue("slug", Slug);
writer.WriteStringValue("url", Url);
writer.WriteAdditionalData(AdditionalData);
}
}
}
71 changes: 71 additions & 0 deletions src/GitHub/Models/TeamRoleAssignment_permissions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// <auto-generated/>
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
namespace GitHub.Models {
#pragma warning disable CS1591
public class TeamRoleAssignment_permissions : 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 admin property</summary>
public bool? Admin { get; set; }
/// <summary>The maintain property</summary>
public bool? Maintain { get; set; }
/// <summary>The pull property</summary>
public bool? Pull { get; set; }
/// <summary>The push property</summary>
public bool? Push { get; set; }
/// <summary>The triage property</summary>
public bool? Triage { get; set; }
/// <summary>
/// Instantiates a new <see cref="TeamRoleAssignment_permissions"/> and sets the default values.
/// </summary>
public TeamRoleAssignment_permissions()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="TeamRoleAssignment_permissions"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static TeamRoleAssignment_permissions CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new TeamRoleAssignment_permissions();
}
/// <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>>
{
{"admin", n => { Admin = n.GetBoolValue(); } },
{"maintain", n => { Maintain = n.GetBoolValue(); } },
{"pull", n => { Pull = n.GetBoolValue(); } },
{"push", n => { Push = n.GetBoolValue(); } },
{"triage", n => { Triage = n.GetBoolValue(); } },
};
}
/// <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.WriteBoolValue("admin", Admin);
writer.WriteBoolValue("maintain", Maintain);
writer.WriteBoolValue("pull", Pull);
writer.WriteBoolValue("push", Push);
writer.WriteBoolValue("triage", Triage);
writer.WriteAdditionalData(AdditionalData);
}
}
}
Loading
Loading