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

Generated models and request builders #521

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
56 changes: 41 additions & 15 deletions src/generated/Admin/AdminRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// <auto-generated/>
#pragma warning disable CS0618
using ApiSdk.Admin.Edge;
using ApiSdk.Admin.Microsoft365Apps;
using ApiSdk.Admin.People;
using ApiSdk.Admin.ReportSettings;
using ApiSdk.Admin.ServiceAnnouncement;
using ApiSdk.Admin.Sharepoint;
using ApiSdk.Models.ODataErrors;
using ApiSdk.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Cli.Commons.Extensions;
Expand All @@ -24,7 +27,8 @@ namespace ApiSdk.Admin
/// <summary>
/// Provides operations to manage the admin singleton.
/// </summary>
public class AdminRequestBuilder : BaseCliRequestBuilder
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class AdminRequestBuilder : BaseCliRequestBuilder
{
/// <summary>
/// Provides operations to manage the edge property of the microsoft.graph.admin entity.
Expand All @@ -34,7 +38,7 @@ public Command BuildEdgeNavCommand()
{
var command = new Command("edge");
command.Description = "Provides operations to manage the edge property of the microsoft.graph.admin entity.";
var builder = new EdgeRequestBuilder(PathParameters);
var builder = new global::ApiSdk.Admin.Edge.EdgeRequestBuilder(PathParameters);
var execCommands = new List<Command>();
var nonExecCommands = new List<Command>();
execCommands.Add(builder.BuildDeleteCommand());
Expand Down Expand Up @@ -105,7 +109,7 @@ public Command BuildMicrosoft365AppsNavCommand()
{
var command = new Command("microsoft365-apps");
command.Description = "Provides operations to manage the microsoft365Apps property of the microsoft.graph.admin entity.";
var builder = new Microsoft365AppsRequestBuilder(PathParameters);
var builder = new global::ApiSdk.Admin.Microsoft365Apps.Microsoft365AppsRequestBuilder(PathParameters);
var execCommands = new List<Command>();
var nonExecCommands = new List<Command>();
execCommands.Add(builder.BuildDeleteCommand());
Expand Down Expand Up @@ -147,8 +151,8 @@ public Command BuildPatchCommand()
var cancellationToken = invocationContext.GetCancellationToken();
var reqAdapter = invocationContext.GetRequestAdapter();
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
var model = parseNode.GetObjectValue<ApiSdk.Models.Admin>(ApiSdk.Models.Admin.CreateFromDiscriminatorValue);
var parseNode = await ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNodeAsync("application/json", stream, cancellationToken);
var model = parseNode.GetObjectValue<global::ApiSdk.Models.Admin>(global::ApiSdk.Models.Admin.CreateFromDiscriminatorValue);
if (model is null) {
Console.Error.WriteLine("No model data to send.");
return;
Expand All @@ -175,10 +179,11 @@ public Command BuildPeopleNavCommand()
{
var command = new Command("people");
command.Description = "Provides operations to manage the people property of the microsoft.graph.admin entity.";
var builder = new PeopleRequestBuilder(PathParameters);
var builder = new global::ApiSdk.Admin.People.PeopleRequestBuilder(PathParameters);
var execCommands = new List<Command>();
var nonExecCommands = new List<Command>();
execCommands.Add(builder.BuildGetCommand());
nonExecCommands.Add(builder.BuildItemInsightsNavCommand());
nonExecCommands.Add(builder.BuildProfileCardPropertiesNavCommand());
nonExecCommands.Add(builder.BuildPronounsNavCommand());
foreach (var cmd in execCommands)
Expand All @@ -192,14 +197,33 @@ public Command BuildPeopleNavCommand()
return command;
}
/// <summary>
/// Provides operations to manage the reportSettings property of the microsoft.graph.admin entity.
/// </summary>
/// <returns>A <see cref="Command"/></returns>
public Command BuildReportSettingsNavCommand()
{
var command = new Command("report-settings");
command.Description = "Provides operations to manage the reportSettings property of the microsoft.graph.admin entity.";
var builder = new global::ApiSdk.Admin.ReportSettings.ReportSettingsRequestBuilder(PathParameters);
var execCommands = new List<Command>();
execCommands.Add(builder.BuildDeleteCommand());
execCommands.Add(builder.BuildGetCommand());
execCommands.Add(builder.BuildPatchCommand());
foreach (var cmd in execCommands)
{
command.AddCommand(cmd);
}
return command;
}
/// <summary>
/// Provides operations to manage the serviceAnnouncement property of the microsoft.graph.admin entity.
/// </summary>
/// <returns>A <see cref="Command"/></returns>
public Command BuildServiceAnnouncementNavCommand()
{
var command = new Command("service-announcement");
command.Description = "Provides operations to manage the serviceAnnouncement property of the microsoft.graph.admin entity.";
var builder = new ServiceAnnouncementRequestBuilder(PathParameters);
var builder = new global::ApiSdk.Admin.ServiceAnnouncement.ServiceAnnouncementRequestBuilder(PathParameters);
var execCommands = new List<Command>();
var nonExecCommands = new List<Command>();
execCommands.Add(builder.BuildDeleteCommand());
Expand All @@ -226,7 +250,7 @@ public Command BuildSharepointNavCommand()
{
var command = new Command("sharepoint");
command.Description = "Provides operations to manage the sharepoint property of the microsoft.graph.admin entity.";
var builder = new SharepointRequestBuilder(PathParameters);
var builder = new global::ApiSdk.Admin.Sharepoint.SharepointRequestBuilder(PathParameters);
var execCommands = new List<Command>();
var nonExecCommands = new List<Command>();
execCommands.Add(builder.BuildDeleteCommand());
Expand All @@ -244,14 +268,14 @@ public Command BuildSharepointNavCommand()
return command;
}
/// <summary>
/// Instantiates a new <see cref="AdminRequestBuilder"/> and sets the default values.
/// Instantiates a new <see cref="global::ApiSdk.Admin.AdminRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
public AdminRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/admin{?%24expand,%24select}", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="AdminRequestBuilder"/> and sets the default values.
/// Instantiates a new <see cref="global::ApiSdk.Admin.AdminRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public AdminRequestBuilder(string rawUrl) : base("{+baseurl}/admin{?%24expand,%24select}", rawUrl)
Expand All @@ -264,11 +288,11 @@ public AdminRequestBuilder(string rawUrl) : base("{+baseurl}/admin{?%24expand,%2
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<AdminRequestBuilderGetQueryParameters>>? requestConfiguration = default)
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::ApiSdk.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<AdminRequestBuilderGetQueryParameters>> requestConfiguration = default)
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::ApiSdk.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
Expand All @@ -284,11 +308,11 @@ public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<Ad
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Admin body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
public RequestInformation ToPatchRequestInformation(global::ApiSdk.Models.Admin body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Admin body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
public RequestInformation ToPatchRequestInformation(global::ApiSdk.Models.Admin body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
Expand All @@ -300,7 +324,8 @@ public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Admin body, Ac
/// <summary>
/// Get admin
/// </summary>
public class AdminRequestBuilderGetQueryParameters
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class AdminRequestBuilderGetQueryParameters
{
/// <summary>Expand related entities</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand All @@ -325,3 +350,4 @@ public class AdminRequestBuilderGetQueryParameters
}
}
}
#pragma warning restore CS0618
27 changes: 16 additions & 11 deletions src/generated/Admin/Edge/EdgeRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// <auto-generated/>
#pragma warning disable CS0618
using ApiSdk.Admin.Edge.InternetExplorerMode;
using ApiSdk.Models.ODataErrors;
using ApiSdk.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Cli.Commons.Extensions;
Expand All @@ -20,7 +22,8 @@ namespace ApiSdk.Admin.Edge
/// <summary>
/// Provides operations to manage the edge property of the microsoft.graph.admin entity.
/// </summary>
public class EdgeRequestBuilder : BaseCliRequestBuilder
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class EdgeRequestBuilder : BaseCliRequestBuilder
{
/// <summary>
/// Delete navigation property edge for admin
Expand Down Expand Up @@ -105,7 +108,7 @@ public Command BuildInternetExplorerModeNavCommand()
{
var command = new Command("internet-explorer-mode");
command.Description = "Provides operations to manage the internetExplorerMode property of the microsoft.graph.edge entity.";
var builder = new InternetExplorerModeRequestBuilder(PathParameters);
var builder = new global::ApiSdk.Admin.Edge.InternetExplorerMode.InternetExplorerModeRequestBuilder(PathParameters);
var execCommands = new List<Command>();
var nonExecCommands = new List<Command>();
execCommands.Add(builder.BuildDeleteCommand());
Expand Down Expand Up @@ -147,8 +150,8 @@ public Command BuildPatchCommand()
var cancellationToken = invocationContext.GetCancellationToken();
var reqAdapter = invocationContext.GetRequestAdapter();
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
var model = parseNode.GetObjectValue<ApiSdk.Models.Edge>(ApiSdk.Models.Edge.CreateFromDiscriminatorValue);
var parseNode = await ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNodeAsync("application/json", stream, cancellationToken);
var model = parseNode.GetObjectValue<global::ApiSdk.Models.Edge>(global::ApiSdk.Models.Edge.CreateFromDiscriminatorValue);
if (model is null) {
Console.Error.WriteLine("No model data to send.");
return;
Expand All @@ -168,14 +171,14 @@ public Command BuildPatchCommand()
return command;
}
/// <summary>
/// Instantiates a new <see cref="EdgeRequestBuilder"/> and sets the default values.
/// Instantiates a new <see cref="global::ApiSdk.Admin.Edge.EdgeRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
public EdgeRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/admin/edge{?%24expand,%24select}", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="EdgeRequestBuilder"/> and sets the default values.
/// Instantiates a new <see cref="global::ApiSdk.Admin.Edge.EdgeRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public EdgeRequestBuilder(string rawUrl) : base("{+baseurl}/admin/edge{?%24expand,%24select}", rawUrl)
Expand Down Expand Up @@ -207,11 +210,11 @@ public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<EdgeRequestBuilderGetQueryParameters>>? requestConfiguration = default)
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::ApiSdk.Admin.Edge.EdgeRequestBuilder.EdgeRequestBuilderGetQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<EdgeRequestBuilderGetQueryParameters>> requestConfiguration = default)
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::ApiSdk.Admin.Edge.EdgeRequestBuilder.EdgeRequestBuilderGetQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
Expand All @@ -227,11 +230,11 @@ public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<Ed
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Edge body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
public RequestInformation ToPatchRequestInformation(global::ApiSdk.Models.Edge body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Edge body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
public RequestInformation ToPatchRequestInformation(global::ApiSdk.Models.Edge body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
Expand All @@ -243,7 +246,8 @@ public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Edge body, Act
/// <summary>
/// A container for Microsoft Edge resources. Read-only.
/// </summary>
public class EdgeRequestBuilderGetQueryParameters
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class EdgeRequestBuilderGetQueryParameters
{
/// <summary>Expand related entities</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand All @@ -268,3 +272,4 @@ public class EdgeRequestBuilderGetQueryParameters
}
}
}
#pragma warning restore CS0618
Loading
Loading