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

Commit be700cb

Browse files
committed
Fix type issue on query parameters
1 parent fd561d8 commit be700cb

File tree

5,683 files changed

+154821
-84349
lines changed

Some content is hidden

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

5,683 files changed

+154821
-84349
lines changed

.vscode/launch.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
"preLaunchTask": "build",
1212
"program": "${workspaceFolder}/src/bin/Debug/net6.0/msgraph-cli.dll",
1313
"args": ["-h"],
14-
"cwd": "${workspaceFolder}",
14+
"cwd": "${workspaceFolder}/src",
15+
"console": "internalConsole",
16+
"stopAtEntry": false
17+
},
18+
{
19+
"name": "login",
20+
"type": "coreclr",
21+
"request": "launch",
22+
"preLaunchTask": "build",
23+
"program": "${workspaceFolder}/src/bin/Debug/net6.0/msgraph-cli.dll",
24+
"args": ["login", "--scopes", "User.ReadWrite Mail.ReadWrite"],
25+
"cwd": "${workspaceFolder}/src",
1526
"console": "internalConsole",
1627
"stopAtEntry": false
1728
},
@@ -21,8 +32,8 @@
2132
"request": "launch",
2233
"preLaunchTask": "build",
2334
"program": "${workspaceFolder}/src/bin/Debug/net6.0/msgraph-cli.dll",
24-
"args": ["me", "get"],
25-
"cwd": "${workspaceFolder}",
35+
"args": ["me", "get", "--select", "id", "--select", "displayName"],
36+
"cwd": "${workspaceFolder}/src",
2637
"console": "internalConsole",
2738
"stopAtEntry": false
2839
},

src/generated/Admin/AdminRequestBuilder.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@ public Command BuildGetCommand() {
2727
var command = new Command("get");
2828
command.Description = "Get admin";
2929
// Create options for all the parameters
30-
command.AddOption(new Option<object>("--select", description: "Select properties to be returned"));
31-
command.AddOption(new Option<object>("--expand", description: "Expand related entities"));
32-
command.Handler = CommandHandler.Create<object, object>(async (select, expand) => {
33-
var requestInfo = CreateGetRequestInformation();
34-
requestInfo.QueryParameters.Add("select", select);
35-
requestInfo.QueryParameters.Add("expand", expand);
30+
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned");
31+
selectOption.IsRequired = false;
32+
selectOption.Arity = ArgumentArity.ZeroOrMore;
33+
command.AddOption(selectOption);
34+
var expandOption = new Option<string[]>("--expand", description: "Expand related entities");
35+
expandOption.IsRequired = false;
36+
expandOption.Arity = ArgumentArity.ZeroOrMore;
37+
command.AddOption(expandOption);
38+
command.Handler = CommandHandler.Create<string[], string[]>(async (select, expand) => {
39+
var requestInfo = CreateGetRequestInformation(q => {
40+
q.Select = select;
41+
q.Expand = expand;
42+
});
3643
var result = await RequestAdapter.SendAsync<ApiSdk.Models.Microsoft.Graph.Admin>(requestInfo);
3744
// Print request output. What if the request has no return?
3845
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
@@ -51,12 +58,15 @@ public Command BuildPatchCommand() {
5158
var command = new Command("patch");
5259
command.Description = "Update admin";
5360
// Create options for all the parameters
54-
command.AddOption(new Option<string>("--body"));
61+
var bodyOption = new Option<string>("--body");
62+
bodyOption.IsRequired = true;
63+
command.AddOption(bodyOption);
5564
command.Handler = CommandHandler.Create<string>(async (body) => {
5665
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
5766
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
5867
var model = parseNode.GetObjectValue<ApiSdk.Models.Microsoft.Graph.Admin>();
59-
var requestInfo = CreatePatchRequestInformation(model);
68+
var requestInfo = CreatePatchRequestInformation(model, q => {
69+
});
6070
await RequestAdapter.SendNoContentAsync(requestInfo);
6171
// Print request output. What if the request has no return?
6272
Console.WriteLine("Success");

src/generated/Admin/ServiceAnnouncement/HealthOverviews/HealthOverviewsRequestBuilder.cs

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ public Command BuildCreateCommand() {
3737
var command = new Command("create");
3838
command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly.";
3939
// Create options for all the parameters
40-
command.AddOption(new Option<string>("--body"));
40+
var bodyOption = new Option<string>("--body");
41+
bodyOption.IsRequired = true;
42+
command.AddOption(bodyOption);
4143
command.Handler = CommandHandler.Create<string>(async (body) => {
4244
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
4345
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
4446
var model = parseNode.GetObjectValue<ServiceHealth>();
45-
var requestInfo = CreatePostRequestInformation(model);
47+
var requestInfo = CreatePostRequestInformation(model, q => {
48+
});
4649
var result = await RequestAdapter.SendAsync<ServiceHealth>(requestInfo);
4750
// Print request output. What if the request has no return?
4851
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
@@ -61,24 +64,44 @@ public Command BuildListCommand() {
6164
var command = new Command("list");
6265
command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly.";
6366
// Create options for all the parameters
64-
command.AddOption(new Option<int?>("--top", description: "Show only the first n items"));
65-
command.AddOption(new Option<int?>("--skip", description: "Skip the first n items"));
66-
command.AddOption(new Option<string>("--search", description: "Search items by search phrases"));
67-
command.AddOption(new Option<string>("--filter", description: "Filter items by property values"));
68-
command.AddOption(new Option<bool?>("--count", description: "Include count of items"));
69-
command.AddOption(new Option<object>("--orderby", description: "Order items by property values"));
70-
command.AddOption(new Option<object>("--select", description: "Select properties to be returned"));
71-
command.AddOption(new Option<object>("--expand", description: "Expand related entities"));
72-
command.Handler = CommandHandler.Create<int?, int?, string, string, bool?, object, object, object>(async (top, skip, search, filter, count, orderby, select, expand) => {
73-
var requestInfo = CreateGetRequestInformation();
74-
requestInfo.QueryParameters.Add("top", top);
75-
requestInfo.QueryParameters.Add("skip", skip);
76-
if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search);
77-
if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter);
78-
requestInfo.QueryParameters.Add("count", count);
79-
requestInfo.QueryParameters.Add("orderby", orderby);
80-
requestInfo.QueryParameters.Add("select", select);
81-
requestInfo.QueryParameters.Add("expand", expand);
67+
var topOption = new Option<int?>("--top", description: "Show only the first n items");
68+
topOption.IsRequired = false;
69+
command.AddOption(topOption);
70+
var skipOption = new Option<int?>("--skip", description: "Skip the first n items");
71+
skipOption.IsRequired = false;
72+
command.AddOption(skipOption);
73+
var searchOption = new Option<string>("--search", description: "Search items by search phrases");
74+
searchOption.IsRequired = false;
75+
command.AddOption(searchOption);
76+
var filterOption = new Option<string>("--filter", description: "Filter items by property values");
77+
filterOption.IsRequired = false;
78+
command.AddOption(filterOption);
79+
var countOption = new Option<bool?>("--count", description: "Include count of items");
80+
countOption.IsRequired = false;
81+
command.AddOption(countOption);
82+
var orderbyOption = new Option<string[]>("--orderby", description: "Order items by property values");
83+
orderbyOption.IsRequired = false;
84+
orderbyOption.Arity = ArgumentArity.ZeroOrMore;
85+
command.AddOption(orderbyOption);
86+
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned");
87+
selectOption.IsRequired = false;
88+
selectOption.Arity = ArgumentArity.ZeroOrMore;
89+
command.AddOption(selectOption);
90+
var expandOption = new Option<string[]>("--expand", description: "Expand related entities");
91+
expandOption.IsRequired = false;
92+
expandOption.Arity = ArgumentArity.ZeroOrMore;
93+
command.AddOption(expandOption);
94+
command.Handler = CommandHandler.Create<int?, int?, string, string, bool?, string[], string[], string[]>(async (top, skip, search, filter, count, orderby, select, expand) => {
95+
var requestInfo = CreateGetRequestInformation(q => {
96+
q.Top = top;
97+
q.Skip = skip;
98+
if (!String.IsNullOrEmpty(search)) q.Search = search;
99+
if (!String.IsNullOrEmpty(filter)) q.Filter = filter;
100+
q.Count = count;
101+
q.Orderby = orderby;
102+
q.Select = select;
103+
q.Expand = expand;
104+
});
82105
var result = await RequestAdapter.SendAsync<HealthOverviewsResponse>(requestInfo);
83106
// Print request output. What if the request has no return?
84107
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");

src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/IssuesRequestBuilder.cs

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ public Command BuildCreateCommand() {
3636
var command = new Command("create");
3737
command.Description = "A collection of issues happened on the service, with detailed information for each issue.";
3838
// Create options for all the parameters
39-
command.AddOption(new Option<string>("--servicehealth-id", description: "key: id of serviceHealth"));
40-
command.AddOption(new Option<string>("--body"));
39+
var serviceHealthIdOption = new Option<string>("--servicehealth-id", description: "key: id of serviceHealth");
40+
serviceHealthIdOption.IsRequired = true;
41+
command.AddOption(serviceHealthIdOption);
42+
var bodyOption = new Option<string>("--body");
43+
bodyOption.IsRequired = true;
44+
command.AddOption(bodyOption);
4145
command.Handler = CommandHandler.Create<string, string>(async (serviceHealthId, body) => {
4246
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
4347
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
4448
var model = parseNode.GetObjectValue<ServiceHealthIssue>();
45-
var requestInfo = CreatePostRequestInformation(model);
46-
if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId);
49+
var requestInfo = CreatePostRequestInformation(model, q => {
50+
});
4751
var result = await RequestAdapter.SendAsync<ServiceHealthIssue>(requestInfo);
4852
// Print request output. What if the request has no return?
4953
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
@@ -62,26 +66,47 @@ public Command BuildListCommand() {
6266
var command = new Command("list");
6367
command.Description = "A collection of issues happened on the service, with detailed information for each issue.";
6468
// Create options for all the parameters
65-
command.AddOption(new Option<string>("--servicehealth-id", description: "key: id of serviceHealth"));
66-
command.AddOption(new Option<int?>("--top", description: "Show only the first n items"));
67-
command.AddOption(new Option<int?>("--skip", description: "Skip the first n items"));
68-
command.AddOption(new Option<string>("--search", description: "Search items by search phrases"));
69-
command.AddOption(new Option<string>("--filter", description: "Filter items by property values"));
70-
command.AddOption(new Option<bool?>("--count", description: "Include count of items"));
71-
command.AddOption(new Option<object>("--orderby", description: "Order items by property values"));
72-
command.AddOption(new Option<object>("--select", description: "Select properties to be returned"));
73-
command.AddOption(new Option<object>("--expand", description: "Expand related entities"));
74-
command.Handler = CommandHandler.Create<string, int?, int?, string, string, bool?, object, object, object>(async (serviceHealthId, top, skip, search, filter, count, orderby, select, expand) => {
75-
var requestInfo = CreateGetRequestInformation();
76-
if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId);
77-
requestInfo.QueryParameters.Add("top", top);
78-
requestInfo.QueryParameters.Add("skip", skip);
79-
if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search);
80-
if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter);
81-
requestInfo.QueryParameters.Add("count", count);
82-
requestInfo.QueryParameters.Add("orderby", orderby);
83-
requestInfo.QueryParameters.Add("select", select);
84-
requestInfo.QueryParameters.Add("expand", expand);
69+
var serviceHealthIdOption = new Option<string>("--servicehealth-id", description: "key: id of serviceHealth");
70+
serviceHealthIdOption.IsRequired = true;
71+
command.AddOption(serviceHealthIdOption);
72+
var topOption = new Option<int?>("--top", description: "Show only the first n items");
73+
topOption.IsRequired = false;
74+
command.AddOption(topOption);
75+
var skipOption = new Option<int?>("--skip", description: "Skip the first n items");
76+
skipOption.IsRequired = false;
77+
command.AddOption(skipOption);
78+
var searchOption = new Option<string>("--search", description: "Search items by search phrases");
79+
searchOption.IsRequired = false;
80+
command.AddOption(searchOption);
81+
var filterOption = new Option<string>("--filter", description: "Filter items by property values");
82+
filterOption.IsRequired = false;
83+
command.AddOption(filterOption);
84+
var countOption = new Option<bool?>("--count", description: "Include count of items");
85+
countOption.IsRequired = false;
86+
command.AddOption(countOption);
87+
var orderbyOption = new Option<string[]>("--orderby", description: "Order items by property values");
88+
orderbyOption.IsRequired = false;
89+
orderbyOption.Arity = ArgumentArity.ZeroOrMore;
90+
command.AddOption(orderbyOption);
91+
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned");
92+
selectOption.IsRequired = false;
93+
selectOption.Arity = ArgumentArity.ZeroOrMore;
94+
command.AddOption(selectOption);
95+
var expandOption = new Option<string[]>("--expand", description: "Expand related entities");
96+
expandOption.IsRequired = false;
97+
expandOption.Arity = ArgumentArity.ZeroOrMore;
98+
command.AddOption(expandOption);
99+
command.Handler = CommandHandler.Create<string, int?, int?, string, string, bool?, string[], string[], string[]>(async (serviceHealthId, top, skip, search, filter, count, orderby, select, expand) => {
100+
var requestInfo = CreateGetRequestInformation(q => {
101+
q.Top = top;
102+
q.Skip = skip;
103+
if (!String.IsNullOrEmpty(search)) q.Search = search;
104+
if (!String.IsNullOrEmpty(filter)) q.Filter = filter;
105+
q.Count = count;
106+
q.Orderby = orderby;
107+
q.Select = select;
108+
q.Expand = expand;
109+
});
85110
var result = await RequestAdapter.SendAsync<IssuesResponse>(requestInfo);
86111
// Print request output. What if the request has no return?
87112
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");

src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ public Command BuildGetCommand() {
2525
var command = new Command("get");
2626
command.Description = "Invoke function incidentReport";
2727
// Create options for all the parameters
28-
command.AddOption(new Option<string>("--servicehealth-id", description: "key: id of serviceHealth"));
29-
command.AddOption(new Option<string>("--servicehealthissue-id", description: "key: id of serviceHealthIssue"));
28+
var serviceHealthIdOption = new Option<string>("--servicehealth-id", description: "key: id of serviceHealth");
29+
serviceHealthIdOption.IsRequired = true;
30+
command.AddOption(serviceHealthIdOption);
31+
var serviceHealthIssueIdOption = new Option<string>("--servicehealthissue-id", description: "key: id of serviceHealthIssue");
32+
serviceHealthIssueIdOption.IsRequired = true;
33+
command.AddOption(serviceHealthIssueIdOption);
3034
command.AddOption(new Option<FileInfo>("--output"));
3135
command.Handler = CommandHandler.Create<string, string, FileInfo>(async (serviceHealthId, serviceHealthIssueId, output) => {
32-
var requestInfo = CreateGetRequestInformation();
33-
if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId);
34-
if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId);
36+
var requestInfo = CreateGetRequestInformation(q => {
37+
});
3538
var result = await RequestAdapter.SendPrimitiveAsync<Stream>(requestInfo);
3639
// Print request output. What if the request has no return?
3740
if (output == null) {

0 commit comments

Comments
 (0)