Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit a31673a

Browse files
authored
Merge pull request #409 from microsoftgraph/kiota/v1.0/pipelinebuild/130446
Generated models and request builders
2 parents c2c1fb1 + 9f556af commit a31673a

File tree

142 files changed

+1990
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1990
-560
lines changed

src/generated/Admin/AdminRequestBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ public Command BuildPeopleNavCommand() {
143143
var execCommands = new List<Command>();
144144
var nonExecCommands = new List<Command>();
145145
execCommands.Add(builder.BuildGetCommand());
146-
execCommands.Add(builder.BuildPatchCommand());
147146
nonExecCommands.Add(builder.BuildProfileCardPropertiesNavCommand());
147+
nonExecCommands.Add(builder.BuildPronounsNavCommand());
148148
foreach (var cmd in execCommands)
149149
{
150150
command.AddCommand(cmd);

src/generated/Admin/People/PeopleRequestBuilder.cs

Lines changed: 17 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// <auto-generated/>
22
using ApiSdk.Admin.People.ProfileCardProperties;
3+
using ApiSdk.Admin.People.Pronouns;
34
using ApiSdk.Models.ODataErrors;
45
using ApiSdk.Models;
56
using Microsoft.Kiota.Abstractions.Serialization;
@@ -66,49 +67,6 @@ public Command BuildGetCommand() {
6667
return command;
6768
}
6869
/// <summary>
69-
/// Update the navigation property people in admin
70-
/// </summary>
71-
public Command BuildPatchCommand() {
72-
var command = new Command("patch");
73-
command.Description = "Update the navigation property people in admin";
74-
var bodyOption = new Option<string>("--body", description: "The request body") {
75-
};
76-
bodyOption.IsRequired = true;
77-
command.AddOption(bodyOption);
78-
var outputOption = new Option<FormatterType>("--output", () => FormatterType.JSON);
79-
command.AddOption(outputOption);
80-
var queryOption = new Option<string>("--query");
81-
command.AddOption(queryOption);
82-
command.SetHandler(async (invocationContext) => {
83-
var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty;
84-
var output = invocationContext.ParseResult.GetValueForOption(outputOption);
85-
var query = invocationContext.ParseResult.GetValueForOption(queryOption);
86-
IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter");
87-
IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory");
88-
var cancellationToken = invocationContext.GetCancellationToken();
89-
var reqAdapter = invocationContext.GetRequestAdapter();
90-
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
91-
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
92-
var model = parseNode.GetObjectValue<PeopleAdminSettings>(PeopleAdminSettings.CreateFromDiscriminatorValue);
93-
if (model is null) {
94-
Console.Error.WriteLine("No model data to send.");
95-
return;
96-
}
97-
var requestInfo = ToPatchRequestInformation(model, q => {
98-
});
99-
requestInfo.SetContentFromParsable(reqAdapter, "application/json", model);
100-
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
101-
{"4XX", ODataError.CreateFromDiscriminatorValue},
102-
{"5XX", ODataError.CreateFromDiscriminatorValue},
103-
};
104-
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null;
105-
response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response;
106-
var formatter = outputFormatterFactory.GetFormatter(output);
107-
await formatter.WriteOutputAsync(response, cancellationToken);
108-
});
109-
return command;
110-
}
111-
/// <summary>
11270
/// Provides operations to manage the profileCardProperties property of the microsoft.graph.peopleAdminSettings entity.
11371
/// </summary>
11472
public Command BuildProfileCardPropertiesNavCommand() {
@@ -134,6 +92,22 @@ public Command BuildProfileCardPropertiesNavCommand() {
13492
return command;
13593
}
13694
/// <summary>
95+
/// Provides operations to manage the pronouns property of the microsoft.graph.peopleAdminSettings entity.
96+
/// </summary>
97+
public Command BuildPronounsNavCommand() {
98+
var command = new Command("pronouns");
99+
command.Description = "Provides operations to manage the pronouns property of the microsoft.graph.peopleAdminSettings entity.";
100+
var builder = new PronounsRequestBuilder(PathParameters);
101+
var execCommands = new List<Command>();
102+
execCommands.Add(builder.BuildGetCommand());
103+
execCommands.Add(builder.BuildPatchCommand());
104+
foreach (var cmd in execCommands)
105+
{
106+
command.AddCommand(cmd);
107+
}
108+
return command;
109+
}
110+
/// <summary>
137111
/// Instantiates a new PeopleRequestBuilder and sets the default values.
138112
/// </summary>
139113
/// <param name="pathParameters">Path parameters for the request</param>
@@ -162,24 +136,6 @@ public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<Pe
162136
return requestInfo;
163137
}
164138
/// <summary>
165-
/// Update the navigation property people in admin
166-
/// </summary>
167-
/// <param name="body">The request body</param>
168-
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
169-
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
170-
#nullable enable
171-
public RequestInformation ToPatchRequestInformation(PeopleAdminSettings body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) {
172-
#nullable restore
173-
#else
174-
public RequestInformation ToPatchRequestInformation(PeopleAdminSettings body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) {
175-
#endif
176-
_ = body ?? throw new ArgumentNullException(nameof(body));
177-
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
178-
requestInfo.Configure(requestConfiguration);
179-
requestInfo.Headers.TryAdd("Accept", "application/json");
180-
return requestInfo;
181-
}
182-
/// <summary>
183139
/// Retrieve the properties and relationships of a peopleAdminSettings object.
184140
/// </summary>
185141
public class PeopleRequestBuilderGetQueryParameters {
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
// <auto-generated/>
2+
using ApiSdk.Models.ODataErrors;
3+
using ApiSdk.Models;
4+
using Microsoft.Kiota.Abstractions.Serialization;
5+
using Microsoft.Kiota.Abstractions;
6+
using Microsoft.Kiota.Cli.Commons.Extensions;
7+
using Microsoft.Kiota.Cli.Commons.IO;
8+
using Microsoft.Kiota.Cli.Commons;
9+
using System.Collections.Generic;
10+
using System.CommandLine;
11+
using System.IO;
12+
using System.Linq;
13+
using System.Text;
14+
using System.Threading.Tasks;
15+
using System.Threading;
16+
using System;
17+
namespace ApiSdk.Admin.People.Pronouns {
18+
/// <summary>
19+
/// Provides operations to manage the pronouns property of the microsoft.graph.peopleAdminSettings entity.
20+
/// </summary>
21+
public class PronounsRequestBuilder : BaseCliRequestBuilder {
22+
/// <summary>
23+
/// Get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.
24+
/// Find more info here <see href="https://learn.microsoft.com/graph/api/peopleadminsettings-list-pronouns?view=graph-rest-1.0" />
25+
/// </summary>
26+
public Command BuildGetCommand() {
27+
var command = new Command("get");
28+
command.Description = "Get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/peopleadminsettings-list-pronouns?view=graph-rest-1.0";
29+
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned") {
30+
Arity = ArgumentArity.ZeroOrMore
31+
};
32+
selectOption.IsRequired = false;
33+
command.AddOption(selectOption);
34+
var expandOption = new Option<string[]>("--expand", description: "Expand related entities") {
35+
Arity = ArgumentArity.ZeroOrMore
36+
};
37+
expandOption.IsRequired = false;
38+
command.AddOption(expandOption);
39+
var outputOption = new Option<FormatterType>("--output", () => FormatterType.JSON);
40+
command.AddOption(outputOption);
41+
var queryOption = new Option<string>("--query");
42+
command.AddOption(queryOption);
43+
command.SetHandler(async (invocationContext) => {
44+
var select = invocationContext.ParseResult.GetValueForOption(selectOption);
45+
var expand = invocationContext.ParseResult.GetValueForOption(expandOption);
46+
var output = invocationContext.ParseResult.GetValueForOption(outputOption);
47+
var query = invocationContext.ParseResult.GetValueForOption(queryOption);
48+
IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter");
49+
IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory");
50+
var cancellationToken = invocationContext.GetCancellationToken();
51+
var reqAdapter = invocationContext.GetRequestAdapter();
52+
var requestInfo = ToGetRequestInformation(q => {
53+
q.QueryParameters.Select = select;
54+
q.QueryParameters.Expand = expand;
55+
});
56+
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
57+
{"4XX", ODataError.CreateFromDiscriminatorValue},
58+
{"5XX", ODataError.CreateFromDiscriminatorValue},
59+
};
60+
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null;
61+
response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response;
62+
var formatter = outputFormatterFactory.GetFormatter(output);
63+
await formatter.WriteOutputAsync(response, cancellationToken);
64+
});
65+
return command;
66+
}
67+
/// <summary>
68+
/// Update the properties of a pronounsSettings object in an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.
69+
/// Find more info here <see href="https://learn.microsoft.com/graph/api/pronounssettings-update?view=graph-rest-1.0" />
70+
/// </summary>
71+
public Command BuildPatchCommand() {
72+
var command = new Command("patch");
73+
command.Description = "Update the properties of a pronounsSettings object in an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/pronounssettings-update?view=graph-rest-1.0";
74+
var bodyOption = new Option<string>("--body", description: "The request body") {
75+
};
76+
bodyOption.IsRequired = true;
77+
command.AddOption(bodyOption);
78+
var outputOption = new Option<FormatterType>("--output", () => FormatterType.JSON);
79+
command.AddOption(outputOption);
80+
var queryOption = new Option<string>("--query");
81+
command.AddOption(queryOption);
82+
command.SetHandler(async (invocationContext) => {
83+
var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty;
84+
var output = invocationContext.ParseResult.GetValueForOption(outputOption);
85+
var query = invocationContext.ParseResult.GetValueForOption(queryOption);
86+
IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter");
87+
IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory");
88+
var cancellationToken = invocationContext.GetCancellationToken();
89+
var reqAdapter = invocationContext.GetRequestAdapter();
90+
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
91+
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
92+
var model = parseNode.GetObjectValue<PronounsSettings>(PronounsSettings.CreateFromDiscriminatorValue);
93+
if (model is null) {
94+
Console.Error.WriteLine("No model data to send.");
95+
return;
96+
}
97+
var requestInfo = ToPatchRequestInformation(model, q => {
98+
});
99+
requestInfo.SetContentFromParsable(reqAdapter, "application/json", model);
100+
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
101+
{"4XX", ODataError.CreateFromDiscriminatorValue},
102+
{"5XX", ODataError.CreateFromDiscriminatorValue},
103+
};
104+
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null;
105+
response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response;
106+
var formatter = outputFormatterFactory.GetFormatter(output);
107+
await formatter.WriteOutputAsync(response, cancellationToken);
108+
});
109+
return command;
110+
}
111+
/// <summary>
112+
/// Instantiates a new PronounsRequestBuilder and sets the default values.
113+
/// </summary>
114+
/// <param name="pathParameters">Path parameters for the request</param>
115+
public PronounsRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/admin/people/pronouns{?%24select,%24expand}", pathParameters) {
116+
}
117+
/// <summary>
118+
/// Instantiates a new PronounsRequestBuilder and sets the default values.
119+
/// </summary>
120+
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
121+
public PronounsRequestBuilder(string rawUrl) : base("{+baseurl}/admin/people/pronouns{?%24select,%24expand}", rawUrl) {
122+
}
123+
/// <summary>
124+
/// Get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.
125+
/// </summary>
126+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
127+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
128+
#nullable enable
129+
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<PronounsRequestBuilderGetQueryParameters>>? requestConfiguration = default) {
130+
#nullable restore
131+
#else
132+
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<PronounsRequestBuilderGetQueryParameters>> requestConfiguration = default) {
133+
#endif
134+
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
135+
requestInfo.Configure(requestConfiguration);
136+
requestInfo.Headers.TryAdd("Accept", "application/json");
137+
return requestInfo;
138+
}
139+
/// <summary>
140+
/// Update the properties of a pronounsSettings object in an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.
141+
/// </summary>
142+
/// <param name="body">The request body</param>
143+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
144+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
145+
#nullable enable
146+
public RequestInformation ToPatchRequestInformation(PronounsSettings body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) {
147+
#nullable restore
148+
#else
149+
public RequestInformation ToPatchRequestInformation(PronounsSettings body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) {
150+
#endif
151+
_ = body ?? throw new ArgumentNullException(nameof(body));
152+
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
153+
requestInfo.Configure(requestConfiguration);
154+
requestInfo.Headers.TryAdd("Accept", "application/json");
155+
return requestInfo;
156+
}
157+
/// <summary>
158+
/// Get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API.
159+
/// </summary>
160+
public class PronounsRequestBuilderGetQueryParameters {
161+
/// <summary>Expand related entities</summary>
162+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
163+
#nullable enable
164+
[QueryParameter("%24expand")]
165+
public string[]? Expand { get; set; }
166+
#nullable restore
167+
#else
168+
[QueryParameter("%24expand")]
169+
public string[] Expand { get; set; }
170+
#endif
171+
/// <summary>Select properties to be returned</summary>
172+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
173+
#nullable enable
174+
[QueryParameter("%24select")]
175+
public string[]? Select { get; set; }
176+
#nullable restore
177+
#else
178+
[QueryParameter("%24select")]
179+
public string[] Select { get; set; }
180+
#endif
181+
}
182+
}
183+
}

0 commit comments

Comments
 (0)